Skip to content

Commit 645f3ca

Browse files
authored
Merge pull request SAP#2121 from SAP/pr-jdk-26+26
Merge to tag jdk-26+26
2 parents 09cddfd + 178cd63 commit 645f3ca

File tree

695 files changed

+37483
-14166
lines changed

Some content is hidden

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

695 files changed

+37483
-14166
lines changed

doc/testing.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,8 @@ <h4 id="repeat_count">REPEAT_COUNT</h4>
535535
<h4 id="report">REPORT</h4>
536536
<p>Use this report style when reporting test results (sent to JTReg as
537537
<code>-report</code>). Defaults to <code>files</code>.</p>
538+
<h4 id="manual">MANUAL</h4>
539+
<p>Set to <code>true</code> to execute manual tests only.</p>
538540
<h3 id="gtest-keywords">Gtest keywords</h3>
539541
<h4 id="repeat">REPEAT</h4>
540542
<p>The number of times to repeat the tests

doc/testing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,10 @@ helps to reproduce intermittent test failures. Defaults to 0.
512512
Use this report style when reporting test results (sent to JTReg as `-report`).
513513
Defaults to `files`.
514514

515+
#### MANUAL
516+
517+
Set to `true` to execute manual tests only.
518+
515519
### Gtest keywords
516520

517521
#### REPEAT

make/RunTests.gmk

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ $(eval $(call ParseKeywordVariable, JTREG, \
206206
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \
207207
TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY JVMTI_STRESS_AGENT \
208208
MAX_MEM RUN_PROBLEM_LISTS RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT \
209-
AOT_JDK $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
209+
AOT_JDK MANUAL $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
210210
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
211211
EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS \
212212
$(CUSTOM_JTREG_STRING_KEYWORDS), \
@@ -911,7 +911,13 @@ define SetupRunJtregTestBody
911911
-vmoption:-Dtest.boot.jdk="$$(BOOT_JDK)" \
912912
-vmoption:-Djava.io.tmpdir="$$($1_TEST_TMP_DIR)"
913913

914-
$1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet
914+
$1_JTREG_BASIC_OPTIONS += -ignore:quiet
915+
916+
ifeq ($$(JTREG_MANUAL), true)
917+
$1_JTREG_BASIC_OPTIONS += -manual
918+
else
919+
$1_JTREG_BASIC_OPTIONS += -automatic
920+
endif
915921

916922
# Make it possible to specify the JIB_DATA_DIR for tests using the
917923
# JIB Artifact resolver
@@ -1151,6 +1157,7 @@ define SetupRunJtregTestBody
11511157
$$(EXPR) $$($1_PASSED) + $$($1_FAILED) + $$($1_ERROR) + $$($1_SKIPPED))) \
11521158
, \
11531159
$$(eval $1_PASSED_AND_RUNTIME_SKIPPED := 0) \
1160+
$$(eval $1_PASSED := 0) \
11541161
$$(eval $1_RUNTIME_SKIPPED := 0) \
11551162
$$(eval $1_SKIPPED := 0) \
11561163
$$(eval $1_FAILED := 0) \

make/autoconf/flags-cflags.m4

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,17 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
282282
C_O_FLAG_DEBUG_JVM="-O0"
283283
C_O_FLAG_NONE="-O0"
284284
285+
if test "x$TOOLCHAIN_TYPE" = xgcc; then
286+
C_O_FLAG_LTO="-flto=auto -fuse-linker-plugin -fno-strict-aliasing -fno-fat-lto-objects"
287+
else
288+
C_O_FLAG_LTO="-flto -fno-strict-aliasing"
289+
fi
290+
285291
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
286292
C_O_FLAG_HIGHEST_JVM="${C_O_FLAG_HIGHEST_JVM} -finline-functions"
287293
C_O_FLAG_HIGHEST="${C_O_FLAG_HIGHEST} -finline-functions"
288294
C_O_FLAG_HI="${C_O_FLAG_HI} -finline-functions"
295+
C_O_FLAG_LTO="${C_O_FLAG_LTO} -ffat-lto-objects"
289296
fi
290297
291298
# -D_FORTIFY_SOURCE=2 hardening option needs optimization (at least -O1) enabled
@@ -317,6 +324,7 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
317324
C_O_FLAG_DEBUG_JVM=""
318325
C_O_FLAG_NONE="-Od"
319326
C_O_FLAG_SIZE="-O1"
327+
C_O_FLAG_LTO="-GL"
320328
fi
321329
322330
# Now copy to C++ flags
@@ -328,6 +336,7 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
328336
CXX_O_FLAG_DEBUG_JVM="$C_O_FLAG_DEBUG_JVM"
329337
CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
330338
CXX_O_FLAG_SIZE="$C_O_FLAG_SIZE"
339+
CXX_O_FLAG_LTO="$C_O_FLAG_LTO"
331340
332341
# Adjust optimization flags according to debug level.
333342
case $DEBUG_LEVEL in
@@ -360,12 +369,15 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
360369
AC_SUBST(C_O_FLAG_NORM)
361370
AC_SUBST(C_O_FLAG_NONE)
362371
AC_SUBST(C_O_FLAG_SIZE)
372+
AC_SUBST(C_O_FLAG_LTO)
373+
363374
AC_SUBST(CXX_O_FLAG_HIGHEST_JVM)
364375
AC_SUBST(CXX_O_FLAG_HIGHEST)
365376
AC_SUBST(CXX_O_FLAG_HI)
366377
AC_SUBST(CXX_O_FLAG_NORM)
367378
AC_SUBST(CXX_O_FLAG_NONE)
368379
AC_SUBST(CXX_O_FLAG_SIZE)
380+
AC_SUBST(CXX_O_FLAG_LTO)
369381
])
370382

