Skip to content

Commit

Permalink
Merge branch 'master' into 8323624
Browse files Browse the repository at this point in the history
  • Loading branch information
wangweij committed Mar 29, 2024
2 parents 5ec3165 + 418deaf commit 0b2b49e
Show file tree
Hide file tree
Showing 3,844 changed files with 354,581 additions and 413,154 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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 @@ -15,7 +15,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 "merge"]
Expand Down
18 changes: 9 additions & 9 deletions doc/building.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ <h1 class="title">Building the JDK</h1>
<li><a href="#apple-xcode" id="toc-apple-xcode">Apple Xcode</a></li>
<li><a href="#microsoft-visual-studio"
id="toc-microsoft-visual-studio">Microsoft Visual Studio</a></li>
<li><a href="#ibm-xl-cc" id="toc-ibm-xl-cc">IBM XL C/C++</a></li>
<li><a href="#ibm-open-xl-cc" id="toc-ibm-open-xl-cc">IBM Open XL
C/C++</a></li>
</ul></li>
<li><a href="#boot-jdk-requirements" id="toc-boot-jdk-requirements">Boot
JDK Requirements</a>
Expand Down Expand Up @@ -562,7 +563,7 @@ <h2 id="native-compiler-toolchain-requirements">Native Compiler
</tr>
<tr class="odd">
<td>AIX</td>
<td>IBM XL C/C++</td>
<td>IBM Open XL C/C++</td>
</tr>
<tr class="even">
<td>Windows</td>
Expand Down Expand Up @@ -607,12 +608,12 @@ <h3 id="gcc">gcc</h3>
13.2 or newer.</p>
<p>In general, any version between these two should be usable.</p>
<h3 id="clang">clang</h3>
<p>The minimum accepted version of clang is 3.5. Older versions will not
<p>The minimum accepted version of clang is 13. Older versions will not
be accepted by <code>configure</code>.</p>
<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 Expand Up @@ -673,11 +674,10 @@ <h3 id="microsoft-visual-studio">Microsoft Visual Studio</h3>
version number accordingly. If you have not installed the
<code>BuildTools</code>, but e.g. <code>Professional</code>, adjust the
product ID accordingly.</p>
<h3 id="ibm-xl-cc">IBM XL C/C++</h3>
<p>Please consult the AIX section of the <a
href="https://wiki.openjdk.org/display/Build/Supported+Build+Platforms">Supported
Build Platforms</a> OpenJDK Build Wiki page for details about which
versions of XLC are supported.</p>
<h3 id="ibm-open-xl-cc">IBM Open XL C/C++</h3>
<p>The minimum accepted version of Open XL is 17.1.1.4. This is in
essence clang 15, and will be treated as such by the OpenJDK build
system.</p>
<h2 id="boot-jdk-requirements">Boot JDK Requirements</h2>
<p>Paradoxically, building the JDK requires a pre-existing JDK. This is
called the "boot JDK". The boot JDK does not, however, have to be a JDK
Expand Down
13 changes: 6 additions & 7 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ one-to-one correlation between target operating system and toolchain.
| ------------------ | ------------------------- |
| Linux | gcc, clang |
| macOS | Apple Xcode (using clang) |
| AIX | IBM XL C/C++ |
| AIX | IBM Open XL C/C++ |
| Windows | Microsoft Visual Studio |

Please see the individual sections on the toolchains for version
Expand Down Expand Up @@ -413,14 +413,14 @@ In general, any version between these two should be usable.

### clang

The minimum accepted version of clang is 3.5. Older versions will not be
The minimum accepted version of clang is 13. Older versions will not be
accepted by `configure`.

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 Expand Up @@ -487,11 +487,10 @@ that the " characters are essential)
accordingly. If you have not installed the `BuildTools`, but e.g.
`Professional`, adjust the product ID accordingly.

### IBM XL C/C++
### IBM Open XL C/C++

Please consult the AIX section of the [Supported Build Platforms](
https://wiki.openjdk.org/display/Build/Supported+Build+Platforms) OpenJDK Build
Wiki page for details about which versions of XLC are supported.
The minimum accepted version of Open XL is 17.1.1.4. This is in essence clang
15, and will be treated as such by the OpenJDK build system.

## Boot JDK Requirements

Expand Down
13 changes: 8 additions & 5 deletions doc/hotspot-style.html
Original file line number Diff line number Diff line change
Expand Up @@ -748,12 +748,15 @@ <h3 id="thread_local">thread_local</h3>
href="https://bugs.openjdk.org/browse/JDK-8282469">JDK-8282469</a> for
further discussion.</p>
<h3 id="nullptr">nullptr</h3>
<p>Prefer <code>nullptr</code> (<a
<p>Use <code>nullptr</code> (<a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf">n2431</a>)
to <code>NULL</code>. Don't use (constexpr or literal) 0 for
pointers.</p>
<p>For historical reasons there are widespread uses of both
<code>NULL</code> and of integer 0 as a pointer value.</p>
rather than <code>NULL</code>. See the paper for reasons to avoid
<code>NULL</code>.</p>
<p>Don't use (constant expression or literal) 0 for pointers. Note that
C++14 removed non-literal 0 constants from <em>null pointer
constants</em>, though some compilers continue to treat them as such.
For historical reasons there may be lingering uses of 0 as a
pointer.</p>
<h3 id="atomic">&lt;atomic&gt;</h3>
<p>Do not use facilities provided by the <code>&lt;atomic&gt;</code>
header (<a
Expand Down
10 changes: 6 additions & 4 deletions doc/hotspot-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -725,12 +725,14 @@ for further discussion.

### nullptr

Prefer `nullptr`
Use `nullptr`
([n2431](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf))
to `NULL`. Don't use (constexpr or literal) 0 for pointers.
rather than `NULL`. See the paper for reasons to avoid `NULL`.

For historical reasons there are widespread uses of both `NULL` and of
integer 0 as a pointer value.
Don't use (constant expression or literal) 0 for pointers. Note that C++14
removed non-literal 0 constants from _null pointer constants_, though some
compilers continue to treat them as such. For historical reasons there may be
lingering uses of 0 as a pointer.

### &lt;atomic&gt;

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
6 changes: 3 additions & 3 deletions make/Global.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ 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 $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness, use 'help' to list)
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness, use 'help' to list)
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness, use 'help' to list)
$(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)
$(info $(_) TEST_OPTS="OPT1=x;..." # Generic control of all test harnesses)
$(info $(_) TEST_VM_OPTS="ARG ..." # Same as setting TEST_OPTS to VM_OPTIONS="ARG ...")
$(info )
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
Loading

0 comments on commit 0b2b49e

Please sign in to comment.