Skip to content

Commit

Permalink
Merge branch 'lworld' into compiler_test_porting
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiHartmann committed Jan 22, 2024
2 parents fc3d54a + 16fa770 commit 2e45b61
Show file tree
Hide file tree
Showing 2,586 changed files with 91,761 additions and 61,862 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ on:
jobs:
build-macos:
name: build
runs-on: macos-11
runs-on: macos-13

strategy:
fail-fast: false
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 2023, 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 @@ -146,8 +146,8 @@ jobs:
apt-architecture: 'i386'
# Some multilib libraries do not have proper inter-dependencies, so we have to
# install their dependencies manually.
apt-extra-packages: 'libfreetype-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libc6-i386 libgcc-s1:i386 libstdc++6:i386'
extra-conf-options: '--with-target-bits=32'
apt-extra-packages: 'libfreetype-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libc6-i386 libgcc-s1:i386 libstdc++6:i386 libffi-dev:i386'
extra-conf-options: '--with-target-bits=32 --enable-fallback-linker --enable-libffi-bundling'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.linux-x86 == 'true'
Expand Down Expand Up @@ -227,7 +227,7 @@ jobs:
uses: ./.github/workflows/build-macos.yml
with:
platform: macos-x64
xcode-toolset-version: '12.5.1'
xcode-toolset-version: '14.3.1'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.macos-x64 == 'true'
Expand All @@ -238,7 +238,7 @@ jobs:
uses: ./.github/workflows/build-macos.yml
with:
platform: macos-aarch64
xcode-toolset-version: '12.5.1'
xcode-toolset-version: '14.3.1'
extra-conf-options: '--openjdk-target=aarch64-apple-darwin'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
Expand Down Expand Up @@ -318,7 +318,7 @@ jobs:
with:
platform: macos-x64
bootjdk-platform: macos-x64
runs-on: macos-11
runs-on: macos-13

test-windows-x64:
name: windows-x64
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 2023, 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 @@ -132,7 +132,7 @@ jobs:
run: |
# On macOS we need to install some dependencies for testing
brew install make
sudo xcode-select --switch /Applications/Xcode_11.7.app/Contents/Developer
sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
# This will make GNU make available as 'make' and not only as 'gmake'
echo '/usr/local/opt/make/libexec/gnubin' >> $GITHUB_PATH
if: runner.os == 'macOS'
Expand Down
9 changes: 4 additions & 5 deletions doc/building.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h2 id="operating-system-requirements">Operating System
</tr>
<tr class="even">
<td>macOS</td>
<td>Mac OS X 10.13 (High Sierra)</td>
<td>macOS 13 (Ventura)</td>
</tr>
<tr class="odd">
<td>Windows</td>
Expand Down Expand Up @@ -464,9 +464,8 @@ <h3 id="macos">macOS</h3>
a continuously updated machine running macOS. See the section on <a
href="#apple-xcode">Apple Xcode</a> on some strategies to deal with
this.</p>
<p>It is recommended that you use at least Mac OS X 10.13 (High Sierra).
At the time of writing, the JDK has been successfully compiled on macOS
10.12 (Sierra).</p>
<p>It is recommended that you use at least macOS 13 (Ventura) and Xcode
14, but earlier versions may also work.</p>
<p>The standard macOS environment contains the basic tooling needed to
build, but for external libraries a package manager is recommended. The
JDK uses <a href="https://brew.sh/">homebrew</a> in the examples, but
Expand Down Expand Up @@ -545,7 +544,7 @@ <h2 id="native-compiler-toolchain-requirements">Native Compiler
</tr>
<tr class="even">
<td>macOS</td>
<td>Apple Xcode 10.1 (using clang 10.0.0)</td>
<td>Apple Xcode 14.3.1 (using clang 14.0.3)</td>
</tr>
<tr class="odd">
<td>Windows</td>
Expand Down
8 changes: 4 additions & 4 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ time of writing.
| Operating system | Vendor/version used |
| ----------------- | ---------------------------------- |
| Linux | Oracle Enterprise Linux 6.4 / 7.6 |
| macOS | Mac OS X 10.13 (High Sierra) |
| macOS | macOS 13 (Ventura) |
| Windows | Windows Server 2012 R2 |

