Skip to content

Commit

Permalink
Merge jdk
Browse files Browse the repository at this point in the history
* Merge tag jdk-23+15
* Merge tag jdk-23+16
  • Loading branch information
David Simms committed Aug 13, 2024
2 parents f632986 + d580bcf commit 8c0dc18
Show file tree
Hide file tree
Showing 2,870 changed files with 342,356 additions and 336,891 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 @@ -133,8 +133,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 @@ -214,7 +213,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
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,5 @@ NashornProfile.txt
/src/utils/LogCompilation/target/
/.project/
/.settings/
/.project
/.classpath
/.cproject
/compile_commands.json
/.cache
2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version=0
domain=openjdk.org

[checks "whitespace"]
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.md|.*\.properties|.*\.gmk|.*\.m4|.*\.ac|Makefile
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.S|.*\.md|.*\.properties|.*\.gmk|.*\.m4|.*\.ac|Makefile
ignore-tabs=.*\.gmk|Makefile

[checks "committer"]
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
7 changes: 0 additions & 7 deletions doc/ide.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ <h4 id="eclipse-cdt">Eclipse CDT</h4>
<pre><code>make eclipse-mixed-env</code></pre>
<p>Do note that this generates all features that come with both Java and
C/C++ natures.</p>
<p>By default, the Eclipse Workspace is located in the ide subdirectory
in the build output. To share the JDK's source directory with the
Eclipse Workspace, you can instead run:</p>
<pre><code>make eclipse-shared-&lt;ENV&gt;-env</code></pre>
<p>Eclipse support in the JDK is relatively new, so do keep in mind that
not everything may work at the moment. As such, the resulting Workspace
also has compilation database parsing support enabled, so you can pass
Expand Down Expand Up @@ -160,9 +156,6 @@ <h4 id="eclipse">Eclipse</h4>
<p>If doing so results in an error, you can also import the JDK via
<code>File -&gt; Import -&gt; Existing Projects into Workspace</code> as
a last resort.</p>
<p>Alternatively, if you want a Java Workspace inside the JDK's source
directory, you can instead run:</p>
<pre><code>make eclipse-shared-java-env</code></pre>
<p>As mentioned above for Eclipse CDT, you can create a combined Java
and C/C++ Workspace which can conveniently switch between Java and C/C++
natures during development by running:</p>
Expand Down
15 changes: 0 additions & 15 deletions doc/ide.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,6 @@ make eclipse-mixed-env
Do note that this generates all features that come with both Java and C/C++
natures.

By default, the Eclipse Workspace is located in the ide subdirectory in the
build output. To share the JDK's source directory with the Eclipse Workspace,
you can instead run:

```
make eclipse-shared-<ENV>-env
```

Eclipse support in the JDK is relatively new, so do keep in mind that not
everything may work at the moment. As such, the resulting Workspace also
has compilation database parsing support enabled, so you can pass Eclipse
Expand Down Expand Up @@ -176,13 +168,6 @@ If doing so results in an error, you can also import the JDK via
`File -> Import -> Existing Projects into Workspace`
as a last resort.

Alternatively, if you want a Java Workspace inside the JDK's source directory,
you can instead run:

```
make eclipse-shared-java-env
```

