changeset 37770:9f040cf69078

8150044: Generate classlists at build-time Reviewed-by: alanb, mchung, iklam Contributed-by: claes.redestad@oracle.com, erik.joelsson@oracle.com
author redestad
date Sat, 07 May 2016 01:21:08 +0200
parents 96f9a38fb70e
children 30f2faf0e7a6
files common/autoconf/boot-jdk.m4 common/autoconf/buildjdk-spec.gmk.in common/autoconf/generated-configure.sh common/autoconf/spec.gmk.in make/CreateBuildJdkCopy.gmk make/CreateJmods.gmk make/Images.gmk make/InterimImage.gmk make/Main.gmk make/common/MakeBase.gmk make/common/Modules.gmk
diffstat 11 files changed, 203 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/common/autoconf/boot-jdk.m4	Thu May 05 22:39:14 2016 -0700
+++ b/common/autoconf/boot-jdk.m4	Sat May 07 01:21:08 2016 +0200
@@ -474,7 +474,8 @@
   AC_ARG_WITH(build-jdk, [AS_HELP_STRING([--with-build-jdk],
       [path to JDK of same version as is being built@<:@the newly built JDK@:>@])])
 
-  CREATE_BUILDJDK_FOR_HOST=false
+  CREATE_BUILDJDK=false
+  EXTERNAL_BUILDJDK=false
   BUILD_JDK_FOUND="no"
   if test "x$with_build_jdk" != "x"; then
     BOOTJDK_CHECK_BUILD_JDK([
@@ -483,6 +484,7 @@
          BUILD_JDK_FOUND=maybe
          AC_MSG_NOTICE([Found potential Build JDK using configure arguments])
        fi])
+    EXTERNAL_BUILDJDK=true
   else
     if test "x$COMPILE_TYPE" = "xcross"; then
       BUILD_JDK="\$(BUILDJDK_OUTPUTDIR)/jdk"
@@ -506,4 +508,5 @@
 
   AC_SUBST(CREATE_BUILDJDK)
   AC_SUBST(BUILD_JDK)
+  AC_SUBST(EXTERNAL_BUILDJDK)
 ])
--- a/common/autoconf/buildjdk-spec.gmk.in	Thu May 05 22:39:14 2016 -0700
+++ b/common/autoconf/buildjdk-spec.gmk.in	Sat May 07 01:21:08 2016 +0200
@@ -46,6 +46,7 @@
 HOTSPOT_DIST := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(HOTSPOT_DIST))
 SUPPORT_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(SUPPORT_OUTPUTDIR))
 JDK_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(JDK_OUTPUTDIR))
+IMAGES_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(IMAGES_OUTPUTDIR))
 
 OPENJDK_BUILD_CPU_LEGACY := @OPENJDK_BUILD_CPU_LEGACY@
 OPENJDK_BUILD_CPU_LEGACY_LIB := @OPENJDK_BUILD_CPU_LEGACY_LIB@
--- a/common/autoconf/generated-configure.sh	Thu May 05 22:39:14 2016 -0700
+++ b/common/autoconf/generated-configure.sh	Sat May 07 01:21:08 2016 +0200
@@ -896,6 +896,7 @@
 JAXP_TOPDIR
 CORBA_TOPDIR
 LANGTOOLS_TOPDIR
+EXTERNAL_BUILDJDK
 BUILD_JDK
 CREATE_BUILDJDK
 BOOT_JDK_BITS
@@ -5070,7 +5071,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1462268995
+DATE_WHEN_GENERATED=1462574627
 
 ###############################################################################
 #
@@ -30171,7 +30172,8 @@
 fi
 
 
-  CREATE_BUILDJDK_FOR_HOST=false
+  CREATE_BUILDJDK=false
+  EXTERNAL_BUILDJDK=false
   BUILD_JDK_FOUND="no"
   if test "x$with_build_jdk" != "x"; then
 
@@ -30364,6 +30366,7 @@
     fi # end check build jdk found
   fi
 
+    EXTERNAL_BUILDJDK=true
   else
     if test "x$COMPILE_TYPE" = "xcross"; then
       BUILD_JDK="\$(BUILDJDK_OUTPUTDIR)/jdk"
@@ -30395,6 +30398,7 @@
 
 
 
+
 ###############################################################################
 #
 # Configure the sources to use. We can add or override individual directories.
