Skip to content

Commit 2ec3580

Browse files
jerboaaMandy Chung
and
Mandy Chung
committed
8311302: Implement JEP 493: Linking Run-Time Images without JMODs
Co-authored-by: Mandy Chung <mchung@openjdk.org> Reviewed-by: mchung, alanb, erikj, ihse
1 parent f3ba767 commit 2ec3580

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4169
-250
lines changed

make/Images.gmk

+4
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ JLINK_DISABLE_WARNINGS := | ( $(GREP) -v -e "WARNING: Using incubator module" ||
9696
JDK_IMAGE_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk
9797
JRE_IMAGE_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre
9898

99+
ifeq ($(JLINK_PRODUCE_LINKABLE_RUNTIME), true)
100+
JLINK_JDK_EXTRA_OPTS += --generate-linkable-runtime
101+
endif
102+
99103
$(eval $(call SetupExecute, jlink_jdk, \
100104
WARN := Creating jdk image, \
101105
DEPS := $(JDK_JMODS) $(BASE_RELEASE_FILE) \

make/autoconf/jdk-options.m4

+31-2
Original file line numberDiff line numberDiff line change
@@ -586,13 +586,42 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JMOD_OPTIONS],
586586
################################################################################
587587
#
588588
# jlink options.
589-
# We always keep packaged modules in JDK image.
590589
#
591590
AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS],
592591
[
593-
UTIL_ARG_ENABLE(NAME: keep-packaged-modules, DEFAULT: true,
592+
593+
################################################################################
594+
#
595+
# Configure option for building a JDK that is suitable for linking from the
596+
# run-time image without JMODs.
597+
#
598+
# Determines whether or not a suitable run-time image is being produced from
599+
# packaged modules. If set to 'true, changes the *default* of packaged
600+
# modules to 'false'.
601+
#
602+
UTIL_ARG_ENABLE(NAME: linkable-runtime, DEFAULT: false,
603+
RESULT: JLINK_PRODUCE_LINKABLE_RUNTIME,
604+
DESC: [enable a JDK build suitable for linking from the run-time image],
605+
CHECKING_MSG: [whether or not a JDK suitable for linking from the run-time image should be produced])
606+
AC_SUBST(JLINK_PRODUCE_LINKABLE_RUNTIME)
607+
608+
if test "x$JLINK_PRODUCE_LINKABLE_RUNTIME" = xtrue; then
609+
DEFAULT_PACKAGED_MODULES=false
610+
else
611+
DEFAULT_PACKAGED_MODULES=true
612+
fi
613+
614+
################################################################################
615+
#
616+
# Configure option for packaged modules
617+
#
618+
# We keep packaged modules in the JDK image unless --enable-linkable-runtime is
619+
# requested.
620+
#
621+
UTIL_ARG_ENABLE(NAME: keep-packaged-modules, DEFAULT: $DEFAULT_PACKAGED_MODULES,
594622
RESULT: JLINK_KEEP_PACKAGED_MODULES,
595623
DESC: [enable keeping of packaged modules in jdk image],
624+
DEFAULT_DESC: [enabled by default unless --enable-linkable-runtime is set],
596625
CHECKING_MSG: [if packaged modules are kept])
597626
AC_SUBST(JLINK_KEEP_PACKAGED_MODULES)
598627
])

make/autoconf/spec.gmk.template

+1
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) $(JAVADOC_MAIN_CLASS)
706706

707707
JMOD_COMPRESS := @JMOD_COMPRESS@
708708
JLINK_KEEP_PACKAGED_MODULES := @JLINK_KEEP_PACKAGED_MODULES@
709+
JLINK_PRODUCE_LINKABLE_RUNTIME := @JLINK_PRODUCE_LINKABLE_RUNTIME@
709710

710711
RCFLAGS := @RCFLAGS@
711712

src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java

+342-34
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)