As mentioned above for Eclipse CDT, you can create a combined Java and C/C++
Workspace which can conveniently switch between Java and C/C++ natures during
development by running:
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
16 changes: 9 additions & 7 deletions make/Hsdis.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ REAL_HSDIS_NAME := hsdis-$(OPENJDK_TARGET_CPU_LEGACY_LIB)$(SHARED_LIBRARY_SUFFIX
BUILT_HSDIS_LIB := $(HSDIS_OUTPUT_DIR)/$(REAL_HSDIS_NAME)

HSDIS_LINK_TYPE := C
HSDIS_TOOLCHAIN_CFLAGS := $(CFLAGS_JDKLIB)
HSDIS_TOOLCHAIN_LDFLAGS := $(LDFLAGS_JDKLIB)

ifeq ($(HSDIS_BACKEND), capstone)
ifeq ($(call isTargetCpuArch, x86), true)
Expand All @@ -60,7 +58,6 @@ endif
ifeq ($(HSDIS_BACKEND), llvm)
# Use C++ instead of C
HSDIS_LINK_TYPE := C++
HSDIS_TOOLCHAIN_CFLAGS := $(CXXFLAGS_JDKLIB)

ifeq ($(call isTargetOs, linux), true)
LLVM_OS := pc-linux-gnu
Expand Down Expand Up @@ -128,8 +125,9 @@ ifeq ($(HSDIS_BACKEND), binutils)
CFLAGS_WARNINGS_ARE_ERRORS := -Werror
SHARED_LIBRARY_FLAGS := -shared

HSDIS_TOOLCHAIN_CFLAGS :=
HSDIS_TOOLCHAIN_LDFLAGS := -L$(MINGW_GCC_LIB_PATH) -L$(MINGW_SYSROOT_LIB_PATH)
HSDIS_TOOLCHAIN_DEFAULT_CFLAGS := false
HSDIS_TOOLCHAIN_DEFAULT_LDFLAGS := false
HSDIS_LDFLAGS += -L$(MINGW_GCC_LIB_PATH) -L$(MINGW_SYSROOT_LIB_PATH)
MINGW_DLLCRT := $(MINGW_SYSROOT_LIB_PATH)/dllcrt2.o
HSDIS_TOOLCHAIN_LIBS := $(MINGW_DLLCRT) -lmingw32 -lgcc -lgcc_eh -lmoldname \
-lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32
Expand All @@ -147,8 +145,12 @@ $(eval $(call SetupJdkLibrary, BUILD_HSDIS, \
OBJECT_DIR := $(HSDIS_OUTPUT_DIR), \
DISABLED_WARNINGS_gcc := undef format-nonliteral sign-compare, \
DISABLED_WARNINGS_clang := undef format-nonliteral, \
CFLAGS := $(HSDIS_TOOLCHAIN_CFLAGS) $(HSDIS_CFLAGS), \
LDFLAGS := $(HSDIS_TOOLCHAIN_LDFLAGS) $(HSDIS_LDFLAGS) $(SHARED_LIBRARY_FLAGS), \
DEFAULT_CFLAGS := $(HSDIS_TOOLCHAIN_DEFAULT_CFLAGS), \
CFLAGS := $(HSDIS_CFLAGS), \
CXXFLAGS := $(HSDIS_CFLAGS), \
LD_SET_ORIGIN := false, \
DEFAULT_LDFLAGS := $(HSDIS_TOOLCHAIN_DEFAULT_LDFLAGS), \
LDFLAGS := $(HSDIS_LDFLAGS) $(SHARED_LIBRARY_FLAGS), \
LIBS := $(HSDIS_LIBS) $(HSDIS_TOOLCHAIN_LIBS), \
))

Expand Down
8 changes: 8 additions & 0 deletions make/Images.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ define CreateCDSArchive
$1_$2_$3_CDS_ARCHIVE := lib/$1/classes$2$3.jsa
endif

ifneq ($(COMPARE_BUILD), )
DEBUG_CDS_ARCHIVE := true
endif

ifeq ($(DEBUG_CDS_ARCHIVE), true)
$1_$2_CDS_DUMP_FLAGS += -Xlog:cds+map*=trace:file=$$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE).cdsmap:none:filesize=0
endif

