Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into goetz_backport_82…
Browse files Browse the repository at this point in the history
…56660
  • Loading branch information
GoeLin committed Mar 27, 2024
2 parents f00ba25 + d98b460 commit 70c4afd
Show file tree
Hide file tree
Showing 125 changed files with 7,733 additions and 2,892 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,6 @@ jobs:
with:
platform: linux-x64

# Use linux-x64 JDK bundle as build JDK
- name: 'Get build JDK'
id: buildjdk
uses: ./.github/actions/get-bundles
with:
platform: linux-x64

# Upgrading apt to solve libc6 installation bugs, see JDK-8260460.
- name: 'Install toolchain and dependencies'
run: |
Expand Down Expand Up @@ -154,7 +147,6 @@ jobs:
--disable-precompiled-headers
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
--with-sysroot=sysroot
--with-build-jdk=${{ steps.buildjdk.outputs.jdk-path }}
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 }} ${{ inputs.configure-arguments }} || (
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ jobs:
gcc-major-version: '10'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
# The linux-x64 jdk bundle is used as buildjdk for the cross-compile job
if: needs.select.outputs.linux-x64 == 'true' || needs.select.outputs.linux-cross-compile == 'true'
if: needs.select.outputs.linux-x64 == 'true'

build-linux-x86:
name: linux-x86
Expand Down Expand Up @@ -211,7 +210,6 @@ jobs:
name: linux-cross-compile
needs:
- select
- build-linux-x64
uses: ./.github/workflows/build-cross-compile.yml
with:
gcc-major-version: '10'
Expand Down
22 changes: 20 additions & 2 deletions make/Main.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,18 @@ test-image-jdk-jtreg-native:
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNativeJdk.gmk \
test-image-jdk-jtreg-native)

# Native files needed by the testlib
build-test-lib-native:
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f BuildTestLibNative.gmk \
build-test-lib-native)

test-image-lib-native:
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f BuildTestLibNative.gmk \
test-image-lib-native)

# Native files needed when testing the testlib itself
# ... build-test-libtest-jtreg-native etc not yet backported

build-test-hotspot-jtreg-graal:
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregGraalUnit.gmk \
build-test-hotspot-jtreg-graal)
Expand Down Expand Up @@ -596,7 +608,8 @@ endif

ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \
test-image-jdk-jtreg-native build-test-lib-native test-image-lib-native \
build-test-lib build-test-failure-handler \
test-failure-handler test-image-failure-handler test-image-hotspot-gtest \
test-image-hotspot-jtreg-graal build-test-hotspot-jtreg-graal \
run-test exploded-run-test
Expand Down Expand Up @@ -976,12 +989,16 @@ else

build-test-jdk-jtreg-native: buildtools-jdk java.base-libs

build-test-lib-native: buildtools-jdk java.base-libs

build-test-hotspot-jtreg-graal: exploded-image-optimize

test-image-hotspot-jtreg-native: build-test-hotspot-jtreg-native

test-image-jdk-jtreg-native: build-test-jdk-jtreg-native

test-image-lib-native: build-test-lib-native

test-image-hotspot-jtreg-graal: build-test-hotspot-jtreg-graal

test-image-hotspot-gtest: hotspot
Expand Down Expand Up @@ -1141,7 +1158,8 @@ endif

# This target builds the test image
test-image: prepare-test-image \
test-image-jdk-jtreg-native test-image-failure-handler \
test-image-jdk-jtreg-native test-image-lib-native \
test-image-failure-handler \
test-image-demos-jdk $(JVM_TEST_IMAGE_TARGETS)

################################################################################
Expand Down
14 changes: 7 additions & 7 deletions make/autoconf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,14 @@ TOOLCHAIN_POST_DETECTION
TOOLCHAIN_SETUP_BUILD_COMPILERS
TOOLCHAIN_MISC_CHECKS

# Setup the JTReg Regression Test Harness.
TOOLCHAIN_SETUP_JTREG

# Setup Jib dependency tool
TOOLCHAIN_SETUP_JIB

# After toolchain setup, we need to process some flags to be able to continue.
FLAGS_POST_TOOLCHAIN

# Setup the tools needed to test the JDK (JTReg Regression Test Harness
# and the Jib dependency tool).
LIB_TESTS_SETUP_JTREG
LIB_TESTS_SETUP_JIB

# Now we can test some aspects on the target using configure macros.
PLATFORM_SETUP_OPENJDK_TARGET_BITS
PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
Expand Down Expand Up @@ -233,7 +232,8 @@ HOTSPOT_SETUP_JVM_FEATURES
###############################################################################

JDKOPT_DETECT_INTREE_EC
JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
LIB_TESTS_ENABLE_DISABLE_FAILURE_HANDLER

JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST
JDKOPT_EXCLUDE_TRANSLATIONS
JDKOPT_ENABLE_DISABLE_MANPAGES
Expand Down
10 changes: 8 additions & 2 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# Setup flags for C/C++ compiler
#

