Skip to content

Commit

Permalink
Merge branch 'master' into jdk-8336881-metrics-systemd-slice
Browse files Browse the repository at this point in the history
  • Loading branch information
jerboaa committed Oct 22, 2024
2 parents 03699b0 + 2da7f2b commit a3989e8
Show file tree
Hide file tree
Showing 741 changed files with 106,713 additions and 5,452 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/gen-build-failure-report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#

# Import common utils
. report-utils.sh
. .github/scripts/report-utils.sh

GITHUB_STEP_SUMMARY="$1"
BUILD_DIR="$(ls -d build/*)"
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/gen-test-results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#

# Import common utils
. report-utils.sh
. .github/scripts/report-utils.sh

GITHUB_STEP_SUMMARY="$1"

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- target-cpu: riscv64
gnu-arch: riscv64
debian-arch: riscv64
debian-repository: https://snapshot.debian.org/archive/debian/20240228T034848Z/
debian-repository: https://httpredir.debian.org/debian/
debian-version: sid
tolerate-sysroot-errors: true

Expand Down Expand Up @@ -131,6 +131,7 @@ jobs:
id: create-sysroot
run: >
sudo debootstrap
--no-merged-usr
--arch=${{ matrix.debian-arch }}
--verbose
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev
Expand All @@ -151,6 +152,9 @@ jobs:
rm -rf sysroot/usr/{sbin,bin,share}
rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd}
rm -rf sysroot/usr/libexec/gcc
# /{bin,sbin,lib}/ are not symbolic links to /usr/{bin,sbin,lib}/ when debootstrap with --no-merged-usr
rm -rf sysroot/{sbin,bin}
rm -rf sysroot/lib/{udev,systemd}
if: steps.create-sysroot.outcome == 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'

- name: 'Remove broken sysroot'
Expand Down
1 change: 1 addition & 0 deletions make/Global.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ help:
$(info $(_) # method is 'auto', 'ignore' or 'fail' (default))
$(info $(_) TEST="test1 ..." # Use the given test descriptor(s) for testing, e.g.)
$(info $(_) # make test TEST="jdk_lang gtest:all")
$(info $(_) TEST_DEPS="dependency1 ..." # Specify additional dependencies for running tests, e.g docs-jdk
$(info $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness, use 'make test-only JTREG=help' to list)
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness, use 'make test-only GTEST=help' to list)
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness, use 'make test-only MICRO=help' to list)
Expand Down
2 changes: 1 addition & 1 deletion make/InitSupport.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ifeq ($(HAS_SPEC), )

# Make control variables, handled by Init.gmk
INIT_CONTROL_VARIABLES += LOG CONF CONF_NAME SPEC JOBS TEST_JOBS CONF_CHECK \
COMPARE_BUILD JTREG GTEST MICRO TEST_OPTS TEST_VM_OPTS
COMPARE_BUILD JTREG GTEST MICRO TEST_OPTS TEST_VM_OPTS TEST_DEPS

# All known make control variables
MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER SPEC_FILTER
Expand Down
10 changes: 5 additions & 5 deletions make/Main.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -785,13 +785,13 @@ $(eval $(call SetupTarget, build-microbenchmark, \
$(eval $(call SetupTarget, test, \
MAKEFILE := RunTests, \
ARGS := TEST="$(TEST)", \
DEPS := jdk-image test-image, \
DEPS := jdk-image test-image $(TEST_DEPS), \
))

$(eval $(call SetupTarget, exploded-test, \
MAKEFILE := RunTests, \
ARGS := TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR), \
DEPS := exploded-image test-image, \
DEPS := exploded-image test-image $(TEST_DEPS), \
))

ifeq ($(JCOV_ENABLED), true)
Expand Down Expand Up @@ -1110,8 +1110,8 @@ else
test-make-compile-commands: compile-commands

# Declare dependency for all generated test targets
$(foreach t, $(filter-out test-make%, $(ALL_TEST_TARGETS)), $(eval $t: jdk-image test-image))
$(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image))
$(foreach t, $(filter-out test-make%, $(ALL_TEST_TARGETS)), $(eval $t: jdk-image test-image $(TEST_DEPS)))
$(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image $(TEST_DEPS)))

interim-image: $(INTERIM_JMOD_TARGETS)

Expand Down
8 changes: 8 additions & 0 deletions make/RunTests.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ jaxp_JTREG_PROBLEM_LIST += $(TOPDIR)/test/jaxp/ProblemList.txt
langtools_JTREG_PROBLEM_LIST += $(TOPDIR)/test/langtools/ProblemList.txt
hotspot_JTREG_PROBLEM_LIST += $(TOPDIR)/test/hotspot/jtreg/ProblemList.txt
lib-test_JTREG_PROBLEM_LIST += $(TOPDIR)/test/lib-test/ProblemList.txt
docs_JTREG_PROBLEM_LIST += $(TOPDIR)/test/docs/ProblemList.txt

################################################################################
# Parse test selection
Expand Down Expand Up @@ -739,6 +740,11 @@ define SetupRunJtregTestBody
# Only the problem list for the current test root should be used.
$1_JTREG_PROBLEM_LIST := $$(filter $$($1_TEST_ROOT)%, $$($1_JTREG_PROBLEM_LIST))

# Pass along the path to the tidy html checker
ifneq ($$(TIDY), )
$1_JTREG_BASIC_OPTIONS += -Dtidy=$$(TIDY)
endif

ifneq ($(TEST_JOBS), 0)
$$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS)))
else
Expand Down Expand Up @@ -868,6 +874,8 @@ define SetupRunJtregTestBody