371383
AC_DEFUN([FLAGS_SETUP_CFLAGS],

make/autoconf/flags-ldflags.m4

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
5050
# add -z,relro (mark relocations read only) for all libs
5151
# add -z,now ("full relro" - more of the Global Offset Table GOT is marked read only)
5252
# add --no-as-needed to disable default --as-needed link flag on some GCC toolchains
53+
# add --icf=all (Identical Code Folding — merges identical functions)
5354
BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now -Wl,--no-as-needed -Wl,--exclude-libs,ALL"
55+
if test "x$LINKER_TYPE" = "xgold"; then
56+
if test x$DEBUG_LEVEL = xrelease; then
57+
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,--icf=all"
58+
fi
59+
fi
60+
5461
# Linux : remove unused code+data in link step
5562
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
5663
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
@@ -61,13 +68,15 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
6168
fi
6269
6370
BASIC_LDFLAGS_JVM_ONLY=""
71+
LDFLAGS_LTO="-flto=auto -fuse-linker-plugin -fno-strict-aliasing"
6472
6573
LDFLAGS_CXX_PARTIAL_LINKING="$MACHINE_FLAG -r"
6674
6775
elif test "x$TOOLCHAIN_TYPE" = xclang; then
6876
BASIC_LDFLAGS_JVM_ONLY="-mno-omit-leaf-frame-pointer -mstack-alignment=16 \
6977
-fPIC"
7078
79+
LDFLAGS_LTO="-flto=auto -fuse-linker-plugin -fno-strict-aliasing"
7180
LDFLAGS_CXX_PARTIAL_LINKING="$MACHINE_FLAG -r"
7281
7382
if test "x$OPENJDK_TARGET_OS" = xlinux; then
@@ -87,6 +96,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
8796
BASIC_LDFLAGS="-opt:ref"
8897
BASIC_LDFLAGS_JDK_ONLY="-incremental:no"
8998
BASIC_LDFLAGS_JVM_ONLY="-opt:icf,8 -subsystem:windows"
99+
LDFLAGS_LTO="-LTCG:INCREMENTAL"
90100
fi
91101
92102
if (test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang) \
@@ -148,6 +158,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
148158
149159
# Export some intermediate variables for compatibility
150160
LDFLAGS_CXX_JDK="$DEBUGLEVEL_LDFLAGS_JDK_ONLY"
161+
AC_SUBST(LDFLAGS_LTO)
151162
AC_SUBST(LDFLAGS_CXX_JDK)
152163
AC_SUBST(LDFLAGS_CXX_PARTIAL_LINKING)
153164
])

make/autoconf/spec.gmk.template

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,12 +522,14 @@ C_O_FLAG_HI := @C_O_FLAG_HI@
522522
C_O_FLAG_NORM := @C_O_FLAG_NORM@
523523
C_O_FLAG_NONE := @C_O_FLAG_NONE@
524524
C_O_FLAG_SIZE := @C_O_FLAG_SIZE@
525+
C_O_FLAG_LTO := @C_O_FLAG_LTO@
525526
CXX_O_FLAG_HIGHEST_JVM := @CXX_O_FLAG_HIGHEST_JVM@
526527
CXX_O_FLAG_HIGHEST := @CXX_O_FLAG_HIGHEST@
527528
CXX_O_FLAG_HI := @CXX_O_FLAG_HI@
528529
CXX_O_FLAG_NORM := @CXX_O_FLAG_NORM@
529530
CXX_O_FLAG_NONE := @CXX_O_FLAG_NONE@
530531
CXX_O_FLAG_SIZE := @CXX_O_FLAG_SIZE@
532+
CXX_O_FLAG_LTO := @CXX_O_FLAG_LTO@
531533

