Merge
authorlana
Thu, 26 May 2016 17:17:51 +0000
changeset 38547 3bad4c36820b
parent 38545 7760ebef7c63 (current diff)
parent 38546 91a5c3430d4f (diff)
child 38549 621f57997e82
Merge
--- a/common/autoconf/configure.ac	Thu May 26 16:02:14 2016 +0000
+++ b/common/autoconf/configure.ac	Thu May 26 17:17:51 2016 +0000
@@ -229,6 +229,7 @@
 
 JDKOPT_DETECT_INTREE_EC
 JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
+JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST
 
 ###############################################################################
 #
--- a/common/autoconf/generated-configure.sh	Thu May 26 16:02:14 2016 +0000
+++ b/common/autoconf/generated-configure.sh	Thu May 26 17:17:51 2016 +0000
@@ -650,6 +650,7 @@
 JOBS
 MEMORY_SIZE
 NUM_CORES
+ENABLE_GENERATE_CLASSLIST
 BUILD_FAILURE_HANDLER
 ENABLE_INTREE_EC
 STLPORT_LIB
@@ -1226,6 +1227,7 @@
 with_dxsdk_lib
 with_dxsdk_include
 enable_jtreg_failure_handler
+enable_generate_classlist
 with_num_cores
 with_memory_size
 with_jobs
@@ -2005,6 +2007,10 @@
                           Default is auto, where the failure handler is built
                           if all dependencies are present and otherwise just
                           disabled.
+  --disable-generate-classlist
+                          forces enabling or disabling of the generation of a
+                          CDS classlist at build time. Default is to generate
+                          it when either the server or client JVMs are built.
   --enable-sjavac         use sjavac to do fast incremental compiles
                           [disabled]
   --disable-javac-server  disable javac server [enabled]
@@ -4391,6 +4397,12 @@
 #
 
 
+################################################################################
+#
+# Enable or disable generation of the classlist at build time
+#
+
+
 #
 # Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -5080,7 +5092,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1463732692
+DATE_WHEN_GENERATED=1464173584
 
 ###############################################################################
 #
@@ -64812,6 +64824,51 @@
 
 
 
+  # Check whether --enable-generate-classlist was given.
+if test "${enable_generate_classlist+set}" = set; then :
+  enableval=$enable_generate_classlist;
+fi
+
+
+  # Check if it's likely that it's possible to generate the classlist. Depending
+  # on exact jvm configuration it could be possible anyway.
+  if   [[ " $JVM_VARIANTS " =~ " server " ]]   ||   [[ " $JVM_VARIANTS " =~ " client " ]]  ; then
+    ENABLE_GENERATE_CLASSLIST_POSSIBLE="true"
+  else
+    ENABLE_GENERATE_CLASSLIST_POSSIBLE="false"
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the CDS classlist generation should be enabled" >&5
+$as_echo_n "checking if the CDS classlist generation should be enabled... " >&6; }
+  if test "x$enable_generate_classlist" = "xyes"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5
+$as_echo "yes, forced" >&6; }
+    ENABLE_GENERATE_CLASSLIST="true"
+    if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xfalse"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS" >&5
+$as_echo "$as_me: WARNING: Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS" >&2;}
+    fi
+  elif test "x$enable_generate_classlist" = "xno"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5
+$as_echo "no, forced" >&6; }
+    ENABLE_GENERATE_CLASSLIST="false"
+  elif test "x$enable_generate_classlist" = "x"; then
+    if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xtrue"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      ENABLE_GENERATE_CLASSLIST="true"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      ENABLE_GENERATE_CLASSLIST="false"
+    fi
+  else
+    as_fn_error $? "Invalid value for --enable-generate-classlist: $enable_generate_classlist" "$LINENO" 5
+  fi
+
+
+
+
 ###############################################################################
 #
 # Configure parts of the build that only affect the build performance,
--- a/common/autoconf/jdk-options.m4	Thu May 26 16:02:14 2016 +0000
+++ b/common/autoconf/jdk-options.m4	Thu May 26 17:17:51 2016 +0000
@@ -491,3 +491,46 @@
 
   AC_SUBST(BUILD_FAILURE_HANDLER)
 ])