$1_JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_DIR=$(TEST_IMAGE_DIR)

$1_JTREG_BASIC_OPTIONS += -e:DOCS_JDK_IMAGE_DIR=$$(DOCS_JDK_IMAGE_DIR)

ifneq ($$(JTREG_FAILURE_HANDLER_OPTIONS), )
$1_JTREG_LAUNCHER_OPTIONS += -Djava.library.path="$(JTREG_FAILURE_HANDLER_DIR)"
endif
Expand Down
3 changes: 2 additions & 1 deletion make/autoconf/configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -202,6 +202,7 @@ FLAGS_POST_TOOLCHAIN
LIB_TESTS_SETUP_JTREG
LIB_TESTS_SETUP_JMH
LIB_TESTS_SETUP_JIB
LIB_TESTS_SETUP_TIDY

# Now we can test some aspects on the target using configure macros.
PLATFORM_SETUP_OPENJDK_TARGET_BITS
Expand Down
8 changes: 3 additions & 5 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -936,15 +936,13 @@ AC_DEFUN_ONCE([FLAGS_SETUP_BRANCH_PROTECTION],
if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${BRANCH_PROTECTION_FLAG}],
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$BRANCH_PROTECTION_FLAG],
IF_TRUE: [BRANCH_PROTECTION_AVAILABLE=true])
fi
fi
BRANCH_PROTECTION_CFLAGS=""
UTIL_ARG_ENABLE(NAME: branch-protection, DEFAULT: false,
RESULT: USE_BRANCH_PROTECTION, AVAILABLE: $BRANCH_PROTECTION_AVAILABLE,
RESULT: BRANCH_PROTECTION_ENABLED, AVAILABLE: $BRANCH_PROTECTION_AVAILABLE,
DESC: [enable branch protection when compiling C/C++],
IF_ENABLED: [ BRANCH_PROTECTION_CFLAGS=${BRANCH_PROTECTION_FLAG}])
AC_SUBST(BRANCH_PROTECTION_CFLAGS)
IF_ENABLED: [BRANCH_PROTECTION_CFLAGS=$BRANCH_PROTECTION_FLAG])
])
4 changes: 4 additions & 0 deletions make/autoconf/flags-other.m4
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,9 @@ AC_DEFUN([FLAGS_SETUP_ASFLAGS_CPU_DEP],
$2JVM_ASFLAGS="${$2JVM_ASFLAGS} $ARM_ARCH_TYPE_ASFLAGS $ARM_FLOAT_TYPE_ASFLAGS"
fi
if test "x$BRANCH_PROTECTION_ENABLED" = "xtrue"; then
$2JVM_ASFLAGS="${$2JVM_ASFLAGS} $BRANCH_PROTECTION_FLAG"
fi
AC_SUBST($2JVM_ASFLAGS)
])
19 changes: 19 additions & 0 deletions make/autoconf/jvm-features.m4
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,22 @@ AC_DEFUN([JVM_FEATURES_CALCULATE_ACTIVE],
$JVM_FEATURES_ENABLED, $JVM_FEATURES_DISABLED)
])