532534
GENDEPS_FLAGS := @GENDEPS_FLAGS@
533535

@@ -596,6 +598,9 @@ LDFLAGS_CXX_JDK := @LDFLAGS_CXX_JDK@
596598
# LDFLAGS specific to partial linking.
597599
LDFLAGS_CXX_PARTIAL_LINKING := @LDFLAGS_CXX_PARTIAL_LINKING@
598600

601+
# LDFLAGS specific to link time optimization
602+
LDFLAGS_LTO := @LDFLAGS_LTO@
603+
599604
# Sometimes a different linker is needed for c++ libs
600605
LDCXX := @LDCXX@
601606
# The flags for linking libstdc++ linker.

make/autoconf/toolchain.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_LD_VERSION],
516516
if [ [[ "$LINKER_VERSION_STRING" == *gold* ]] ]; then
517517
[ LINKER_VERSION_NUMBER=`$ECHO $LINKER_VERSION_STRING | \
518518
$SED -e 's/.* \([0-9][0-9]*\(\.[0-9][0-9]*\)*\).*) .*/\1/'` ]
519+
LINKER_TYPE=gold
519520
else
520521
[ LINKER_VERSION_NUMBER=`$ECHO $LINKER_VERSION_STRING | \
521522
$SED -e 's/.* \([0-9][0-9]*\(\.[0-9][0-9]*\)*\).*/\1/'` ]

make/common/NativeCompilation.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ include native/Paths.gmk
9898
# SYSROOT_CFLAGS the compiler flags for using the specific sysroot
9999
# SYSROOT_LDFLAGS the linker flags for using the specific sysroot
100100
# OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST, HIGHEST_JVM, SIZE
101+
# LINK_TIME_OPTIMIZATION if set to true, enables link time optimization
101102
# DISABLED_WARNINGS_<toolchain> Disable the given warnings for the specified toolchain
102103
# DISABLED_WARNINGS_<toolchain>_<OS> Disable the given warnings for the specified
103104
# toolchain and target OS

make/common/native/Flags.gmk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ define SetupCompilerFlags
194194
$1_EXTRA_CXXFLAGS += $(CFLAGS_WARNINGS_ARE_ERRORS)
195195
endif
196196

197+
ifeq (true, $$($1_LINK_TIME_OPTIMIZATION))
198+
$1_EXTRA_CFLAGS += $(C_O_FLAG_LTO)
199+
$1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_LTO)
200+
endif
201+
197202
ifeq (NONE, $$($1_OPTIMIZATION))
198203
$1_OPT_CFLAGS := $(C_O_FLAG_NONE)
199204
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_NONE)
@@ -222,6 +227,10 @@ define SetupLinkerFlags
222227
# Pickup extra OPENJDK_TARGET_OS_TYPE, OPENJDK_TARGET_OS and TOOLCHAIN_TYPE
223228
# dependent variables for LDFLAGS and LIBS, and additionally the pair dependent
224229
# TOOLCHAIN_TYPE plus OPENJDK_TARGET_OS
230+
ifeq ($$($1_LINK_TIME_OPTIMIZATION), true)
231+
$1_EXTRA_LDFLAGS += $(LDFLAGS_LTO)
232+
endif
233+
225234
$1_EXTRA_LDFLAGS += $$($1_LDFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS)) \
226235
$$($1_LDFLAGS_$(TOOLCHAIN_TYPE)) $$($1_LDFLAGS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS))
227236
$1_EXTRA_LIBS += $$($1_LIBS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LIBS_$(OPENJDK_TARGET_OS)) \

make/hotspot/lib/CompileJvm.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
234234
LDFLAGS := $(JVM_LDFLAGS), \
235235
LIBS := $(JVM_LIBS), \
236236
OPTIMIZATION := $(JVM_OPTIMIZATION), \
237+
LINK_TIME_OPTIMIZATION := $(JVM_LTO), \
237238
OBJECT_DIR := $(JVM_OUTPUTDIR)/objs, \
238239
STRIPFLAGS := $(JVM_STRIPFLAGS), \
239240
EMBED_MANIFEST := true, \

0 commit comments

Comments
 (0)