--- a/make/CreateJmods.gmk Thu Apr 28 08:26:30 2016 -0700
+++ b/make/CreateJmods.gmk Tue May 03 09:09:07 2016 +0100
@@ -64,9 +64,25 @@
DEPS += $(call CacheFind, $(CLASSES_DIR))
endif
-# Add dependencies on other jmod files
-DEPS += $(patsubst %, $(IMAGES_OUTPUTDIR)/jmods/%.jmod, \
- $(call FindDepsForModule, $(MODULE)))
+# Add dependencies on other jmod files. Only java.base needs access to other
+# jmods.
+ifeq ($(MODULE), java.base)
+ DEPS += $(patsubst %, $(IMAGES_OUTPUTDIR)/jmods/%.jmod, \
+ $(filter-out java.base, $(call FindAllModules)))
+
+ # TODO: find modules that directly and indrectly on upgradeable modules
+ EXCLUDE_HASH_MODULES := $(UPGRADEABLE_MODULES) \
+ java.se.ee \
+ jdk.rmic \
+ jdk.xml.bind \
+ jdk.xml.ws \
+ #
+
+ EXCLUDE_PATTERN := $(strip $(subst $(SPACE),|,$(strip $(EXCLUDE_HASH_MODULES))))
+
+ JMOD_FLAGS += --modulepath $(IMAGES_OUTPUTDIR)/jmods \
+ --hash-modules '^(?!$(EXCLUDE_PATTERN))'
+endif
# TODO: What about headers?
# Create jmods in a temp dir and then move them into place to keep the
@@ -81,7 +97,6 @@
--os-arch $(OPENJDK_TARGET_CPU_LEGACY) \
--os-version $(REQUIRED_OS_VERSION) \
--modulepath $(IMAGES_OUTPUTDIR)/jmods\
- --hash-dependencies '.*' \
--exclude '**_the.*' \
$(JMOD_FLAGS) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@)
$(MV) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@) $@