###############################################################################
################################################################################
#
# How to compile shared libraries.
#
Expand All @@ -39,7 +39,10 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
# Default works for linux, might work on other platforms as well.
SHARED_LIBRARY_FLAGS='-shared'
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
# --disable-new-dtags forces use of RPATH instead of RUNPATH for rpaths.
# This protects internal library dependencies within the JDK from being
# overridden using LD_LIBRARY_PATH. See JDK-8326891 for more information.
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1 -Wl,--disable-new-dtags'
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
Expand All @@ -59,6 +62,9 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
# Default works for linux, might work on other platforms as well.
SHARED_LIBRARY_FLAGS='-shared'
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
if test "x$OPENJDK_TARGET_OS" = xlinux; then
SET_EXECUTABLE_ORIGIN="$SET_EXECUTABLE_ORIGIN -Wl,--disable-new-dtags"
fi
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
Expand Down
39 changes: 0 additions & 39 deletions make/autoconf/jdk-options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -521,45 +521,6 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS],
AC_SUBST(JLINK_KEEP_PACKAGED_MODULES)
])

################################################################################
#
# Check if building of the jtreg failure handler should be enabled.
#
AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
[
AC_ARG_ENABLE([jtreg-failure-handler], [AS_HELP_STRING([--enable-jtreg-failure-handler],
[forces build of the jtreg failure handler to be enabled, missing dependencies
become fatal errors. Default is auto, where the failure handler is built if all
dependencies are present and otherwise just disabled.])])
AC_MSG_CHECKING([if jtreg failure handler should be built])
if test "x$enable_jtreg_failure_handler" = "xyes"; then
if test "x$JT_HOME" = "x"; then
AC_MSG_ERROR([Cannot enable jtreg failure handler without jtreg.])
else
BUILD_FAILURE_HANDLER=true
AC_MSG_RESULT([yes, forced])
fi
elif test "x$enable_jtreg_failure_handler" = "xno"; then
BUILD_FAILURE_HANDLER=false
AC_MSG_RESULT([no, forced])
elif test "x$enable_jtreg_failure_handler" = "xauto" \
|| test "x$enable_jtreg_failure_handler" = "x"; then
if test "x$JT_HOME" = "x"; then
BUILD_FAILURE_HANDLER=false
AC_MSG_RESULT([no, missing jtreg])
else
BUILD_FAILURE_HANDLER=true
AC_MSG_RESULT([yes, jtreg present])
fi
else
AC_MSG_ERROR([Invalid value for --enable-jtreg-failure-handler: $enable_jtreg_failure_handler])
fi
AC_SUBST(BUILD_FAILURE_HANDLER)
])

################################################################################
#
# Enable or disable generation of the classlist at build time
Expand Down
179 changes: 178 additions & 1 deletion make/autoconf/lib-tests.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2022, 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 All @@ -23,6 +23,13 @@
# questions.
#

################################################################################
# Setup libraries and functionalities needed to test the JDK.
################################################################################

# Minimum supported version
JTREG_MINIMUM_VERSION=7.3.1

###############################################################################
#
# Check for graalunit libs, needed for running graalunit tests.
Expand Down Expand Up @@ -54,3 +61,173 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_GRAALUNIT],
UTIL_FIXUP_PATH([GRAALUNIT_LIB])
AC_SUBST(GRAALUNIT_LIB)
])

