On Tue, 23 Aug 2022 21:42:00 GMT, Ioi Lam <ik...@openjdk.org> wrote: >> Oh, the loop is already there, it's jus the naming of the variable. I think >> we should adjust that so the check-jvm-feature macro can be used. > > @erikj79 I couldn't get it to work. I believe the following is evaluated only > once, so `$(JVM_VARIANT)` is bound to the value when HotspotCommon.gmk is > loaded: > > > check-jvm-feature = \ > $(strip \ > $(if $(filter-out $(VALID_JVM_FEATURES), $1), \ > $(error Internal error: Invalid feature tested: $1)) \ > $(if $(filter $1, $(JVM_FEATURES_$(JVM_VARIANT))), true, false)) > > > So I would need to run a submake in order to get this function to behave > differently for each variant. That's going to be complicated in order to > support multiple JVM variants per build. > > I heard that we are going to remove multiple variant support (?), so maybe > this is not worth it.
The suggested code should be something like this, note the double `$$` in the call. Suggestion: $1_$2_CDS_DUMP_FLAGS := $$(CDS_DUMP_FLAGS) ifeq ($$(call check-jvm-feature, g1gc), true) $1_$2_CDS_DUMP_FLAGS += -XX:+UseG1GC endif ------------- PR: https://git.openjdk.org/jdk/pull/9984