--- a/common/autoconf/spec.gmk.in	Thu May 05 22:39:14 2016 -0700
+++ b/common/autoconf/spec.gmk.in	Sat May 07 01:21:08 2016 +0200
@@ -283,6 +283,7 @@
 
 BUILD_JDK:=@BUILD_JDK@
 CREATE_BUILDJDK:=@CREATE_BUILDJDK@
+EXTERNAL_BUILDJDK:=@EXTERNAL_BUILDJDK@
 
 # When compiling Java source to be run by the boot jdk
 # use these extra flags, eg -source 6 -target 6
@@ -777,6 +778,9 @@
 SYMBOLS_IMAGE_SUBDIR:=symbols
 SYMBOLS_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(SYMBOLS_IMAGE_SUBDIR)
 
+# Interim image
+INTERIM_IMAGE_DIR := $(SUPPORT_OUTPUTDIR)/interim-image
+
 # Macosx bundles directory definitions
 JDK_MACOSX_BUNDLE_SUBDIR=jdk-bundle/jdk-$(VERSION_NUMBER).jdk/Contents
 JRE_MACOSX_BUNDLE_SUBDIR=jre-bundle/jre-$(VERSION_NUMBER).jre/Contents
--- a/make/CreateBuildJdkCopy.gmk	Thu May 05 22:39:14 2016 -0700
+++ b/make/CreateBuildJdkCopy.gmk	Sat May 07 01:21:08 2016 +0200
@@ -29,7 +29,9 @@
 include MakeBase.gmk
 include Modules.gmk
 
-MODULES_TO_COPY := $(call FindTransitiveDepsForModule, jdk.jlink) jdk.jlink
+MODULES_TO_COPY := $(sort \
+    $(foreach m, jdk.jlink $(INTERIM_IMAGE_MODULES), \
+      $(call FindTransitiveDepsForModule, $m) $m))
 
 ################################################################################
 # Copy the modules needed to run jlink and jmod. Use bulk copy instead of
@@ -49,15 +51,6 @@
 
 TARGETS += $(COPY_CLASSES_TARGET)
 
-#$(eval $(call SetupCopyFiles, COPY_JDK_MODULES, \
-    SRC := $(BUILD_OUTPUT), \
-    DEST := $(BUILDJDK_OUTPUTDIR), \
-    FILES := $(call DoubleDollar, $(call DoubleDollar, $(call CacheFind, $(wildcard \
-        $(addprefix $(JDK_OUTPUTDIR)/modules/, $(MODULES_TO_COPY)))))), \
-))
-
-#TARGETS += $(COPY_JDK_MODULES)
-
 ################################################################################
 
 $(eval $(call SetupCopyFiles, COPY_SUPPORT_HEADERS, \
--- a/make/CreateJmods.gmk	Thu May 05 22:39:14 2016 -0700
+++ b/make/CreateJmods.gmk	Sat May 07 01:21:08 2016 +0200
@@ -1,4 +1,4 @@
-#
+
 # Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
@@ -35,6 +35,8 @@
 
 ################################################################################
 
+JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods
+
 LIBS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
     $(SUPPORT_OUTPUTDIR)/modules_libs-stripped $(IMPORT_MODULES_LIBS))))
 CMDS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
@@ -67,28 +69,32 @@
 # 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)))
+  # When creating a BUILDJDK, we don't need to add hashes to java.base
+  ifneq ($(CREATING_BUILDJDK), true)
+    DEPS += $(patsubst %, $(JMODS_DIR)/%.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 \
-    #
+    # TODO: find modules that directly and indirectly depend 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))))
+    EXCLUDE_PATTERN := $(strip $(subst $(SPACE),|,$(strip $(EXCLUDE_HASH_MODULES))))
 
-  JMOD_FLAGS += --modulepath $(IMAGES_OUTPUTDIR)/jmods \
-    		--hash-modules '^(?!$(EXCLUDE_PATTERN))'
+    JMOD_FLAGS += --modulepath $(JMODS_DIR) \
+        --hash-modules '^(?!$(EXCLUDE_PATTERN))'
+  endif
 endif
 
 # TODO: What about headers?
 # Create jmods in a temp dir and then move them into place to keep the
 # module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
-$(IMAGES_OUTPUTDIR)/jmods/$(MODULE).jmod: $(DEPS)
-	$(call LogWarn, Creating $(notdir $@))
+$(JMODS_DIR)/$(MODULE).jmod: $(DEPS)
+	$(call LogWarn, Creating $(patsubst $(OUTPUT_ROOT)/%, %, $@))
 	$(call MakeDir, $(@D) $(SUPPORT_OUTPUTDIR)/jmods)
 	$(RM) $@ $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@)
 	$(JMOD) create \