# Setup the JTReg Regression Test Harness.
AC_DEFUN_ONCE([LIB_TESTS_SETUP_JTREG],
[
AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg],
[Regression Test Harness @<:@probed@:>@])])
if test "x$with_jtreg" = xno; then
# jtreg disabled
AC_MSG_CHECKING([for jtreg test harness])
AC_MSG_RESULT([no, disabled])
elif test "x$with_jtreg" != xyes && test "x$with_jtreg" != x; then
# An explicit path is specified, use it.
JT_HOME="$with_jtreg"
UTIL_FIXUP_PATH([JT_HOME])
if test ! -d "$JT_HOME"; then
AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg does not exist])
fi
if test ! -e "$JT_HOME/lib/jtreg.jar"; then
AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg is not a valid jtreg home])
fi
JTREGEXE="$JT_HOME/bin/jtreg"
if test ! -x "$JTREGEXE"; then
AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg does not contain valid jtreg executable])
fi
AC_MSG_CHECKING([for jtreg test harness])
AC_MSG_RESULT([$JT_HOME])
else
# Try to locate jtreg
if test "x$JT_HOME" != x; then
# JT_HOME set in environment, use it
if test ! -d "$JT_HOME"; then
AC_MSG_WARN([Ignoring JT_HOME pointing to invalid directory: $JT_HOME])
JT_HOME=
else
if test ! -e "$JT_HOME/lib/jtreg.jar"; then
AC_MSG_WARN([Ignoring JT_HOME which is not a valid jtreg home: $JT_HOME])
JT_HOME=
elif test ! -x "$JT_HOME/bin/jtreg"; then
AC_MSG_WARN([Ignoring JT_HOME which does not contain valid jtreg executable: $JT_HOME])
JT_HOME=
else
JTREGEXE="$JT_HOME/bin/jtreg"
AC_MSG_NOTICE([Located jtreg using JT_HOME from environment])
fi
fi
fi
if test "x$JT_HOME" = x; then
# JT_HOME is not set in environment, or was deemed invalid.
# Try to find jtreg on path
UTIL_LOOKUP_PROGS(JTREGEXE, jtreg)
if test "x$JTREGEXE" != x; then
# That's good, now try to derive JT_HOME
JT_HOME=`(cd $($DIRNAME $JTREGEXE)/.. && pwd)`
if test ! -e "$JT_HOME/lib/jtreg.jar"; then
AC_MSG_WARN([Ignoring jtreg from path since a valid jtreg home cannot be found])
JT_HOME=
JTREGEXE=
else
AC_MSG_NOTICE([Located jtreg using jtreg executable in path])
fi
fi
fi
AC_MSG_CHECKING([for jtreg test harness])
if test "x$JT_HOME" != x; then
AC_MSG_RESULT([$JT_HOME])
else
AC_MSG_RESULT([no, not found])
if test "x$with_jtreg" = xyes; then
AC_MSG_ERROR([--with-jtreg was specified, but no jtreg found.])
fi
fi
fi
UTIL_FIXUP_EXECUTABLE(JTREGEXE)
UTIL_FIXUP_PATH(JT_HOME)
AC_SUBST(JT_HOME)
# Verify jtreg version
if test "x$JT_HOME" != x; then
AC_MSG_CHECKING([jtreg version number])
# jtreg -version looks like this: "jtreg 6.1+1-19"
# Extract actual version part ("6.1" in this case)
jtreg_version_full=`$JAVA -jar $JT_HOME/lib/jtreg.jar -version | $HEAD -n 1 | $CUT -d ' ' -f 2`
jtreg_version=${jtreg_version_full/%+*}
AC_MSG_RESULT([$jtreg_version])
# This is a simplified version of TOOLCHAIN_CHECK_COMPILER_VERSION
comparable_actual_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$jtreg_version"`
comparable_minimum_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$JTREG_MINIMUM_VERSION"`
if test $comparable_actual_version -lt $comparable_minimum_version ; then
AC_MSG_ERROR([jtreg version is too old, at least version $JTREG_MINIMUM_VERSION is required])
fi
fi
AC_SUBST(JTREGEXE)
])

# Setup the JIB dependency resolver
AC_DEFUN_ONCE([LIB_TESTS_SETUP_JIB],
[
AC_ARG_WITH(jib, [AS_HELP_STRING([--with-jib],
[Jib dependency management tool @<:@not used@:>@])])
if test "x$with_jib" = xno || test "x$with_jib" = x; then
# jib disabled
AC_MSG_CHECKING([for jib])
AC_MSG_RESULT(no)
elif test "x$with_jib" = xyes; then
AC_MSG_ERROR([Must supply a value to --with-jib])
else
JIB_HOME="${with_jib}"
AC_MSG_CHECKING([for jib])
AC_MSG_RESULT(${JIB_HOME})
if test ! -d "${JIB_HOME}"; then
AC_MSG_ERROR([--with-jib must be a directory])
fi
JIB_JAR=$(ls ${JIB_HOME}/lib/jib-*.jar)
if test ! -f "${JIB_JAR}"; then
AC_MSG_ERROR([Could not find jib jar file in ${JIB_HOME}])
fi
fi
AC_SUBST(JIB_HOME)
])

################################################################################
#
# Check if building of the jtreg failure handler should be enabled.
#
AC_DEFUN_ONCE([LIB_TESTS_ENABLE_DISABLE_FAILURE_HANDLER],
[
AC_ARG_ENABLE([jtreg-failure-handler], [AS_HELP_STRING([--enable-jtreg-failure-handler],
[forces build of the jtreg failure handler to be enabled, missing dependencies
become fatal errors. Default is auto, where the failure handler is built if all
dependencies are present and otherwise just disabled.])])
AC_MSG_CHECKING([if jtreg failure handler should be built])
if test "x$enable_jtreg_failure_handler" = "xyes"; then
if test "x$JT_HOME" = "x"; then
AC_MSG_ERROR([Cannot enable jtreg failure handler without jtreg.])
else
BUILD_FAILURE_HANDLER=true
AC_MSG_RESULT([yes, forced])
fi
elif test "x$enable_jtreg_failure_handler" = "xno"; then
BUILD_FAILURE_HANDLER=false
AC_MSG_RESULT([no, forced])
elif test "x$enable_jtreg_failure_handler" = "xauto" \
|| test "x$enable_jtreg_failure_handler" = "x"; then
if test "x$JT_HOME" = "x"; then
BUILD_FAILURE_HANDLER=false
AC_MSG_RESULT([no, missing jtreg])
else
BUILD_FAILURE_HANDLER=true
AC_MSG_RESULT([yes, jtreg present])
fi
else
AC_MSG_ERROR([Invalid value for --enable-jtreg-failure-handler: $enable_jtreg_failure_handler])
fi
AC_SUBST(BUILD_FAILURE_HANDLER)
])
Loading

0 comments on commit 70c4afd

Please sign in to comment.