8157336: Generation of classlists at build time should be configurable

Reviewed-by: tbell, dholmes
This commit is contained in:
Erik Joelsson 2016-05-25 12:53:26 +02:00
parent fea34ed634
commit 825cbcc1b9
6 changed files with 144 additions and 29 deletions

View File

@ -229,6 +229,7 @@ LIB_SETUP_LIBRARIES
JDKOPT_DETECT_INTREE_EC JDKOPT_DETECT_INTREE_EC
JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST
############################################################################### ###############################################################################
# #

View File

@ -650,6 +650,7 @@ TEST_JOBS
JOBS JOBS
MEMORY_SIZE MEMORY_SIZE
NUM_CORES NUM_CORES
ENABLE_GENERATE_CLASSLIST
BUILD_FAILURE_HANDLER BUILD_FAILURE_HANDLER
ENABLE_INTREE_EC ENABLE_INTREE_EC
STLPORT_LIB STLPORT_LIB
@ -1226,6 +1227,7 @@ with_dxsdk
with_dxsdk_lib with_dxsdk_lib
with_dxsdk_include with_dxsdk_include
enable_jtreg_failure_handler enable_jtreg_failure_handler
enable_generate_classlist
with_num_cores with_num_cores
with_memory_size with_memory_size
with_jobs with_jobs
@ -2005,6 +2007,10 @@ Optional Features:
Default is auto, where the failure handler is built Default is auto, where the failure handler is built
if all dependencies are present and otherwise just if all dependencies are present and otherwise just
disabled. 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 --enable-sjavac use sjavac to do fast incremental compiles
[disabled] [disabled]
--disable-javac-server disable javac server [enabled] --disable-javac-server disable javac server [enabled]
@ -4391,6 +4397,12 @@ VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom"
# #
################################################################################
#
# Enable or disable generation of the classlist at build time
#
# #
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@ -5080,7 +5092,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE #CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks: # 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 @@ $as_echo "yes, jtreg present" >&6; }
# 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, # Configure parts of the build that only affect the build performance,

View File

@ -491,3 +491,46 @@ AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
AC_SUBST(BUILD_FAILURE_HANDLER) 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])
])

View File

@ -285,6 +285,8 @@ BUILD_HOTSPOT=@BUILD_HOTSPOT@
BUILD_FAILURE_HANDLER := @BUILD_FAILURE_HANDLER@ 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 # The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
# it in sync. # it in sync.
BOOT_JDK:=@BOOT_JDK@ BOOT_JDK:=@BOOT_JDK@

View File

@ -115,9 +115,12 @@ JMODS := $(wildcard $(IMAGES_OUTPUTDIR)/jmods/*.jmod)
# Use this file inside the image as target for make rule # Use this file inside the image as target for make rule
JIMAGE_TARGET_FILE := bin/java$(EXE_SUFFIX) JIMAGE_TARGET_FILE := bin/java$(EXE_SUFFIX)
JLINK_ORDER_RESOURCES := \ JLINK_ORDER_RESOURCES := *module-info.class*
*module-info.class* \ ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
@$(SUPPORT_OUTPUTDIR)/classlist/classlist,/java.base/java/* \ JLINK_ORDER_RESOURCES += @$(SUPPORT_OUTPUTDIR)/classlist/classlist
endif
JLINK_ORDER_RESOURCES += \
/java.base/java/* \
/java.base/jdk/* \ /java.base/jdk/* \
/java.base/sun/* \ /java.base/sun/* \
/java.base/com/* \ /java.base/com/* \
@ -125,9 +128,10 @@ JLINK_ORDER_RESOURCES := \
# #
JLINK_TOOL := $(JLINK) --modulepath $(IMAGES_OUTPUTDIR)/jmods \ JLINK_TOOL := $(JLINK) --modulepath $(IMAGES_OUTPUTDIR)/jmods \
--endian $(OPENJDK_BUILD_CPU_ENDIAN) \ --endian $(OPENJDK_BUILD_CPU_ENDIAN) \
--order-resources=$(call CommaList, $(JLINK_ORDER_RESOURCES)) \ --release-info $(BASE_RELEASE_FILE) \
--release-info $(BASE_RELEASE_FILE) --order-resources=$(call CommaList, $(JLINK_ORDER_RESOURCES)) \
#
ifeq ($(JLINK_KEEP_PACKAGED_MODULES), true) ifeq ($(JLINK_KEEP_PACKAGED_MODULES), true)
JLINK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods JLINK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods
@ -369,19 +373,21 @@ JDK_TARGETS += $(JDK_IMAGE_DIR)/src.zip
################################################################################ ################################################################################
# classlist # classlist
$(eval $(call SetupCopyFiles, JDK_COPY_CLASSLIST, \ ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \ $(eval $(call SetupCopyFiles, JDK_COPY_CLASSLIST, \
DEST := $(JDK_IMAGE_DIR)/lib, \ 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, \ $(eval $(call SetupCopyFiles, JRE_COPY_CLASSLIST, \
FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \ FILES := $(SUPPORT_OUTPUTDIR)/classlist/classlist, \
DEST := $(JRE_IMAGE_DIR)/lib, \ DEST := $(JRE_IMAGE_DIR)/lib, \
)) ))
JRE_TARGETS += $(JRE_COPY_CLASSLIST) JRE_TARGETS += $(JRE_COPY_CLASSLIST)
endif
################################################################################ ################################################################################
# /demo dir # /demo dir

View File

@ -373,8 +373,10 @@ ALL_TARGETS += create-buildjdk-copy create-buildjdk-interim-image
interim-image: interim-image:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f InterimImage.gmk) +($(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) +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GenerateClasslist.gmk)
endif
ALL_TARGETS += interim-image generate-classlist ALL_TARGETS += interim-image generate-classlist
@ -640,18 +642,22 @@ else
jrtfs-jar: interim-langtools jrtfs-jar: interim-langtools
ifeq ($(CREATE_BUILDJDK), true) ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
# If creating a buildjdk, the interim image needs to be based on that. ifeq ($(CREATE_BUILDJDK), true)
generate-classlist: create-buildjdk # If creating a buildjdk, the interim image needs to be based on that.
else ifeq ($(EXTERNAL_BUILDJDK), false) generate-classlist: create-buildjdk
# If an external buildjdk has been provided, we skip generating an else ifeq ($(EXTERNAL_BUILDJDK), false)
# interim-image and just use the external buildjdk for generating # If an external buildjdk has been provided, we skip generating an
# classlist. # interim-image and just use the external buildjdk for generating
generate-classlist: interim-image # classlist.
endif generate-classlist: interim-image
generate-classlist: buildtools-jdk endif
generate-classlist: buildtools-jdk
jimages: jmods zip-source source-tips demos samples jrtfs-jar generate-classlist jimages: generate-classlist
endif
jimages: jmods zip-source source-tips demos samples jrtfs-jar
profiles: jmods zip-source source-tips jrtfs-jar profiles: jmods zip-source source-tips jrtfs-jar