The double version numbers for Linux are due to the hybrid model
Expand Down Expand Up @@ -270,8 +270,8 @@ difficult for a project such as the JDK to keep pace with a continuously updated
machine running macOS. See the section on [Apple Xcode](#apple-xcode) on some
strategies to deal with this.

It is recommended that you use at least Mac OS X 10.13 (High Sierra). At the time
of writing, the JDK has been successfully compiled on macOS 10.12 (Sierra).
It is recommended that you use at least macOS 13 (Ventura) and Xcode
14, but earlier versions may also work.

The standard macOS environment contains the basic tooling needed to build, but
for external libraries a package manager is recommended. The JDK uses
Expand Down Expand Up @@ -337,7 +337,7 @@ issues.
| Operating system | Toolchain version |
| ------------------ | ------------------------------------------ |
| Linux | gcc 11.2.0 |
| macOS | Apple Xcode 10.1 (using clang 10.0.0) |
| macOS | Apple Xcode 14.3.1 (using clang 14.0.3) |
| Windows | Microsoft Visual Studio 2022 update 17.1.0 |

All compilers are expected to be able to compile to the C99 language standard,
Expand Down
6 changes: 4 additions & 2 deletions make/JrtfsJar.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2023, 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 @@ -46,8 +46,10 @@ JIMAGE_PKGS := \
jdk/internal/jrtfs \
#

# Compile jrt-fs.jar with the interim compiler, as it
# ends up in the image, this will ensure reproducible classes
$(eval $(call SetupJavaCompilation, BUILD_JRTFS, \
COMPILER := bootjdk, \
COMPILER := interim, \
DISABLED_WARNINGS := options, \
TARGET_RELEASE := $(TARGET_RELEASE_JDK8), \
SRC := $(TOPDIR)/src/java.base/share/classes, \
Expand Down
14 changes: 8 additions & 6 deletions make/RunTests.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ ifeq ($(TEST_JOBS), 0)
c = c * $(TEST_JOBS_FACTOR_JDL); \
c = c * $(TEST_JOBS_FACTOR_MACHINE); \
if (c < 1) c = 1; \
printf "%.0f", c; \
c = c + 0.5; \
printf "%d", c; \
}')
endif

Expand Down Expand Up @@ -862,11 +863,12 @@ define SetupRunJtregTestBody

$$(eval $$(call SetupRunJtregTestCustom, $1))

clean-workdir-$1:
clean-outputdirs-$1:
$$(RM) -r $$($1_TEST_SUPPORT_DIR)
$$(RM) -r $$($1_TEST_RESULTS_DIR)

$1_COMMAND_LINE := \
$$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
$$(JTREG_JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
-Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \
$$($1_JTREG_BASIC_OPTIONS) \
-testjdk:$$(JDK_UNDER_TEST) \
Expand Down Expand Up @@ -909,7 +911,7 @@ define SetupRunJtregTestBody
done
endif

run-test-$1: pre-run-test clean-workdir-$1
run-test-$1: pre-run-test clean-outputdirs-$1
$$(call LogWarn)
$$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR) \
Expand Down Expand Up @@ -946,9 +948,9 @@ define SetupRunJtregTestBody
$$(eval $1_TOTAL := 1) \
)

$1: run-test-$1 parse-test-$1 clean-workdir-$1
$1: run-test-$1 parse-test-$1 clean-outputdirs-$1

TARGETS += $1 run-test-$1 parse-test-$1 clean-workdir-$1
TARGETS += $1 run-test-$1 parse-test-$1 clean-outputdirs-$1
TEST_TARGETS += parse-test-$1

endef
Expand Down
2 changes: 2 additions & 0 deletions make/RunTestsPrebuilt.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ $(eval $(call SetupVariable,JT_HOME))
$(eval $(call SetupVariable,JDK_IMAGE_DIR,$(OUTPUTDIR)/images/jdk))
$(eval $(call SetupVariable,TEST_IMAGE_DIR,$(OUTPUTDIR)/images/test))
$(eval $(call SetupVariable,SYMBOLS_IMAGE_DIR,$(OUTPUTDIR)/images/symbols,NO_CHECK))
$(eval $(call SetupVariable,JTREG_JAVA,$(BOOT_JDK)/bin/java))

# Provide default values for tools that we need
$(eval $(call SetupVariable,MAKE,make,NO_CHECK))
Expand Down Expand Up @@ -248,6 +249,7 @@ $(call CreateNewSpec, $(NEW_SPEC), \
TOPDIR := $(TOPDIR), \
OUTPUTDIR := $(OUTPUTDIR), \
BOOT_JDK := $(BOOT_JDK), \
JTREG_JAVA := $(FIXPATH) $(JTREG_JAVA), \
JT_HOME := $(JT_HOME), \
JDK_IMAGE_DIR := $(JDK_IMAGE_DIR), \
JCOV_IMAGE_DIR := $(JCOV_IMAGE_DIR), \
Expand Down
4 changes: 2 additions & 2 deletions make/ToolsJdk.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ TOOL_GENERATECACERTS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_class
-Dkeystore.pkcs12.macAlgorithm=NONE \
build.tools.generatecacerts.GenerateCacerts

TOOL_GENERATEEMOJIDATA = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
build.tools.generateemojidata.GenerateEmojiData
TOOL_GENERATEEXTRAPROPERTIES = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
build.tools.generateextraproperties.GenerateExtraProperties

TOOL_MAKEZIPREPRODUCIBLE = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
build.tools.makezipreproducible.MakeZipReproducible
Expand Down
2 changes: 1 addition & 1 deletion make/autoconf/basic.m4
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ AC_DEFUN([BASIC_CHECK_DIR_ON_LOCAL_DISK],
# df on AIX does not understand -l. On modern AIXes it understands "-T local" which
# is the same. On older AIXes we just continue to live with a "not local build" warning.
if test "x$OPENJDK_TARGET_OS" = xaix; then
if "$DF -T local > /dev/null 2>&1"; then
if $DF -T local > /dev/null 2>&1; then
DF_LOCAL_ONLY_OPTION='-T local'
else # AIX may use GNU-utils instead
DF_LOCAL_ONLY_OPTION='-l'
Expand Down
37 changes: 20 additions & 17 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -799,15 +799,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
$1_TOOLCHAIN_CFLAGS="${$1_GCC6_CFLAGS}"
$1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized"
elif test "x$TOOLCHAIN_TYPE" = xclang; then
NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks"
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_DELETE_NULL_POINTER_CHECKS_CFLAG],
PREFIX: $3,
IF_FALSE: [
NO_DELETE_NULL_POINTER_CHECKS_CFLAG=
]
)
$1_TOOLCHAIN_CFLAGS="${NO_DELETE_NULL_POINTER_CHECKS_CFLAG}"
fi
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
Expand All @@ -818,6 +809,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
REPRODUCIBLE_CFLAGS=
]
)
AC_SUBST(REPRODUCIBLE_CFLAGS)
fi
# Prevent the __FILE__ macro from generating absolute paths into the built
Expand Down Expand Up @@ -851,6 +843,22 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
FILE_MACRO_CFLAGS=
]
)
if test "x$FILE_MACRO_CFLAGS" != x; then
# Add -pathmap for all VS system include paths using Windows
# full Long path name that is generated by the compiler
# Not enabled under WSL as there is no easy way to obtain the
# Windows full long paths, thus reproducible WSL builds will
# depend on building with the same VS toolchain install location.
if test "x$OPENJDK_BUILD_OS_ENV" != "xwindows.wsl1" && test "x$OPENJDK_BUILD_OS_ENV" != "xwindows.wsl2"; then
for ipath in ${$3SYSROOT_CFLAGS}; do
if test "x${ipath:0:2}" == "x-I"; then
ipath_path=${ipath#"-I"}
UTIL_FIXUP_WIN_LONG_PATH(ipath_path)
FILE_MACRO_CFLAGS="$FILE_MACRO_CFLAGS -pathmap:\"$ipath_path\"=vsi"
fi
done
fi
fi
fi
AC_MSG_CHECKING([how to prevent absolute paths in output])
Expand Down Expand Up @@ -928,17 +936,12 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
# $2 - Prefix for compiler variables (either BUILD_ or nothing).
AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
[
# These flags are required for GCC 6 builds as undefined behavior in OpenJDK code
# runs afoul of the more aggressive versions of these optimizations.
# Notably, value range propagation now assumes that the this pointer of C++
# member functions is non-null.
NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks"
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_DELETE_NULL_POINTER_CHECKS_CFLAG],
PREFIX: $2, IF_FALSE: [NO_DELETE_NULL_POINTER_CHECKS_CFLAG=""])
# This flag is required for GCC 6 builds as undefined behavior in OpenJDK code
# runs afoul of the more aggressive versions of this optimization.
NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG],
PREFIX: $2, IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
$1_GCC6_CFLAGS="${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
$1_GCC6_CFLAGS="${NO_LIFETIME_DSE_CFLAG}"
])

