Skip to content

Commit

Permalink
Merge pull request #1637 from SAP/pr-jdk-23+16
Browse files Browse the repository at this point in the history
Merge to tag jdk-23+16
  • Loading branch information
RealCLanger authored Apr 3, 2024
2 parents c428348 + d580bcf commit 84a5dff
Show file tree
Hide file tree
Showing 2,424 changed files with 53,235 additions and 48,216 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,32 @@ jobs:
debian-arch: arm64
debian-repository: https://httpredir.debian.org/debian/
debian-version: bullseye
tolerate-sysroot-errors: false
- target-cpu: arm
gnu-arch: arm
debian-arch: armhf
debian-repository: https://httpredir.debian.org/debian/
debian-version: bullseye
tolerate-sysroot-errors: false
gnu-abi: eabihf
- target-cpu: s390x
gnu-arch: s390x
debian-arch: s390x
debian-repository: https://httpredir.debian.org/debian/
debian-version: bullseye
tolerate-sysroot-errors: false
- target-cpu: ppc64le
gnu-arch: powerpc64le
debian-arch: ppc64el
debian-repository: https://httpredir.debian.org/debian/
debian-version: bullseye
tolerate-sysroot-errors: false
- target-cpu: riscv64
gnu-arch: riscv64
debian-arch: riscv64
debian-repository: https://httpredir.debian.org/debian/
debian-version: sid
tolerate-sysroot-errors: true

steps:
- name: 'Checkout the JDK source'
Expand All @@ -93,13 +98,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

- name: 'Get GTest'
id: gtest
uses: ./.github/actions/get-gtest
Expand Down Expand Up @@ -130,6 +128,7 @@ jobs:
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'

- name: 'Create sysroot'
id: create-sysroot
run: >
sudo debootstrap
--arch=${{ matrix.debian-arch }}
Expand All @@ -140,6 +139,7 @@ jobs:
${{ matrix.debian-version }}
sysroot
${{ matrix.debian-repository }}
continue-on-error: ${{ matrix.tolerate-sysroot-errors }}
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'

- name: 'Prepare sysroot'
Expand All @@ -151,7 +151,12 @@ jobs:
rm -rf sysroot/usr/{sbin,bin,share}
rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd}
rm -rf sysroot/usr/libexec/gcc
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
if: steps.create-sysroot.outcome == 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'

- name: 'Remove broken sysroot'
run: |
sudo rm -rf sysroot/
if: steps.create-sysroot.outcome != 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'

- name: 'Configure'
run: >
Expand All @@ -165,18 +170,19 @@ 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 }}
--with-jmod-compress=zip-1
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 }} || (
echo "Dumping config.log:" &&
cat config.log &&
exit 1)
if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'

- name: 'Build'
id: build
uses: ./.github/actions/do-build
with:
make-target: 'hotspot ${{ inputs.make-arguments }}'
platform: linux-${{ matrix.target-cpu }}
if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,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 @@ -221,7 +220,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
2 changes: 1 addition & 1 deletion doc/building.html
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ <h3 id="clang">clang</h3>
<p>To use clang instead of gcc on Linux, use
<code>--with-toolchain-type=clang</code>.</p>
<h3 id="apple-xcode">Apple Xcode</h3>
<p>The oldest supported version of Xcode is 8.</p>
<p>The oldest supported version of Xcode is 13.0.</p>
<p>You will need the Xcode command line developer tools to be able to
build the JDK. (Actually, <em>only</em> the command line tools are
needed, not the IDE.) The simplest way to install these is to run:</p>
Expand Down
2 changes: 1 addition & 1 deletion doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ To use clang instead of gcc on Linux, use `--with-toolchain-type=clang`.

### Apple Xcode

The oldest supported version of Xcode is 8.
The oldest supported version of Xcode is 13.0.