@@ -96,7 +102,7 @@
             --os-name $(REQUIRED_OS_NAME) \
             --os-arch $(OPENJDK_TARGET_CPU_LEGACY) \
             --os-version $(REQUIRED_OS_VERSION) \
-	        --modulepath $(IMAGES_OUTPUTDIR)/jmods\
+	        --modulepath $(JMODS_DIR) \
             --exclude '**{_the.*,*.diz,*.debuginfo,*.dSYM/**,*.pdb,*.map}' \
 	    $(JMOD_FLAGS) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@)
 	$(MV) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@) $@
--- a/make/Images.gmk	Thu May 05 22:39:14 2016 -0700
+++ b/make/Images.gmk	Sat May 07 01:21:08 2016 +0200
@@ -56,19 +56,11 @@
 JRE_COMPACT2_MODULES := $(JRE_COMPACT1_MODULES) java.compact2 $(COMPACT2_EXTRA_MODULES)
 JRE_COMPACT3_MODULES := $(JRE_COMPACT2_MODULES) java.compact3 $(COMPACT3_EXTRA_MODULES)
 
-# Replacing double-comma with a single comma is to workaround the issue
-# with some version of make on windows that doesn't substitute spaces
-# with one comma properly as with make 4.0
-SubstComma = \
-    $(strip \
-        $(subst $(COMMA)$(COMMA),$(COMMA),$(subst $(SPACE),$(COMMA),$(strip $1))) \
-    )
-
-JRE_MODULES_LIST := $(call SubstComma, $(JRE_MODULES))
-JDK_MODULES_LIST := $(call SubstComma, $(JDK_MODULES))
-JRE_COMPACT1_MODULES_LIST := $(call SubstComma, $(JRE_COMPACT1_MODULES))
-JRE_COMPACT2_MODULES_LIST := $(call SubstComma, $(JRE_COMPACT2_MODULES))
-JRE_COMPACT3_MODULES_LIST := $(call SubstComma, $(JRE_COMPACT3_MODULES))
+JRE_MODULES_LIST := $(call CommaList, $(JRE_MODULES))
+JDK_MODULES_LIST := $(call CommaList, $(JDK_MODULES))
+JRE_COMPACT1_MODULES_LIST := $(call CommaList, $(JRE_COMPACT1_MODULES))
+JRE_COMPACT2_MODULES_LIST := $(call CommaList, $(JRE_COMPACT2_MODULES))
+JRE_COMPACT3_MODULES_LIST := $(call CommaList, $(JRE_COMPACT3_MODULES))
 
 ################################################################################
 # Release file
@@ -364,6 +356,23 @@
 JDK_TARGETS += $(JDK_IMAGE_DIR)/src.zip
 
 ################################################################################
