Skip to content

Commit 05c8cab

Browse files
committed
8293532: Use lighter jmod compression levels in build config
Reviewed-by: ihse
1 parent eec992c commit 05c8cab

8 files changed

+39
-0
lines changed

.github/workflows/build-cross-compile.yml

+1
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ jobs:
160160
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
161161
--with-sysroot=sysroot
162162
--with-build-jdk=${{ steps.buildjdk.outputs.jdk-path }}
163+
--with-jmod-compress=zip-1
163164
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }}
164165
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }}
165166
${{ inputs.extra-conf-options }} || (

.github/workflows/build-linux.yml

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ jobs:
122122
--with-gtest=${{ steps.gtest.outputs.path }}
123123
--enable-jtreg-failure-handler
124124
--with-zlib=system
125+
--with-jmod-compress=zip-1
125126
${{ inputs.extra-conf-options }} || (
126127
echo "Dumping config.log:" &&
127128
cat config.log &&

.github/workflows/build-macos.yml

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797
--with-gtest=${{ steps.gtest.outputs.path }}
9898
--enable-jtreg-failure-handler
9999
--with-zlib=system
100+
--with-jmod-compress=zip-1
100101
${{ inputs.extra-conf-options }} || (
101102
echo "Dumping config.log:" &&
102103
cat config.log &&

.github/workflows/build-windows.yml

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ jobs:
110110
--with-gtest=${{ steps.gtest.outputs.path }}
111111
--enable-jtreg-failure-handler
112112
--with-msvc-toolset-version=${{ inputs.msvc-toolset-version }}
113+
--with-jmod-compress=zip-1
113114
${{ inputs.extra-conf-options }} || (
114115
echo "Dumping config.log:" &&
115116
cat config.log &&

make/CreateJmods.gmk

+8
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,14 @@ ifeq ($(findstring $(MODULE), java.base java.desktop jdk.localedata), )
232232
JMOD_SMALL_FLAGS += $(JAVA_TOOL_FLAGS_SMALL)
233233
endif
234234

235+
ifeq ($(INTERIM_JMOD), true)
236+
# Interim JMODs are not shipped anywhere, so there is no reason
237+
# to compress them at all.
238+
JMOD_FLAGS += --compress zip-0
239+
else
240+
JMOD_FLAGS += --compress $(JMOD_COMPRESS)
241+
endif
242+
235243
# Create jmods in the support dir and then move them into place to keep the
236244
# module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
237245
$(eval $(call SetupExecute, create_$(JMOD_FILE), \

make/autoconf/configure.ac

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ BASIC_SETUP_DEFAULT_LOG
133133
###############################################################################
134134

135135
# We need build & target for this.
136+
JDKOPT_SETUP_JMOD_OPTIONS
136137
JDKOPT_SETUP_JLINK_OPTIONS
137138
JDKVER_SETUP_JDK_VERSION_NUMBERS
138139

make/autoconf/jdk-options.m4

+25
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,31 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_BUILD],
472472
AC_SUBST(STATIC_BUILD)
473473
])
474474

475+
################################################################################
476+
#
477+
# jmod options.
478+
#
479+
AC_DEFUN_ONCE([JDKOPT_SETUP_JMOD_OPTIONS],
480+
[
481+
# Final JMODs are recompiled often during development, and java.base JMOD
482+
# includes the JVM libraries. In release mode, prefer to compress JMODs fully.
483+
# In debug mode, pay with a little extra space, but win a lot of CPU time back
484+
# with the lightest (but still some) compression.
485+
if test "x$DEBUG_LEVEL" = xrelease; then
486+
DEFAULT_JMOD_COMPRESS="zip-6"
487+
else
488+
DEFAULT_JMOD_COMPRESS="zip-1"
489+
fi
490+
491+
UTIL_ARG_WITH(NAME: jmod-compress, TYPE: literal,
492+
VALID_VALUES: [zip-0 zip-1 zip-2 zip-3 zip-4 zip-5 zip-6 zip-7 zip-8 zip-9],
493+
DEFAULT: $DEFAULT_JMOD_COMPRESS,
494+
CHECKING_MSG: [for JMOD compression type],
495+
DESC: [specify JMOD compression type (zip-[0-9])]
496+
)
497+
AC_SUBST(JMOD_COMPRESS)
498+
])
499+
475500
################################################################################
476501
#
477502
# jlink options.

make/autoconf/spec.gmk.in

+1
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ JAVADOC_MAIN_CLASS = -m jdk.javadoc.interim/jdk.javadoc.internal.tool.Main
702702
NEW_JAVAC = $(INTERIM_LANGTOOLS_ARGS) $(JAVAC_MAIN_CLASS)
703703
NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) $(JAVADOC_MAIN_CLASS)
704704

705+
JMOD_COMPRESS:=@JMOD_COMPRESS@
705706
JLINK_KEEP_PACKAGED_MODULES:=@JLINK_KEEP_PACKAGED_MODULES@
706707

707708
RCFLAGS := @RCFLAGS@

0 commit comments

Comments
 (0)