8293532: Use lighter jmod compression levels in build config

Reviewed-by: ihse
This commit is contained in:
Aleksey Shipilev 2022-09-23 07:38:13 +00:00
parent eec992c6b0
commit 05c8cabdad
8 changed files with 39 additions and 0 deletions

View File

@ -160,6 +160,7 @@ jobs:
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
--with-sysroot=sysroot
--with-build-jdk=${{ steps.buildjdk.outputs.jdk-path }}
--with-jmod-compress=zip-1
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }}
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }}
${{ inputs.extra-conf-options }} || (

View File

@ -122,6 +122,7 @@ jobs:
--with-gtest=${{ steps.gtest.outputs.path }}
--enable-jtreg-failure-handler
--with-zlib=system
--with-jmod-compress=zip-1
${{ inputs.extra-conf-options }} || (
echo "Dumping config.log:" &&
cat config.log &&

View File

@ -97,6 +97,7 @@ jobs:
--with-gtest=${{ steps.gtest.outputs.path }}
--enable-jtreg-failure-handler
--with-zlib=system
--with-jmod-compress=zip-1
${{ inputs.extra-conf-options }} || (
echo "Dumping config.log:" &&
cat config.log &&

View File

@ -110,6 +110,7 @@ jobs:
--with-gtest=${{ steps.gtest.outputs.path }}
--enable-jtreg-failure-handler
--with-msvc-toolset-version=${{ inputs.msvc-toolset-version }}
--with-jmod-compress=zip-1
${{ inputs.extra-conf-options }} || (
echo "Dumping config.log:" &&
cat config.log &&

View File

@ -232,6 +232,14 @@ ifeq ($(findstring $(MODULE), java.base java.desktop jdk.localedata), )
JMOD_SMALL_FLAGS += $(JAVA_TOOL_FLAGS_SMALL)
endif
ifeq ($(INTERIM_JMOD), true)
# Interim JMODs are not shipped anywhere, so there is no reason
# to compress them at all.
JMOD_FLAGS += --compress zip-0
else
JMOD_FLAGS += --compress $(JMOD_COMPRESS)
endif
# Create jmods in the support dir and then move them into place to keep the
# module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
$(eval $(call SetupExecute, create_$(JMOD_FILE), \

View File

@ -133,6 +133,7 @@ BASIC_SETUP_DEFAULT_LOG
###############################################################################
# We need build & target for this.
JDKOPT_SETUP_JMOD_OPTIONS
JDKOPT_SETUP_JLINK_OPTIONS
JDKVER_SETUP_JDK_VERSION_NUMBERS

View File

@ -472,6 +472,31 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_BUILD],
AC_SUBST(STATIC_BUILD)
])
################################################################################
#
# jmod options.
#
AC_DEFUN_ONCE([JDKOPT_SETUP_JMOD_OPTIONS],
[
# Final JMODs are recompiled often during development, and java.base JMOD
# includes the JVM libraries. In release mode, prefer to compress JMODs fully.
# In debug mode, pay with a little extra space, but win a lot of CPU time back
# with the lightest (but still some) compression.
if test "x$DEBUG_LEVEL" = xrelease; then
DEFAULT_JMOD_COMPRESS="zip-6"
else
DEFAULT_JMOD_COMPRESS="zip-1"
fi
UTIL_ARG_WITH(NAME: jmod-compress, TYPE: literal,
VALID_VALUES: [zip-0 zip-1 zip-2 zip-3 zip-4 zip-5 zip-6 zip-7 zip-8 zip-9],
DEFAULT: $DEFAULT_JMOD_COMPRESS,
CHECKING_MSG: [for JMOD compression type],
DESC: [specify JMOD compression type (zip-[0-9])]
)
AC_SUBST(JMOD_COMPRESS)
])
################################################################################
#
# jlink options.

View File

@ -702,6 +702,7 @@ JAVADOC_MAIN_CLASS = -m jdk.javadoc.interim/jdk.javadoc.internal.tool.Main
NEW_JAVAC = $(INTERIM_LANGTOOLS_ARGS) $(JAVAC_MAIN_CLASS)
NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) $(JAVADOC_MAIN_CLASS)
JMOD_COMPRESS:=@JMOD_COMPRESS@
JLINK_KEEP_PACKAGED_MODULES:=@JLINK_KEEP_PACKAGED_MODULES@
RCFLAGS := @RCFLAGS@