+
+################################################################################
+#
+# Enable or disable generation of the classlist at build time
+#
+AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST],
+[
+  AC_ARG_ENABLE([generate-classlist], [AS_HELP_STRING([--disable-generate-classlist],
+      [forces enabling or disabling of the generation of a CDS classlist at build time.
+      Default is to generate it when either the server or client JVMs are built.])])
+
+  # Check if it's likely that it's possible to generate the classlist. Depending
+  # on exact jvm configuration it could be possible anyway.
+  if HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client); then
+    ENABLE_GENERATE_CLASSLIST_POSSIBLE="true"
+  else
+    ENABLE_GENERATE_CLASSLIST_POSSIBLE="false"
+  fi
+
+  AC_MSG_CHECKING([if the CDS classlist generation should be enabled])
+  if test "x$enable_generate_classlist" = "xyes"; then
+    AC_MSG_RESULT([yes, forced])
+    ENABLE_GENERATE_CLASSLIST="true"
+    if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xfalse"; then
+      AC_MSG_WARN([Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS])
+    fi
+  elif test "x$enable_generate_classlist" = "xno"; then
+    AC_MSG_RESULT([no, forced])
+    ENABLE_GENERATE_CLASSLIST="false"
+  elif test "x$enable_generate_classlist" = "x"; then
+    if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xtrue"; then
+      AC_MSG_RESULT([yes])
+      ENABLE_GENERATE_CLASSLIST="true"
+    else
+      AC_MSG_RESULT([no])
+      ENABLE_GENERATE_CLASSLIST="false"
+    fi
+  else
+    AC_MSG_ERROR([Invalid value for --enable-generate-classlist: $enable_generate_classlist])
+  fi
+
+  AC_SUBST([ENABLE_GENERATE_CLASSLIST])
+])
--- a/common/autoconf/spec.gmk.in	Thu May 26 16:02:14 2016 +0000
+++ b/common/autoconf/spec.gmk.in	Thu May 26 17:17:51 2016 +0000
@@ -285,6 +285,8 @@
 
 BUILD_FAILURE_HANDLER := @BUILD_FAILURE_HANDLER@
 
+ENABLE_GENERATE_CLASSLIST := @ENABLE_GENERATE_CLASSLIST@
+
 # The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
 # it in sync.
 BOOT_JDK:=@BOOT_JDK@
--- a/make/Images.gmk	Thu May 26 16:02:14 2016 +0000
+++ b/make/Images.gmk	Thu May 26 17:17:51 2016 +0000
@@ -115,9 +115,12 @@
 # Use this file inside the image as target for make rule
 JIMAGE_TARGET_FILE := bin/java$(EXE_SUFFIX)
 
-JLINK_ORDER_RESOURCES := \
-    *module-info.class* \
-    @$(SUPPORT_OUTPUTDIR)/classlist/classlist,/java.base/java/* \
+JLINK_ORDER_RESOURCES := *module-info.class*
+ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
+  JLINK_ORDER_RESOURCES += @$(SUPPORT_OUTPUTDIR)/classlist/classlist
+endif
+JLINK_ORDER_RESOURCES += \
+    /java.base/java/* \
     /java.base/jdk/* \
     /java.base/sun/* \
     /java.base/com/* \
@@ -125,9 +128,10 @@
     #
 
 JLINK_TOOL := $(JLINK) --modulepath $(IMAGES_OUTPUTDIR)/jmods \
-              --endian $(OPENJDK_BUILD_CPU_ENDIAN) \
-              --order-resources=$(call CommaList, $(JLINK_ORDER_RESOURCES)) \
-              --release-info $(BASE_RELEASE_FILE)
+    --endian $(OPENJDK_BUILD_CPU_ENDIAN) \
+    --release-info $(BASE_RELEASE_FILE) \
+    --order-resources=$(call CommaList, $(JLINK_ORDER_RESOURCES)) \
+    #
 
 ifeq ($(JLINK_KEEP_PACKAGED_MODULES), true)
   JLINK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods
@@ -369,19 +373,21 @@
 ################################################################################
 # classlist
 
-$(eval $(call SetupCopyFiles, JDK_COPY_CLASSLIST, \
-    FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \
-    DEST := $(JDK_IMAGE_DIR)/lib, \
-))
+ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
+  $(eval $(call SetupCopyFiles, JDK_COPY_CLASSLIST, \
+      FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \
+      DEST := $(JDK_IMAGE_DIR)/lib, \
+  ))
 
-JDK_TARGETS += $(JDK_COPY_CLASSLIST)
+  JDK_TARGETS += $(JDK_COPY_CLASSLIST)
 
-$(eval $(call SetupCopyFiles, JRE_COPY_CLASSLIST, \
-    FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \
-    DEST := $(JRE_IMAGE_DIR)/lib, \
-))
+  $(eval $(call SetupCopyFiles, JRE_COPY_CLASSLIST, \
+      FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \
+      DEST := $(JRE_IMAGE_DIR)/lib, \
+  ))
 
-JRE_TARGETS += $(JRE_COPY_CLASSLIST)
+  JRE_TARGETS += $(JRE_COPY_CLASSLIST)
+endif
 
 ################################################################################
 # /demo dir
--- a/make/Main.gmk	Thu May 26 16:02:14 2016 +0000
+++ b/make/Main.gmk	Thu May 26 17:17:51 2016 +0000
@@ -373,8 +373,10 @@
 interim-image:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f InterimImage.gmk)
 
-generate-classlist:
+ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
+  generate-classlist:
 	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GenerateClasslist.gmk)
+endif
 
 ALL_TARGETS += interim-image generate-classlist
 
@@ -640,18 +642,22 @@
 
   jrtfs-jar: interim-langtools
 
-  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
+  ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
+    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: generate-classlist
   endif
-  generate-classlist: buildtools-jdk
 
-  jimages: jmods zip-source source-tips demos samples jrtfs-jar generate-classlist
+  jimages: jmods zip-source source-tips demos samples jrtfs-jar
 
   profiles: jmods zip-source source-tips jrtfs-jar