$$(eval $$(call SetupExecute, $1_$2_$3_gen_cds_archive_jdk, \
WARN := Creating CDS$$($1_$2_$3_DUMP_TYPE) archive for jdk image for $1, \
INFO := Using CDS flags for $1: $$($1_$2_$3_CDS_DUMP_FLAGS), \
Expand Down
4 changes: 2 additions & 2 deletions make/InitSupport.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,10 @@ else # $(HAS_SPEC)=true
# Compare first and second build. Ignore any error code from compare.sh.
$(ECHO) "Comparing between comparison rebuild (this/new) and baseline (other/old)"
$(if $(COMPARE_BUILD_COMP_DIR), \
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh -vv $(COMPARE_BUILD_COMP_OPTS) \
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh --diffs $(COMPARE_BUILD_COMP_OPTS) \
-2dirs $(COMPARE_BUILD_OUTPUTDIR)/$(COMPARE_BUILD_COMP_DIR) \
$(OUTPUTDIR)/$(COMPARE_BUILD_COMP_DIR) $(COMPARE_BUILD_IGNORE_RESULT)), \
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh -vv $(COMPARE_BUILD_COMP_OPTS) \
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh --diffs $(COMPARE_BUILD_COMP_OPTS) \
-o $(OUTPUTDIR) $(COMPARE_BUILD_IGNORE_RESULT)) \
)
endef
Expand Down
33 changes: 9 additions & 24 deletions make/Main.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -268,42 +268,22 @@ $(eval $(call SetupTarget, hotspot-ide-project, \

$(eval $(call SetupTarget, eclipse-java-env, \
MAKEFILE := ide/eclipse/CreateWorkspace, \
ARGS := --always-make WORKSPACE=java SHARED=false, \
ARGS := --always-make WORKSPACE=java, \
))

$(eval $(call SetupTarget, eclipse-hotspot-env, \
MAKEFILE := ide/eclipse/CreateWorkspace, \
ARGS := --always-make WORKSPACE=hotspot SHARED=false, \
ARGS := --always-make WORKSPACE=hotspot, \
))

$(eval $(call SetupTarget, eclipse-native-env, \
MAKEFILE := ide/eclipse/CreateWorkspace, \
ARGS := --always-make WORKSPACE=native SHARED=false, \
ARGS := --always-make WORKSPACE=native, \
))

$(eval $(call SetupTarget, eclipse-mixed-env, \
MAKEFILE := ide/eclipse/CreateWorkspace, \
ARGS := --always-make SHARED=false, \
))

$(eval $(call SetupTarget, eclipse-shared-java-env, \
MAKEFILE := ide/eclipse/CreateWorkspace, \
ARGS := --always-make WORKSPACE=java SHARED=true, \
))

$(eval $(call SetupTarget, eclipse-shared-hotspot-env, \
MAKEFILE := ide/eclipse/CreateWorkspace, \
ARGS := --always-make WORKSPACE=hotspot SHARED=true, \
))

$(eval $(call SetupTarget, eclipse-shared-native-env, \
MAKEFILE := ide/eclipse/CreateWorkspace, \
ARGS := --always-make WORKSPACE=native SHARED=true, \
))

$(eval $(call SetupTarget, eclipse-shared-mixed-env, \
MAKEFILE := ide/eclipse/CreateWorkspace, \
ARGS := --always-make SHARED=true, \
ARGS := --always-make, \
))

ALL_TARGETS += $(HOTSPOT_VARIANT_TARGETS) $(HOTSPOT_VARIANT_GENSRC_TARGETS) \
Expand Down Expand Up @@ -951,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: 3 additions & 1 deletion make/autoconf/compare.sh.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 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 @@ -45,11 +45,13 @@ export CP="@CP@"
export CUT="@CUT@"
export DIFF="@DIFF@"
export DUMPBIN="@DUMPBIN@"
export ECHO="@ECHO@"
export EXPR="@EXPR@"
export FILE="@FILE@"
export FIND="@FIND@"
export GREP="@GREP@"
export GUNZIP="@GUNZIP@"
export HEAD="@HEAD@"
export LDD="@LDD@"
export LN="@LN@"
export MKDIR="@MKDIR@"
Expand Down
3 changes: 2 additions & 1 deletion make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
if test "x$TOOLCHAIN_TYPE" = xgcc; then
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fstack-protector"
TOOLCHAIN_CFLAGS_JDK="-pipe -fstack-protector"
TOOLCHAIN_CFLAGS_JDK="-fvisibility=hidden -pipe -fstack-protector"
# reduce lib size on linux in link step, this needs also special compile flags
# do this on s390x also for libjvm (where serviceability agent is not supported)
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
Expand Down Expand Up @@ -572,6 +572,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
TOOLCHAIN_CFLAGS_JDK="-pipe"
TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX
fi
TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -fvisibility=hidden"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
# The -utf-8 option sets source and execution character sets to UTF-8 to enable correct
Expand Down
Loading

0 comments on commit 8c0dc18

Please sign in to comment.