You will need the Xcode command line developer tools to be able to build the
JDK. (Actually, *only* the command line tools are needed, not the IDE.) The
Expand Down
4 changes: 2 additions & 2 deletions make/CompileInterimLangtools.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 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 @@ -105,7 +105,7 @@ define SetupInterimModule
Standard.java, \
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java \
$($1.interim_EXTRA_FILES), \
COPY := .gif .png .xml .css .svg .js .js.template .txt javax.tools.JavaCompilerTool, \
COPY := .gif .png .xml .css .svg .js .js.template .txt .woff .woff2 javax.tools.JavaCompilerTool, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \
DISABLED_WARNINGS := module options, \
JAVAC_FLAGS := \
Expand Down
5 changes: 5 additions & 0 deletions make/Main.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,11 @@ else
java.base-copy: build-hsdis
endif

# On Windows, we need to copy tzmappings generated by gensrc
ifeq ($(call isTargetOs, windows), true)
java.base-copy: java.base-gensrc
endif

# jdk.accessibility depends on java.desktop
jdk.accessibility-libs: java.desktop-libs

Expand Down
4 changes: 4 additions & 0 deletions make/autoconf/lib-bundled.m4
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBJPEG],
[ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])])
USE_EXTERNAL_LIBJPEG=true
LIBJPEG_LIBS="-ljpeg"
else
AC_MSG_ERROR([Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'])
fi
AC_SUBST(USE_EXTERNAL_LIBJPEG)
AC_SUBST(LIBJPEG_LIBS)
])

################################################################################
Expand Down Expand Up @@ -102,11 +104,13 @@ AC_DEFUN_ONCE([LIB_SETUP_GIFLIB],
[ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])])
USE_EXTERNAL_LIBGIF=true
GIFLIB_LIBS=-lgif
else
AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled'])
fi
AC_SUBST(USE_EXTERNAL_LIBGIF)
AC_SUBST(GIFLIB_LIBS)
])

################################################################################
Expand Down
4 changes: 1 addition & 3 deletions make/autoconf/libraries.m4
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 @@ -171,13 +171,11 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
LIB_SETUP_JVM_LIBS(TARGET)
JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
JDKEXE_LIBS=""
JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_TARGET"
OPENJDK_BUILD_JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
OPENJDK_BUILD_JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_BUILD"
AC_SUBST(JDKLIB_LIBS)
AC_SUBST(JDKEXE_LIBS)
AC_SUBST(JVM_LIBS)
AC_SUBST(OPENJDK_BUILD_JDKLIB_LIBS)
AC_SUBST(OPENJDK_BUILD_JVM_LIBS)
Expand Down
3 changes: 2 additions & 1 deletion make/autoconf/spec.gmk.template
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,6 @@ JDKLIB_LIBS := @JDKLIB_LIBS@

# LDFLAGS used to link the jdk native launchers (C-code)
LDFLAGS_JDKEXE := @LDFLAGS_JDKEXE@
JDKEXE_LIBS := @JDKEXE_LIBS@

# LDFLAGS specific to C++ linking.
LDFLAGS_CXX_JDK := @LDFLAGS_CXX_JDK@
Expand Down Expand Up @@ -796,7 +795,9 @@ TAR_SUPPORTS_TRANSFORM := @TAR_SUPPORTS_TRANSFORM@

# Build setup
USE_EXTERNAL_LIBJPEG := @USE_EXTERNAL_LIBJPEG@
LIBJPEG_LIBS := @LIBJPEG_LIBS@
USE_EXTERNAL_LIBGIF := @USE_EXTERNAL_LIBGIF@
GIFLIB_LIBS := @GIFLIB_LIBS@
USE_EXTERNAL_LIBZ := @USE_EXTERNAL_LIBZ@
LIBZ_CFLAGS := @LIBZ_CFLAGS@
LIBZ_LIBS := @LIBZ_LIBS@
Expand Down
43 changes: 43 additions & 0 deletions make/common/JdkNativeCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ define SetupJdkLibraryBody
# Add the module specific java header dir
$1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE)))

