diff --git a/make/Main.gmk b/make/Main.gmk index e13e6f47386..94d66106507 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -967,11 +967,15 @@ else jdk.compiler-gendata: $(GENSRC_MODULEINFO_TARGETS) # Declare dependencies between jmod targets. - # java.base jmod needs jrt-fs.jar and access to the other jmods to be built. + # java.base jmod needs jrt-fs.jar and access to the jmods for all non + # upgradeable modules and their transitive dependencies. # When creating the BUILDJDK, we don't need to add hashes to java.base, thus # we don't need to depend on all other jmods ifneq ($(CREATING_BUILDJDK), true) - java.base-jmod: jrtfs-jar $(filter-out java.base-jmod, $(JMOD_TARGETS)) + java.base-jmod: jrtfs-jar $(addsuffix -jmod, $(filter-out java.base, $(sort \ + $(foreach m, $(filter-out $(call FindAllUpgradeableModules), $(JMOD_MODULES)), \ + $m $(call FindTransitiveDepsForModules, $m) \ + )))) endif # If not already set, set the JVM target so that the JVM will be built.