################################################################################
# Filter the unsupported feature combinations.
# This is called after JVM_FEATURES_ACTIVE are fully populated.
#
AC_DEFUN([JVM_FEATURES_FILTER_UNSUPPORTED],
[
# G1 late barrier expansion in C2 is not implemented for some platforms.
# Choose not to support G1 in this configuration.
if JVM_FEATURES_IS_ACTIVE(compiler2); then
if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
AC_MSG_NOTICE([G1 cannot be used with C2 on this platform, disabling G1])
UTIL_GET_NON_MATCHING_VALUES(JVM_FEATURES_ACTIVE, $JVM_FEATURES_ACTIVE, "g1gc")
fi
fi
])

################################################################################
# Helper function for JVM_FEATURES_VERIFY. Check if the specified JVM
# feature is active. To be used in shell if constructs, like this:
Expand Down Expand Up @@ -554,6 +570,9 @@ AC_DEFUN_ONCE([JVM_FEATURES_SETUP],
# The result is stored in JVM_FEATURES_ACTIVE.
JVM_FEATURES_CALCULATE_ACTIVE($variant)
# Filter unsupported feature combinations from JVM_FEATURES_ACTIVE.
JVM_FEATURES_FILTER_UNSUPPORTED
# Verify consistency for JVM_FEATURES_ACTIVE.
JVM_FEATURES_VERIFY($variant)
Expand Down
26 changes: 26 additions & 0 deletions make/autoconf/lib-tests.m4
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,32 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_JIB],
AC_SUBST(JIB_HOME)
])

# Setup the tidy html checker
AC_DEFUN_ONCE([LIB_TESTS_SETUP_TIDY],
[
UTIL_LOOKUP_PROGS(TIDY, tidy)
if test "x$TIDY" != x; then
AC_MSG_CHECKING([if tidy is working properly])
tidy_output=`$TIDY --version 2>&1`
if ! $ECHO "$tidy_output" | $GREP -q "HTML Tidy" 2>&1 > /dev/null; then
AC_MSG_RESULT([no])
AC_MSG_NOTICE([$TIDY is not a valid tidy executable and will be ignored. Output from --version: $tidy_output])
TIDY=
elif ! $ECHO "$tidy_output" | $GREP -q "version" 2>&1 > /dev/null; then
AC_MSG_RESULT([no])
AC_MSG_NOTICE([$TIDY is missing a proper version number and will be ignored. Output from --version: $tidy_output])
TIDY=
else
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for tidy version])
tidy_version=`$ECHO $tidy_output | $SED -e 's/.*version //g'`
AC_MSG_RESULT([$tidy_version])
fi
fi
AC_SUBST(TIDY)
])

################################################################################
#
# Check if building of the jtreg failure handler should be enabled.
Expand Down
2 changes: 1 addition & 1 deletion make/autoconf/spec.gmk.template
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ ENABLE_LIBFFI_BUNDLING := @ENABLE_LIBFFI_BUNDLING@
LIBFFI_LIB_FILE := @LIBFFI_LIB_FILE@
FILE_MACRO_CFLAGS := @FILE_MACRO_CFLAGS@
REPRODUCIBLE_CFLAGS := @REPRODUCIBLE_CFLAGS@
BRANCH_PROTECTION_CFLAGS := @BRANCH_PROTECTION_CFLAGS@

STATIC_LIBS_CFLAGS := @STATIC_LIBS_CFLAGS@