+# classlist
+
+$(eval $(call SetupCopyFiles, JDK_COPY_CLASSLIST, \
+    FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \
+    DEST := $(JDK_IMAGE_DIR)/lib, \
+))
+
+JDK_TARGETS += $(JDK_COPY_CLASSLIST)
+
+$(eval $(call SetupCopyFiles, JRE_COPY_CLASSLIST, \
+    FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \
+    DEST := $(JRE_IMAGE_DIR)/lib, \
+))
+
+JRE_TARGETS += $(JRE_COPY_CLASSLIST)
+
+################################################################################
 # /demo dir
 ifneq ($(findstring images, $(MAKECMDGOALS)), )
   $(eval $(call SetupCopyFiles, JDK_COPY_DEMOS, \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/InterimImage.gmk	Sat May 07 01:21:08 2016 +0200
@@ -0,0 +1,60 @@
+#
+# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include Modules.gmk
+
+################################################################################
+
+# Use this file inside the image as target for make rule
+JIMAGE_TARGET_FILE := bin/java$(EXE_SUFFIX)
+
+INTERIM_MODULES_LIST := $(call CommaList, $(INTERIM_IMAGE_MODULES))
+
+JMODS := $(patsubst %, $(IMAGES_OUTPUTDIR)/jmods/%.jmod, $(INTERIM_IMAGE_MODULES))
+
+JLINK_TOOL := $(JLINK) \
+    --modulepath $(IMAGES_OUTPUTDIR)/jmods \
+    --endian $(OPENJDK_BUILD_CPU_ENDIAN)
+
+$(INTERIM_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
+    $(call DependOnVariable, INTERIM_MODULES_LIST)
+	$(ECHO) Creating interim jimage
+	$(RM) -r $(INTERIM_IMAGE_DIR)
+	$(JLINK_TOOL) \
+	    --output $(INTERIM_IMAGE_DIR) \
+	    --addmods $(INTERIM_MODULES_LIST)
+	$(TOUCH) $@
+
+TARGETS += $(INTERIM_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
+
+################################################################################
+
+all: $(TARGETS)
+
+.PHONY: all
--- a/make/Main.gmk	Thu May 05 22:39:14 2016 -0700
+++ b/make/Main.gmk	Sat May 07 01:21:08 2016 +0200
@@ -348,25 +348,35 @@
 ################################################################################
 # Cross compilation support
 
-ifeq ($(CREATE_BUILDJDK), true)
+ifeq ($(CREATING_BUILDJDK), true)
   # This target is only called by the recursive call below.
-  create-buildjdk-compile-hotspot-helper: hotspot
-  create-buildjdk-compile-modules-helper: jdk.jlink-launchers java.base-copy \
-      jdk.jdeps-launchers
+  create-buildjdk-interim-image-helper: interim-image jdk.jlink-launchers \
+      java.base-copy jdk.jdeps-launchers
 endif
 
 create-buildjdk-copy:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CreateBuildJdkCopy.gmk)
 
-create-buildjdk-compile-hotspot create-buildjdk-compile-modules:
+create-buildjdk-interim-image:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Main.gmk \
 	    $@-helper \
 	    SPEC=$(dir $(SPEC))buildjdk-spec.gmk \
 	    HOTSPOT_SPEC=$(dir $(SPEC))buildjdk-spec.gmk \
 	    CREATING_BUILDJDK=true)
 
-ALL_TARGETS += create-buildjdk-copy create-buildjdk-compile-hotspot \
-    create-buildjdk-compile-modules
+ALL_TARGETS += create-buildjdk-copy create-buildjdk-interim-image
+
+################################################################################
+# The interim-image is a small jlinked image that is used to generate artifacts 
+# at build time for use when linking the real images.
+
+interim-image:
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f InterimImage.gmk)
+
+generate-classlist:
+	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GenerateClasslist.gmk)
+
+ALL_TARGETS += interim-image generate-classlist
 
 ################################################################################
 # Build tests
@@ -522,10 +532,11 @@
   $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
 
   # Declare dependencies from <module>-lib to <module>-java
-  # Skip modules that do not have java source. When creating a BUILD_JDK, the
-  # java compilation has already been done by the normal build and copied in.
+  # Skip modules that do not have java source.
+  # When creating a BUILDJDK, the java compilation has already been done by the
+  # normal build and copied in.
   ifneq ($(CREATING_BUILDJDK), true)
-  $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs: $m-java))
+    $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs: $m-java))
   endif
 
   # Declare dependencies from all other <module>-lib to java.base-lib
@@ -564,11 +575,19 @@
 
   # Declare dependencies between jmod targets. Only java.base jmod needs access
   # to the other jmods to be built.
-  java.base-jmod: $(filter-out java.base-jmod, $(JMOD_TARGETS))
+  # When creating a 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: $(filter-out java.base-jmod, $(JMOD_TARGETS))
+  endif
 
   # Declare dependencies from <module>-jmod to all other module targets
   $(foreach m, $(STRIP_MODULES), $(eval $m-jmod: $m-strip))
-  $(foreach m, $(JAVA_MODULES), $(eval $m-jmod: $m-java))
+  # When creating a BUILDJDK, the java compilation has already been done by the
+  # normal build and copied in.
+  ifneq ($(CREATING_BUILDJDK), true)
+    $(foreach m, $(JAVA_MODULES), $(eval $m-jmod: $m-java))
+  endif
   $(foreach m, $(GENDATA_MODULES), $(eval $m-jmod: $m-gendata))
   $(foreach m, $(RMIC_MODULES), $(eval $m-jmod: $m-rmic))
   $(foreach m, $(LIBS_MODULES), $(eval $m-jmod: $m-libs))
@@ -577,10 +596,18 @@
 
   # Jmods cannot be created until we have the jlink tool ready to run, which requires
   # all java modules to be compiled and jdk.jlink-launchers.