$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS))
$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS_TYPE))
# Prepend JDK libs before external libs
$1_LIBS := $$($1_JDK_LIBS) $$($1_LIBS)

ifneq ($$($1_EXTRA_HEADER_DIRS), )
$1_PROCESSED_EXTRA_HEADER_DIRS := $$(foreach dir, $$($1_EXTRA_HEADER_DIRS), \
$$(call ProcessDir, $$(dir)))
Expand Down Expand Up @@ -261,6 +266,19 @@ define SetupJdkExecutableBody
$1_LIBS += $(LIBCXX)
endif

ifeq ($$($1_SRC), )
ifneq ($$(MODULE), )
$1_SRC := $$(call FindSrcDirsForComponent, $$(MODULE), $$($1_NAME))
else
$$(error Must specify SRC in a MODULE free context)
endif
else
$1_SRC := $$(foreach dir, $$($1_SRC), $$(call ProcessDir, $$(dir)))
endif
ifneq ($$($1_EXTRA_SRC), )
$1_SRC += $$(foreach dir, $$($1_EXTRA_SRC), $$(call ProcessDir, $$(dir)))
endif

ifeq ($$($1_VERSIONINFO_RESOURCE), )
$1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
endif
Expand All @@ -273,6 +291,21 @@ define SetupJdkExecutableBody
-I$(TOPDIR)/src/java.base/windows/native/common \
$$($1_EXTRA_RCFLAGS)

ifneq ($$($1_HEADERS_FROM_SRC), false)
$1_SRC_HEADER_FLAGS := $$(addprefix -I, $$(wildcard $$($1_SRC)))
endif

$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS))
$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS_TYPE))
# Prepend JDK libs before external libs
$1_LIBS := $$($1_JDK_LIBS) $$($1_LIBS)

ifneq ($$($1_EXTRA_HEADER_DIRS), )
$1_PROCESSED_EXTRA_HEADER_DIRS := $$(foreach dir, $$($1_EXTRA_HEADER_DIRS), \
$$(call ProcessDir, $$(dir)))
$1_EXTRA_HEADER_FLAGS := $$(addprefix -I, $$($1_PROCESSED_EXTRA_HEADER_DIRS))
endif

ifneq ($$($1_DEFAULT_CFLAGS), false)
# Set the default flags first to be able to override
$1_CFLAGS := $$(filter-out $$($1_CFLAGS_FILTER_OUT), $$(CFLAGS_JDKEXE)) $$($1_CFLAGS)
Expand All @@ -281,6 +314,16 @@ define SetupJdkExecutableBody
$1_CXXFLAGS := $$(filter-out $$($1_CXXFLAGS_FILTER_OUT), $$(CXXFLAGS_JDKEXE)) $$($1_CXXFLAGS)
endif

ifneq ($$($1_CFLAGS), )
$1_CFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS)
endif
ifneq ($$($1_CXXFLAGS), )
$1_CXXFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS)
endif
ifeq ($$($1_CFLAGS)$$($1_CXXFLAGS), )
$1_CFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS)
endif

ifneq ($$($1_DEFAULT_LDFLAGS), false)
# Set the default flags first to be able to override
$1_LDFLAGS := $$(filter-out $$($1_LDFLAGS_FILTER_OUT), $$(LDFLAGS_JDKEXE)) $$($1_LDFLAGS)
Expand Down
24 changes: 13 additions & 11 deletions make/common/modules/LauncherCommon.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ define SetupBuildLauncherBody
endif
endif

ifeq ($(USE_EXTERNAL_LIBZ), true)
$1_LIBS += -lz
endif

$1_WINDOWS_JLI_LIB := $(call FindStaticLib, java.base, jli, /libjli)