Expand Down Expand Up @@ -744,6 +743,7 @@ MKDIR := @MKDIR@
MV := @MV@
NICE := @NICE@
PANDOC := @PANDOC@
TIDY := @TIDY@
PATCH := @PATCH@
PRINTF := @PRINTF@
READLINK := @READLINK@
Expand Down
6 changes: 1 addition & 5 deletions make/autoconf/toolchain.m4
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION],
[
# Restore old path, except for the microsoft toolchain, which requires the
# toolchain path to remain in place. Otherwise the compiler will not work in
# some siutations in later configure checks.
# some situations in later configure checks.
if test "x$TOOLCHAIN_TYPE" != "xmicrosoft"; then
PATH="$OLD_PATH"
fi
Expand All @@ -316,10 +316,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION],
# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
CFLAGS="$ORG_CFLAGS"
CXXFLAGS="$ORG_CXXFLAGS"
# filter out some unwanted additions autoconf may add to CXX; we saw this on macOS with autoconf 2.72
UTIL_GET_NON_MATCHING_VALUES(cxx_filtered, $CXX, -std=c++11 -std=gnu++11)
CXX="$cxx_filtered"
])

# Check if a compiler is of the toolchain type we expect, and save the version
Expand Down
64 changes: 64 additions & 0 deletions make/autoconf/util.m4
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,70 @@

m4_include([util_paths.m4])

###############################################################################
# Overwrite the existing version of AC_PROG_CC with our own custom variant.
# Unlike the regular AC_PROG_CC, the compiler list must always be passed.
AC_DEFUN([AC_PROG_CC],
[
AC_LANG_PUSH(C)
AC_ARG_VAR([CC], [C compiler command])
AC_ARG_VAR([CFLAGS], [C compiler flags])
_AC_ARG_VAR_LDFLAGS()
_AC_ARG_VAR_LIBS()
_AC_ARG_VAR_CPPFLAGS()
AC_CHECK_TOOLS(CC, [$1])
test -z "$CC" && AC_MSG_FAILURE([no acceptable C compiler found in \$PATH])
# Provide some information about the compiler.
_AS_ECHO_LOG([checking for _AC_LANG compiler version])
set X $ac_compile
ac_compiler=$[2]
for ac_option in --version -v -V -qversion -version; do
_AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD])
done
m4_expand_once([_AC_COMPILER_EXEEXT])
m4_expand_once([_AC_COMPILER_OBJEXT])
_AC_PROG_CC_G
AC_LANG_POP(C)
])

###############################################################################
# Overwrite the existing version of AC_PROG_CXX with our own custom variant.
# Unlike the regular AC_PROG_CXX, the compiler list must always be passed.
AC_DEFUN([AC_PROG_CXX],
[
AC_LANG_PUSH(C++)
AC_ARG_VAR([CXX], [C++ compiler command])
AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])
_AC_ARG_VAR_LDFLAGS()
_AC_ARG_VAR_LIBS()
_AC_ARG_VAR_CPPFLAGS()
AC_CHECK_TOOLS(CXX, [$1])
# Provide some information about the compiler.
_AS_ECHO_LOG([checking for _AC_LANG compiler version])
set X $ac_compile
ac_compiler=$[2]
for ac_option in --version -v -V -qversion; do
_AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD])
done
m4_expand_once([_AC_COMPILER_EXEEXT])
m4_expand_once([_AC_COMPILER_OBJEXT])
_AC_PROG_CXX_G
AC_LANG_POP(C++)
])

################################################################################
# Create a function/macro that takes a series of named arguments. The call is
# similar to AC_DEFUN, but the setup of the function looks like this:
Expand Down
4 changes: 2 additions & 2 deletions make/common/FindTests.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -43,7 +43,7 @@ $(eval $(call IncludeCustomExtension, common/FindTests.gmk))
TEST_BASEDIRS += $(TOPDIR)/test $(TOPDIR)

# JTREG_TESTROOTS might have been set by a custom extension
JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools jaxp lib-test)
JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools jaxp lib-test docs)

# Extract the names of the Jtreg group files from the TEST.ROOT files. The
# TEST.ROOT files being properties files can be interpreted as makefiles so
Expand Down
Loading

0 comments on commit a3989e8

Please sign in to comment.