--- old/make/CompileJavaModules.gmk 2015-03-03 12:46:47.048193264 +0100 +++ new/make/CompileJavaModules.gmk 2015-03-03 12:46:46.960189574 +0100 @@ -467,11 +467,15 @@ # space separated list. JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER))) +# Create an empty directory to set the bootclasspath to. +EMPTY_BOOTCLASSPATH := $(OUTPUT_ROOT)/tmp/empty-dir +$(call MakeDir, $(EMPTY_BOOTCLASSPATH)) + # This macro sets up compilation of a module and declares dependencies for it. # Param 1 - module name define SetupModuleCompilation # Find the module dependencies by parsing modules.list file - $1_DEPS := $$(call FindDepsForModule, $1) + $1_DEPS := $$(call FindTransitiveDepsForModule, $1) $1_CLASSPATH := $$(addprefix $(JDK_OUTPUTDIR)/modules/,$$($1_DEPS)) # When crypto classes are prebuilt, need to look for classes already in @@ -485,7 +489,7 @@ $1_CLASSPATH := $$($1_CLASSPATH) $$(addprefix $(JDK_OUTPUTDIR)/modules/,jdk.hotspot.agent) endif $1_CLASSPATH := $$(subst $$(SPACE),$$(PATH_SEP),$$($1_CLASSPATH)) - $1_JAVAC_FLAGS := -bootclasspath "$$($1_CLASSPATH)" + $1_JAVAC_FLAGS := -bootclasspath $(EMPTY_BOOTCLASSPATH) -classpath "$$($1_CLASSPATH)" $$(eval $$(call SetupJavaCompilation,$1, \ SETUP := $$(if $$($1_SETUP), $$($1_SETUP), GENERATE_JDKBYTECODE), \ --- old/make/common/JavaCompilation.gmk 2015-03-03 12:46:47.444209871 +0100 +++ new/make/common/JavaCompilation.gmk 2015-03-03 12:46:47.360206348 +0100 @@ -577,10 +577,6 @@ $$($1_BIN)/_the.$1_batch: $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE) $(MKDIR) -p $$(@D) $$(dir $$($1_SJAVAC_PORTFILE)) - # As a workaround for sjavac not tracking api changed from the classpath, force full - # recompile if an external dependency, which is something other than a source - # change, triggered this compilation. - $$(if $$(filter-out $$($1_SRCS), $$?), $(FIND) $$(@D) -name "*.class" $(FIND_DELETE)) $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp) $(ECHO) Compiling $1 ($$($1_JVM) $$($1_SJAVAC) \ --- old/make/common/Modules.gmk 2015-03-03 12:46:47.848226812 +0100 +++ new/make/common/Modules.gmk 2015-03-03 12:46:47.752222787 +0100 @@ -89,6 +89,15 @@ $(DEPS_$(strip $1)) endef +# Finds transitive dependencies in 3 levels. +# Param 1: Module to find transitive deps for +FindTransitiveDepsForModule = \ + $(sort $(call FindDepsForModule, $1) \ + $(foreach m, $(call FindDepsForModule, $1), \ + $(call FindDepsForModule, $m) \ + $(foreach n, $(call FindDepsForModule, $m), \ + $(call FindDepsForModule, $n)))) + ################################################################################ # Hook to include the corresponding custom file, if present.