$1_EXTRA_FILES := $(LAUNCHER_SRC)/main.c
Expand Down Expand Up @@ -155,13 +151,19 @@ define SetupBuildLauncherBody
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
-L$(call FindLibDirForModule, java.base), \
LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
LIBS_linux := -ljli -lpthread $(LIBDL), \
LIBS_macosx := -ljli -framework Cocoa -framework Security \
-framework ApplicationServices, \
LIBS_aix := -ljli_static, \
LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
$(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib, \
JDK_LIBS_linux := -ljli, \
JDK_LIBS_macosx := -ljli, \
JDK_LIBS_aix := -ljli_static, \
JDK_LIBS_windows := \
$(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib \
$$($1_WINDOWS_JLI_LIB), \
LIBS := $$($1_LIBS), \
LIBS_unix := $(LIBZ_LIBS), \
LIBS_linux := $(LIBDL) -lpthread, \
LIBS_macosx := \
-framework ApplicationServices \
-framework Cocoa \
-framework Security, \
OUTPUT_DIR := $$($1_OUTPUT_DIR), \
VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
EXTRA_RCFLAGS := $$($1_EXTRA_RCFLAGS), \
Expand Down
17 changes: 9 additions & 8 deletions make/hotspot/lib/CompileGtest.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@
$(eval $(call IncludeCustomExtension, hotspot/lib/CompileGtest.gmk))

GTEST_TEST_SRC += $(TOPDIR)/test/hotspot/gtest
GTEST_LAUNCHER_SRC := $(TOPDIR)/test/hotspot/gtest/gtestLauncher.cpp

ifeq ($(ASAN_ENABLED), true)
GTEST_LAUNCHER_SRC += $(TOPDIR)/make/data/asan/asan_default_options.cpp
GTEST_LAUNCHER_EXTRA_FILES += $(TOPDIR)/make/data/asan/asan_default_options.cpp
endif

ifeq ($(LSAN_ENABLED), true)
GTEST_LAUNCHER_SRC += $(TOPDIR)/make/data/lsan/lsan_default_options.cpp
GTEST_LAUNCHER_EXTRA_FILES += $(TOPDIR)/make/data/lsan/lsan_default_options.cpp
endif

# On Windows, there are no internal debug symbols so must set copying to true
Expand Down Expand Up @@ -109,9 +108,9 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
DEFAULT_LDFLAGS := false, \
LDFLAGS := $(JVM_LDFLAGS), \
LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/libgtest, \
JDK_LIBS_unix := -lgtest, \
JDK_LIBS_windows := $(JVM_OUTPUTDIR)/libgtest/gtest.lib, \
LIBS := $(JVM_LIBS), \
LIBS_unix := -lgtest, \
LIBS_windows := $(JVM_OUTPUTDIR)/libgtest/gtest.lib, \
OPTIMIZATION := $(JVM_OPTIMIZATION), \
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \
Expand All @@ -136,7 +135,9 @@ $(eval $(call SetupJdkExecutable, BUILD_GTEST_LAUNCHER, \
TYPE := EXECUTABLE, \
LINK_TYPE := C++, \
OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
EXTRA_FILES := $(GTEST_LAUNCHER_SRC), \
SRC := $(TOPDIR)/test/hotspot/gtest, \
INCLUDE_FILES := gtestLauncher.cpp, \
EXTRA_FILES := $(GTEST_LAUNCHER_EXTRA_FILES), \
OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/launcher-objs, \
DEFAULT_CFLAGS := false, \
CFLAGS := $(JVM_CFLAGS) \
Expand All @@ -146,8 +147,8 @@ $(eval $(call SetupJdkExecutable, BUILD_GTEST_LAUNCHER, \
-I$(GTEST_FRAMEWORK_SRC)/googlemock/include, \
LD_SET_ORIGIN := false, \
LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/gtest $(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS_unix := -ljvm, \
LIBS_windows := $(JVM_OUTPUTDIR)/gtest/objs/jvm.lib, \
JDK_LIBS_unix := -ljvm, \
JDK_LIBS_windows := $(JVM_OUTPUTDIR)/gtest/objs/jvm.lib, \
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \
))
Expand Down
Loading

0 comments on commit 84a5dff

Please sign in to comment.