On Wed, 6 May 2026 07:45:41 GMT, Thomas Schatzl <[email protected]> wrote:
> Hi all, > > please review this change that allows building of the JDK without Serial GC > enabled. > > There were some hardcoded entries for -XX:+UseSerialGC in the makefiles, and > one of the gtests is serial gc specific and needed to be moved. Noticed > during tests with JEP 523: Make G1 the Default Garbage Collector in All > Environments. > > I opted to a different fix than suggested in the CR, instead of wholesale > ignoring unrecognized options, only add serial gc to the relevant options if > the feature is enabled in the build. The change seems small enough. > > Tested manually with and without `--with-jvm-features=-serialgc`, both image > building and running the test works in both cases (being skipped/not found if > serial gc has not been enabled). > > Other testing: gha > > Thanks, > Thomas > > > > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). make/autoconf/boot-jdk.m4 line 485: > 483: > 484: # Use serial gc for small short lived tools if possible > 485: > UTIL_ADD_JVM_GC_ARG_IF_OK([-XX:+UseSerialGC],boot_jdk_jvmargs_small,[$JAVA],[serialgc]) Something is off here. This builds up `boot_jdk_jvmargs`, which has no relationship to the JVM feature flags enabled currently in the build. That is, if you have a boot JDK that does not carry Serial, it would still fail. There is a block below, saying: # Don't presuppose SerialGC is present in the buildjdk. Also, we cannot test # the buildjdk, but on the other hand we know what it will support. Which seems to say that we just "know" Serial would be there. But that is a flimsy precondition. So maybe we should "just" stop opting into Serial GC everywhere, and rely on default collector choice. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/31049#discussion_r3195027838