-  $(JMOD_TARGETS): java java.base-libs jdk.jlink-launchers
+  $(JMOD_TARGETS): java.base-libs jdk.jlink-launchers
+  # When creating a BUILDJDK, the java compilation has already been done by the
+  # normal build and copied in.
+  ifneq ($(CREATING_BUILDJDK), true)
+    $(JMOD_TARGETS): java
+  endif
 
   ifeq ($(CREATE_BUILDJDK), true)
-    $(JMOD_TARGETS): create-buildjdk
+    # Avoid calling create-buildjdk from within a create-buildjdk call
+    ifneq ($(CREATING_BUILDJDK), true)
+      $(JMOD_TARGETS): create-buildjdk
+    endif
   endif
 
   zip-security: java.base-java java.security.jgss-java java.security.jgss-libs \
@@ -590,7 +617,18 @@
 
   jrtfs-jar: interim-langtools
 
-  jimages: jmods zip-source source-tips demos samples jrtfs-jar
+  ifeq ($(CREATE_BUILDJDK), true)
+    # If creating a buildjdk, the interim image needs to be based on that.
+    generate-classlist: create-buildjdk
+  else ifeq ($(EXTERNAL_BUILDJDK), false)
+    # If an external buildjdk has been provided, we skip generating an
+    # interim-image and just use the external buildjdk for generating
+    # classlist.
+    generate-classlist: interim-image
+  endif
+  generate-classlist: buildtools-jdk
+
+  jimages: jmods zip-source source-tips demos samples jrtfs-jar generate-classlist
 
   profiles: jmods zip-source source-tips jrtfs-jar
 
@@ -606,9 +644,12 @@
 
   test: jimages test-image
 
-  create-buildjdk-copy: jdk.jlink-java java.base-gendata
+  create-buildjdk-copy: jdk.jlink-java java.base-gendata \
+      $(addsuffix -java, $(INTERIM_IMAGE_MODULES))
 
-  create-buildjdk-compile-modules: create-buildjdk-copy create-buildjdk-compile-hotspot
+  create-buildjdk-interim-image: create-buildjdk-copy
+
+  interim-image: $(addsuffix -jmod, $(INTERIM_IMAGE_MODULES))
 
   test-make: clean-test-make
 
@@ -682,8 +723,7 @@
 # The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
 exploded-image: $(ALL_MODULES)
 
-create-buildjdk: create-buildjdk-compile-modules create-buildjdk-copy \
-    create-buildjdk-compile-hotspot
+create-buildjdk: create-buildjdk-copy create-buildjdk-interim-image
 
 mac-bundles: mac-bundles-jdk
 
@@ -694,10 +734,14 @@
 # (and possibly other, more specific versions)
 product-images: jimages demos samples zip-security exploded-image
 
-# When cross compiling and building a partial BUILDJDK for the build host,
-# the summary generation cannot be run.
+# The module summary cannot be run when:
+# * Cross compiling and building a partial BUILDJDK for the build host
+# * An external buildjdk has been supplied since it may not match the
+#   module selection of the target jdk
 ifneq ($(CREATE_BUILDJDK), true)
-  product-images: generate-summary
+  ifeq ($(EXTERNAL_BUILDJDK), false)
+    product-images: generate-summary
+  endif
 endif
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
--- a/make/common/MakeBase.gmk	Thu May 05 22:39:14 2016 -0700
+++ b/make/common/MakeBase.gmk	Sat May 07 01:21:08 2016 +0200
@@ -742,6 +742,17 @@
     $(if $(filter $1, $(JVM_VARIANTS)), true, false))
 
 ################################################################################
+# Converts a space separated list to a comma separated list.
+#
+# Replacing double-comma with a single comma is to workaround the issue with
+# some version of make on windows that doesn't substitute spaces with one comma
+# properly.
+CommaList = \
+  $(strip \
+      $(subst $(COMMA)$(COMMA),$(COMMA),$(subst $(SPACE),$(COMMA),$(strip $1))) \
+  )
+
+################################################################################
 
 # Hook to include the corresponding custom file, if present.
 $(eval $(call IncludeCustomExtension, , common/MakeBase.gmk))
--- a/make/common/Modules.gmk	Thu May 05 22:39:14 2016 -0700
+++ b/make/common/Modules.gmk	Sat May 07 01:21:08 2016 +0200
@@ -128,6 +128,10 @@
   PLATFORM_MODULES += jdk.crypto.ucrypto
 endif
 
+# These modules are included in the interim image which is used to run profiling
+# before building the real images.
+INTERIM_IMAGE_MODULES := java.base java.logging
+
 ################################################################################
 # Some platforms don't have the serviceability agent