AC_DEFUN_ONCE([FLAGS_SETUP_BRANCH_PROTECTION],
Expand Down
10 changes: 3 additions & 7 deletions make/autoconf/flags.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2023, 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 @@ -128,16 +128,12 @@ AC_DEFUN([FLAGS_SETUP_MACOSX_VERSION],
# The expected format for <version> is either nn.n.n or nn.nn.nn. See
# /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h
# MACOSX_VERSION_MIN specifies the lowest version of Macosx that the built
# MACOSX_VERSION_MIN specifies the lowest version of macOS that the built
# binaries should be compatible with, even if compiled on a newer version
# of the OS. It currently has a hard coded value. Setting this also limits
# exposure to API changes in header files. Bumping this is likely to
# require code changes to build.
if test "x$OPENJDK_TARGET_CPU_ARCH" = xaarch64; then
MACOSX_VERSION_MIN=11.00.00
else
MACOSX_VERSION_MIN=10.12.0
fi
MACOSX_VERSION_MIN=11.00.00
MACOSX_VERSION_MIN_NODOTS=${MACOSX_VERSION_MIN//\./}
AC_SUBST(MACOSX_VERSION_MIN)
Expand Down
38 changes: 37 additions & 1 deletion make/autoconf/lib-tests.m4
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,48 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_JTREG],
UTIL_FIXUP_PATH(JT_HOME)
AC_SUBST(JT_HOME)
# Specify a JDK for running jtreg. Defaults to the BOOT_JDK.
AC_ARG_WITH(jtreg-jdk, [AS_HELP_STRING([--with-jdk],
[path to JDK for running jtreg @<:@BOOT_JDK@:>@])])
AC_MSG_CHECKING([for jtreg jdk])
if test "x${with_jtreg_jdk}" != x; then
if test "x${with_jtreg_jdk}" = xno; then
AC_MSG_RESULT([no, jtreg jdk not specified])
elif test "x${with_jtreg_jdk}" = xyes; then
AC_MSG_RESULT([not specified])
AC_MSG_ERROR([--with-jtreg-jdk needs a value])
else
JTREG_JDK="${with_jtreg_jdk}"
AC_MSG_RESULT([$JTREG_JDK])
UTIL_FIXUP_PATH(JTREG_JDK)
if test ! -f "$JTREG_JDK/bin/java"; then
AC_MSG_ERROR([Could not find jtreg java at $JTREG_JDK/bin/java])
fi
fi
else
JTREG_JDK="${BOOT_JDK}"
AC_MSG_RESULT([no, using BOOT_JDK])
fi
JTREG_JAVA="$JTREG_JDK/bin/java"
UTIL_FIXUP_PATH(JTREG_JAVA)
JTREG_JAVA="$FIXPATH $JTREG_JAVA"
AC_SUBST([JTREG_JAVA])
# Verify jtreg version
if test "x$JT_HOME" != x; then
AC_MSG_CHECKING([jtreg jar existence])
if test ! -f "$JT_HOME/lib/jtreg.jar"; then
AC_MSG_ERROR([Could not find jtreg jar at $JT_HOME/lib/jtreg.jar])
fi
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_full=$($JTREG_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])
Expand Down
6 changes: 0 additions & 6 deletions make/autoconf/libraries.m4
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ AC_DEFUN([LIB_SETUP_JVM_LIBS],
BASIC_JVM_LIBS_$1="$BASIC_JVM_LIBS_$1 -latomic"
fi
fi
# Because RISC-V only has word-sized atomics, it requires libatomic where
# other common architectures do not, so link libatomic by default.
if test "x$OPENJDK_$1_OS" = xlinux && test "x$OPENJDK_$1_CPU" = xriscv64; then
BASIC_JVM_LIBS_$1="$BASIC_JVM_LIBS_$1 -latomic"
fi
])

################################################################################
Expand Down
Loading

0 comments on commit 2e45b61

Please sign in to comment.