Skip to content

Commit ea7fd09

Browse files
Merge branch 'master' into JDK-8333664
2 parents eb981cc + 16033ea commit ea7fd09

File tree

279 files changed

+4378
-3186
lines changed

Some content is hidden

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

279 files changed

+4378
-3186
lines changed

make/Docs.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ ifeq ($(ENABLE_PANDOC), true)
673673

674674
$(foreach m, $(ALL_MODULES), \
675675
$(eval MAN_$m := $(call ApplySpecFilter, $(filter %.md, $(call FindFiles, \
676-
$(call FindModuleManDirs, $m))))) \
676+
$(call FindModuleManDirsForDocs, $m))))) \
677677
$(if $(MAN_$m), \
678678
$(eval $(call SetupProcessMarkdown, MAN_TO_HTML_$m, \
679679
FILES := $(MAN_$m), \

make/Main.gmk

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,17 @@ $(eval $(call SetupTarget, test-image-lib, \
753753
DEPS := build-test-lib, \
754754
))
755755

756+
$(eval $(call SetupTarget, build-test-setup-aot, \
757+
MAKEFILE := test/BuildTestSetupAOT, \
758+
DEPS := interim-langtools exploded-image, \
759+
))
760+
761+
$(eval $(call SetupTarget, test-image-setup-aot, \
762+
MAKEFILE := test/BuildTestSetupAOT, \
763+
TARGET := images, \
764+
DEPS := build-test-setup-aot, \
765+
))
766+
756767
ifeq ($(BUILD_FAILURE_HANDLER), true)
757768
# Builds the failure handler jtreg extension
758769
$(eval $(call SetupTarget, build-test-failure-handler, \
@@ -1281,7 +1292,8 @@ all-docs-bundles: docs-jdk-bundles docs-javase-bundles docs-reference-bundles
12811292
# This target builds the test image
12821293
test-image: prepare-test-image test-image-jdk-jtreg-native \
12831294
test-image-demos-jdk test-image-libtest-jtreg-native \
1284-
test-image-lib test-image-lib-native
1295+
test-image-lib test-image-lib-native \
1296+
test-image-setup-aot
12851297

12861298
ifneq ($(JVM_TEST_IMAGE_TARGETS), )
12871299
# If JVM_TEST_IMAGE_TARGETS is externally defined, use it instead of the

make/RunTests.gmk

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,9 @@ define SetJtregValue
703703
endif
704704
endef
705705

706+
################################################################################
707+
# Helper function for creating a customized AOT cache for running tests
708+
################################################################################
706709

707710
# Parameter 1 is the name of the rule.
708711
#
@@ -713,48 +716,47 @@ endef
713716
# $1_AOT_TARGETS List of all targets that the test rule will need to depend on
714717
# $1_AOT_JDK_CACHE The AOT cache file to be used to run the test with
715718
#
716-
SetupAot = $(NamedParamsMacroTemplate)
717-
define SetupAotBody
718-
$1_AOT_JDK_CONF := $$($1_TEST_SUPPORT_DIR)/aot/jdk.aotconf
719+
SetupAOT = $(NamedParamsMacroTemplate)
720+
define SetupAOTBody
721+
$1_AOT_JDK_CONF := $$($1_TEST_SUPPORT_DIR)/aot/jdk.aotconf
719722
$1_AOT_JDK_CACHE := $$($1_TEST_SUPPORT_DIR)/aot/jdk.aotcache
720-
721-
$1_JAVA_TOOL_OPTS := $$(addprefix -J, $$($1_VM_OPTIONS))
723+
$1_AOT_JDK_LOG := $$($1_TEST_SUPPORT_DIR)/aot/TestSetupAOT.log
724+
725+
# We execute the training run with $(TEST_IMAGE_DIR)/setup_aot/TestSetupAOT.class
726+
# to touch a fair number of classes inside the JDK. Note that we can't specify a classpath,
727+
# or else the AOT cache cannot be used with jtreg test cases that use a different value
728+
# for their classpaths. Instead, we run in the $(TEST_IMAGE_DIR)/setup_aot/ directory.
729+
# The "java" launcher will have an implicit classpath of ".", so it can pick up the TestSetupAOT
730+
# class from the JVM's current directory.
731+
#
732+
# The TestSetupAOT class (or any other classes that are loaded from ".") will be excluded
733+
# from the the AOT cache as "." is an unsupported location. As a result, the AOT cache will contain
734+
# only classes from the JDK.
722735

723736
$$($1_AOT_JDK_CACHE): $$(JDK_IMAGE_DIR)/release
724737
$$(call MakeDir, $$($1_TEST_SUPPORT_DIR)/aot)
725738

726-
$(foreach jtool, javac javap jlink jar, \
727-
$(info AOT: Create cache configuration for $(jtool)) \
728-
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/aot.$(jtool), ( \
729-
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/$(jtool) $$($1_JAVA_TOOL_OPTS) \
730-
-J-XX:AOTMode=record -J-XX:AOTConfiguration=$$($1_AOT_JDK_CONF).$(jtool) --help \
731-
))
732-
)
733-
734-
$$(info AOT: Copy $(JDK_UNDER_TEST)/lib/classlist to $$($1_AOT_JDK_CONF).jdk )
739+
$$(call LogWarn, AOT: Create cache configuration) \
735740
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/aot, ( \
736-
$$(FIXPATH) $(CP) $(JDK_UNDER_TEST)/lib/classlist $$($1_AOT_JDK_CONF).jdk \
741+
$(CD) $(TEST_IMAGE_DIR)/setup_aot; \
742+
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java $$($1_VM_OPTIONS) \
743+
-Xlog:cds,cds+class=debug:file=$$($1_AOT_JDK_CONF).log -Xlog:cds*=error \
744+
-XX:AOTMode=record -XX:AOTConfiguration=$$($1_AOT_JDK_CONF) \
745+
TestSetupAOT > $$($1_AOT_JDK_LOG) \
737746
))
738747

739-
$$(FIXPATH) $$(CAT) $$($1_AOT_JDK_CONF).* > $$($1_AOT_JDK_CONF).temp
740-
$$(FIXPATH) $$(CAT) $$($1_AOT_JDK_CONF).temp | $(GREP) -v '#' | $(GREP) -v '@' | $(SORT) | \
741-
$(SED) -e 's/id:.*//g' | uniq \
742-
> $$($1_AOT_JDK_CONF)
743-
$$(FIXPATH) $$(CAT) $$($1_AOT_JDK_CONF).temp | $(GREP) '@cp' | $(SORT) \
744-
>> $$($1_AOT_JDK_CONF)
745-
746-
$$(info AOT: Generate AOT cache $$($1_AOT_JDK_CACHE) with flags: $$($1_VM_OPTIONS))
748+
$$(call LogWarn, AOT: Generate AOT cache $$($1_AOT_JDK_CACHE) with flags: $$($1_VM_OPTIONS))
747749
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/aot, ( \
748-
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java \
749-
$$($1_VM_OPTIONS) -Xlog:cds,cds+class=debug:file=$$($1_AOT_JDK_CACHE).log \
750-
-XX:AOTMode=create -XX:AOTConfiguration=$$($1_AOT_JDK_CONF) -XX:AOTCache=$$($1_AOT_JDK_CACHE) \
750+
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java \
751+
$$($1_VM_OPTIONS) -Xlog:cds,cds+class=debug:file=$$($1_AOT_JDK_CACHE).log -Xlog:cds*=error \
752+
-XX:ExtraSharedClassListFile=$(JDK_UNDER_TEST)/lib/classlist \
753+
-XX:AOTMode=create -XX:AOTConfiguration=$$($1_AOT_JDK_CONF) -XX:AOTCache=$$($1_AOT_JDK_CACHE) \
751754
))
752755

753756
$1_AOT_TARGETS += $$($1_AOT_JDK_CACHE)
754757

755758
endef
756759

757-
758760
SetupRunJtregTest = $(NamedParamsMacroTemplate)
759761
define SetupRunJtregTestBody
760762
$1_TEST_RESULTS_DIR := $$(TEST_RESULTS_DIR)/$1
@@ -946,11 +948,10 @@ define SetupRunJtregTestBody
946948
endif
947949

948950
ifeq ($$(JTREG_AOT_JDK), true)
949-
$$(info Add AOT target for $1)
950-
$$(eval $$(call SetupAot, $1, VM_OPTIONS := $$(JTREG_ALL_OPTIONS) ))
951+
$$(call LogWarn, Add AOT target for $1)
952+
$$(eval $$(call SetupAOT, $1, VM_OPTIONS := $$(JTREG_ALL_OPTIONS) ))
951953

952-
$$(info AOT_TARGETS=$$($1_AOT_TARGETS))
953-
$$(info AOT_JDK_CACHE=$$($1_AOT_JDK_CACHE))
954+
$$(call LogWarn, AOT_JDK_CACHE=$$($1_AOT_JDK_CACHE))
954955

955956
$1_JTREG_BASIC_OPTIONS += -vmoption:-XX:AOTCache="$$($1_AOT_JDK_CACHE)"
956957
endif

make/autoconf/flags-cflags.m4

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,11 +715,13 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
715715
if test "x$FLAGS_CPU" = xppc64; then
716716
# -mminimal-toc fixes `relocation truncated to fit' error for gcc 4.1.
717717
# Use ppc64 instructions, but schedule for power5
718-
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -mminimal-toc -mcpu=powerpc64 -mtune=power5"
718+
$1_CFLAGS_CPU="-mcpu=powerpc64 -mtune=power5"
719+
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -mminimal-toc"
719720
elif test "x$FLAGS_CPU" = xppc64le; then
720721
# Little endian machine uses ELFv2 ABI.
721722
# Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
722-
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8"
723+
$1_CFLAGS_CPU="-mcpu=power8 -mtune=power10"
724+
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2"
723725
fi
724726
elif test "x$FLAGS_CPU" = xs390x; then
725727
$1_CFLAGS_CPU="-mbackchain -march=z10"
@@ -740,7 +742,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
740742
if test "x$FLAGS_CPU" = xppc64le; then
741743
# Little endian machine uses ELFv2 ABI.
742744
# Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
743-
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8"
745+
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power10"
744746
fi
745747
fi
746748
if test "x$OPENJDK_TARGET_OS" = xaix; then

make/autoconf/jdk-options.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,10 +516,11 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER],
516516
OPTIONAL: true)
517517
518518
# GCC reports lots of likely false positives for stringop-truncation and format-overflow.
519+
# GCC 13 also for array-bounds and stringop-overflow
519520
# Silence them for now.
520521
UBSAN_CHECKS="-fsanitize=undefined -fsanitize=float-divide-by-zero -fno-sanitize=shift-base -fno-sanitize=alignment \
521522
$ADDITIONAL_UBSAN_CHECKS"
522-
UBSAN_CFLAGS="$UBSAN_CHECKS -Wno-stringop-truncation -Wno-format-overflow -fno-omit-frame-pointer -DUNDEFINED_BEHAVIOR_SANITIZER"
523+
UBSAN_CFLAGS="$UBSAN_CHECKS -Wno-stringop-truncation -Wno-format-overflow -Wno-array-bounds -Wno-stringop-overflow -fno-omit-frame-pointer -DUNDEFINED_BEHAVIOR_SANITIZER"
523524
UBSAN_LDFLAGS="$UBSAN_CHECKS"
524525
UTIL_ARG_ENABLE(NAME: ubsan, DEFAULT: false, RESULT: UBSAN_ENABLED,
525526
DESC: [enable UndefinedBehaviorSanitizer],

make/autoconf/lib-tests.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
2828
################################################################################
2929

3030
# Minimum supported versions
31-
JTREG_MINIMUM_VERSION=7.4
31+
JTREG_MINIMUM_VERSION=7.5.1
3232
GTEST_MINIMUM_VERSION=1.14.0
3333

3434
################################################################################

make/common/MakeIncludeEnd.gmk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ ifneq ($(NO_CUSTOM_EXTENSIONS), true)
3434
endif
3535

3636
# Pop our helper name off the stack
37-
HELPER_STACK := $(wordlist 2, $(words $(HELPER_STACK)), $(HELPER_STACK))
37+
INCLUDE_STACK := $(wordlist 2, $(words $(INCLUDE_STACK)), $(INCLUDE_STACK))
3838

3939
# Print an indented message, also counting the top-level makefile as a level
4040
ifeq ($(LOG_FLOW), true)
41-
$(info :$(foreach s, top $(HELPER_STACK), )Leave $(THIS_INCLUDE))
41+
$(info :$(foreach s, top $(INCLUDE_STACK) $(SNIPPET_STACK), )Leave $(THIS_INCLUDE))
4242
endif
4343

4444
# Restore the previous helper name
45-
THIS_INCLUDE := $(firstword $(HELPER_STACK))
45+
THIS_INCLUDE := $(firstword $(INCLUDE_STACK))

make/common/MakeIncludeStart.gmk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ else
3939
endif
4040

4141
ifeq ($(LOG_FLOW), true)
42-
$(info :$(foreach s, top $(HELPER_STACK), )Enter $(THIS_INCLUDE) [$(THIS_INCLUDE_MSG)])
42+
$(info :$(foreach s, top $(INCLUDE_STACK) $(SNIPPET_STACK), )Enter $(THIS_INCLUDE) [$(THIS_INCLUDE_MSG)])
4343
endif
4444

45-
ifneq ($(filter $(THIS_INCLUDE), $(HELPER_STACK)), )
46-
$(error Internal makefile error: Include loop detected: $(THIS_INCLUDE) $(HELPER_STACK))
45+
ifneq ($(filter $(THIS_INCLUDE), $(INCLUDE_STACK)), )
46+
$(error Internal makefile error: Include loop detected: $(THIS_INCLUDE) $(INCLUDE_STACK))
4747
endif
4848

4949
ifeq ($(words $(MAKEFILE_LIST)), 2)
@@ -66,7 +66,7 @@ ifneq ($(IS_PREINIT_ENV), true)
6666
endif
6767

6868
# Push our helper name onto the stack
69-
HELPER_STACK := $(THIS_INCLUDE) $(HELPER_STACK)
69+
INCLUDE_STACK := $(THIS_INCLUDE) $(INCLUDE_STACK)
7070

7171
# Setup an automatic include guard
7272
ifneq ($(INCLUDE_GUARD_$(THIS_INCLUDE)), true)

make/common/MakeSnippetEnd.gmk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ ifneq ($(NO_CUSTOM_EXTENSIONS), true)
3434
endif
3535

3636
# Pop our helper name off the stack
37-
HELPER_STACK := $(wordlist 2, $(words $(HELPER_STACK)), $(HELPER_STACK))
37+
SNIPPET_STACK := $(wordlist 2, $(words $(SNIPPET_STACK)), $(SNIPPET_STACK))
3838

3939
# Print an indented message, also counting the top-level makefile as a level
4040
ifeq ($(LOG_FLOW), true)
41-
$(info :$(foreach s, top $(HELPER_STACK), )Leave $(THIS_SNIPPET))
41+
$(info :$(foreach s, top $(INCLUDE_STACK) $(SNIPPET_STACK), )Leave $(THIS_SNIPPET))
4242
endif
4343

4444
# Restore the previous helper name
45-
THIS_SNIPPET := $(firstword $(HELPER_STACK))
45+
THIS_SNIPPET := $(firstword $(SNIPPET_STACK))

make/common/MakeSnippetStart.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ endif
3333

3434
# Print an indented message, also counting the top-level makefile as a level
3535
ifeq ($(LOG_FLOW), true)
36-
$(info :$(foreach s, top $(HELPER_STACK), )Enter $(THIS_SNIPPET) [snippet])
36+
$(info :$(foreach s, top $(INCLUDE_STACK) $(SNIPPET_STACK), )Enter $(THIS_SNIPPET) [snippet])
3737
endif
3838

3939
# Push our helper name onto the stack
40-
HELPER_STACK := $(THIS_SNIPPET) $(HELPER_STACK)
40+
SNIPPET_STACK := $(THIS_SNIPPET) $(SNIPPET_STACK)
4141

4242
# Hook to include the corresponding custom file, if present.
4343
ifneq ($(NO_CUSTOM_EXTENSIONS), true)

0 commit comments

Comments
 (0)