Skip to content

Commit

Permalink
8293532: Use lighter jmod compression levels in build config
Browse files Browse the repository at this point in the history
Reviewed-by: ihse
  • Loading branch information
shipilev committed Sep 23, 2022
1 parent eec992c commit 05c8cab
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-cross-compile.yml
Expand Up @@ -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 }} || (
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-linux.yml
Expand Up @@ -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 &&
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-macos.yml
Expand Up @@ -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 &&
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-windows.yml
Expand Up @@ -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 &&
Expand Down
8 changes: 8 additions & 0 deletions make/CreateJmods.gmk
Expand Up @@ -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), \
Expand Down
1 change: 1 addition & 0 deletions make/autoconf/configure.ac
Expand Up @@ -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

Expand Down
25 changes: 25 additions & 0 deletions make/autoconf/jdk-options.m4
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions make/autoconf/spec.gmk.in
Expand Up @@ -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@
Expand Down

1 comment on commit 05c8cab

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.