Skip to content

Commit

Permalink
Merge branch 'master' into JDK-8318913
Browse files Browse the repository at this point in the history
  • Loading branch information
lahodaj committed Oct 27, 2023
2 parents 9de10d1 + 667cca9 commit 159949a
Show file tree
Hide file tree
Showing 4,918 changed files with 134,640 additions and 83,351 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/actions/get-gtest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runs:
var: GTEST_VERSION

- name: 'Checkout GTest source'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: google/googletest
ref: 'v${{ steps.version.outputs.value }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/get-jtreg/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ runs:
key: jtreg-${{ steps.version.outputs.value }}

- name: 'Checkout the JTReg source'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: openjdk/jtreg
ref: jtreg-${{ steps.version.outputs.value }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:

steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Get the BootJDK'
id: bootjdk
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:

steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Get the BootJDK'
id: bootjdk
Expand Down
4 changes: 2 additions & 2 deletions .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 All @@ -68,7 +68,7 @@ jobs:

steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Get the BootJDK'
id: bootjdk
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:

steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Get MSYS2'
uses: ./.github/actions/get-msys2
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
6 changes: 3 additions & 3 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 @@ -105,7 +105,7 @@ jobs:

steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Get MSYS2'
uses: ./.github/actions/get-msys2
Expand All @@ -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
121 changes: 77 additions & 44 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 Expand Up @@ -820,11 +819,11 @@ <h2 id="running-configure">Running Configure</h2>
<p>Some command line examples:</p>
<ul>
<li><p>Create a 32-bit build for Windows with FreeType2 in
<code>C:\freetype-i586</code>:
<code>bash configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32</code></p></li>
<code>C:\freetype-i586</code>:</p>
<pre><code>bash configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32</code></pre></li>
<li><p>Create a debug build with the <code>server</code> JVM and DTrace
enabled:
<code>bash configure --enable-debug --with-jvm-variants=server --enable-dtrace</code></p></li>
enabled:</p>
<pre><code>bash configure --enable-debug --with-jvm-variants=server --enable-dtrace</code></pre></li>
</ul>
<h3 id="common-configure-arguments">Common Configure Arguments</h3>
<p>Here follows some of the most common and important
Expand Down Expand Up @@ -1332,14 +1331,12 @@ <h4 id="alsa-1">ALSA</h4>
<code>libasound2-dev</code> packages for your <em>target</em> system.
Download them to /tmp.</p></li>
<li><p>Install the libraries into the cross-compilation toolchain. For
instance:</p></li>
</ul>
instance:</p>
<pre><code>cd /tools/gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux/arm-linux-gnueabihf/libc
dpkg-deb -x /tmp/libasound2_1.0.25-4_armhf.deb .
dpkg-deb -x /tmp/libasound2-dev_1.0.25-4_armhf.deb .</code></pre>
<ul>
<li>If alsa is not properly detected by <code>configure</code>, you can
point it out by <code>--with-alsa</code>.</li>
dpkg-deb -x /tmp/libasound2-dev_1.0.25-4_armhf.deb .</code></pre></li>
<li><p>If alsa is not properly detected by <code>configure</code>, you
can point it out by <code>--with-alsa</code>.</p></li>
</ul>
<h4 id="x11-1">X11</h4>
<p>You will need X11 libraries suitable for your <em>target</em> system.
Expand Down Expand Up @@ -1373,21 +1370,18 @@ <h4 id="x11-1">X11</h4>
</ul></li>
<li><p>Install the libraries into the cross-compilation toolchain. For
instance:</p>
<pre><code> cd /tools/gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux/arm-linux-gnueabihf/libc/usr
mkdir X11R6
cd X11R6
for deb in /tmp/target-x11/*.deb ; do dpkg-deb -x $deb . ; done
mv usr/* .
cd lib
cp arm-linux-gnueabihf/* .
```

You can ignore the following messages. These libraries are not needed to
successfully complete a full JDK build.</code></pre>
<p>cp: cannot stat
<code>arm-linux-gnueabihf/libICE.so': No such file or directory cp: cannot stat</code>arm-linux-gnueabihf/libSM.so':
No such file or directory cp: cannot stat
`arm-linux-gnueabihf/libXt.so': No such file or directory ```</p></li>
<pre><code>cd /tools/gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux/arm-linux-gnueabihf/libc/usr
mkdir X11R6
cd X11R6
for deb in /tmp/target-x11/*.deb ; do dpkg-deb -x $deb . ; done
mv usr/* .
cd lib
cp arm-linux-gnueabihf/* .</code></pre>
<p>You can ignore the following messages. These libraries are not needed
to successfully complete a full JDK build.</p>
<pre><code>cp: cannot stat `arm-linux-gnueabihf/libICE.so&#39;: No such file or directory
cp: cannot stat `arm-linux-gnueabihf/libSM.so&#39;: No such file or directory
cp: cannot stat `arm-linux-gnueabihf/libXt.so&#39;: No such file or directory</code></pre></li>
<li><p>If the X11 libraries are not properly detected by
<code>configure</code>, you can point them out by
<code>--with-x</code>.</p></li>
Expand All @@ -1405,17 +1399,41 @@ <h3 id="cross-compiling-with-debian-sysroots">Cross compiling with
<p>For example, cross-compiling to AArch64 from x86_64 could be done
like this:</p>
<ul>
<li><p>Install cross-compiler on the <em>build</em> system:
<code>apt install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu</code></p></li>
<li><p>Install cross-compiler on the <em>build</em> system:</p>
<pre><code>apt install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu</code></pre></li>
<li><p>Create chroot on the <em>build</em> system, configuring it for
<em>target</em> system:
<code>sudo debootstrap \ --arch=arm64 \ --verbose \ --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev,libffi-dev \ --resolve-deps \ buster \ ~/sysroot-arm64 \ http://httpredir.debian.org/debian/ # If the target architecture is `riscv64`, # the path should be `debian-ports` instead of `debian`.</code></p></li>
<em>target</em> system:</p>
<pre><code>sudo debootstrap \
--arch=arm64 \
--verbose \
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev,libffi-dev \
--resolve-deps \
buster \
~/sysroot-arm64 \
http://httpredir.debian.org/debian/
# If the target architecture is `riscv64`,
# the path should be `debian-ports` instead of `debian`.</code></pre></li>
<li><p>To create a Ubuntu-based chroot:</p>
<pre><code>sudo debootstrap \
--arch=arm64 \
--verbose \
--components=main,universe \
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev,libffi-dev \
--resolve-deps \
jammy \
~/sysroot-arm64 \
http://ports.ubuntu.com/ubuntu-ports/
# symlinks is in the universe repository</code></pre></li>
<li><p>Make sure the symlinks inside the newly created chroot point to
proper locations:
<code>sudo chroot ~/sysroot-arm64 symlinks -cr .</code></p></li>
proper locations:</p>
<pre><code>sudo chroot ~/sysroot-arm64 symlinks -cr .</code></pre></li>
<li><p>Configure and build with newly created chroot as
sysroot/toolchain-path:
<code>sh ./configure \ --openjdk-target=aarch64-linux-gnu \ --with-sysroot=~/sysroot-arm64 make images ls build/linux-aarch64-server-release/</code></p></li>
sysroot/toolchain-path:</p>
<pre><code>sh ./configure \
--openjdk-target=aarch64-linux-gnu \
--with-sysroot=~/sysroot-arm64
make images
ls build/linux-aarch64-server-release/</code></pre></li>
</ul>
<p>The build does not create new files in that chroot, so it can be
reused for multiple builds without additional cleanup.</p>
Expand Down Expand Up @@ -1567,12 +1585,27 @@ <h3 id="building-for-risc-v">Building for RISC-V</h3>
placeholder <code>&lt;toolchain-installed-path&gt;</code> shown below is
the path where you want to install the toolchain.</p>
<ul>
<li><p>Install the RISC-V GNU compiler toolchain:
<code>git clone --recursive https://github.com/riscv-collab/riscv-gnu-toolchain cd riscv-gnu-toolchain ./configure --prefix=&lt;toolchain-installed-path&gt; make linux export PATH=&lt;toolchain-installed-path&gt;/bin:$PATH</code></p></li>
<li><p>Cross-compile all the required libraries:
<code># An example for libffi git clone https://github.com/libffi/libffi cd libffi ./configure --host=riscv64-unknown-linux-gnu --prefix=&lt;toolchain-installed-path&gt;/sysroot/usr make make install</code></p></li>
<li><p>Configure and build OpenJDK:
<code>bash configure \ --with-boot-jdk=$BOOT_JDK \ --openjdk-target=riscv64-linux-gnu \ --with-sysroot=&lt;toolchain-installed-path&gt;/sysroot \ --with-toolchain-path=&lt;toolchain-installed-path&gt;/bin \ --with-extra-path=&lt;toolchain-installed-path&gt;/bin make images</code></p></li>
<li><p>Install the RISC-V GNU compiler toolchain:</p>
<pre><code>git clone --recursive https://github.com/riscv-collab/riscv-gnu-toolchain
cd riscv-gnu-toolchain
./configure --prefix=&lt;toolchain-installed-path&gt;
make linux
export PATH=&lt;toolchain-installed-path&gt;/bin:$PATH</code></pre></li>
<li><p>Cross-compile all the required libraries:</p>
<pre><code># An example for libffi
git clone https://github.com/libffi/libffi
cd libffi
./configure --host=riscv64-unknown-linux-gnu --prefix=&lt;toolchain-installed-path&gt;/sysroot/usr
make
make install</code></pre></li>
<li><p>Configure and build OpenJDK:</p>
<pre><code>bash configure \
--with-boot-jdk=$BOOT_JDK \
--openjdk-target=riscv64-linux-gnu \
--with-sysroot=&lt;toolchain-installed-path&gt;/sysroot \
--with-toolchain-path=&lt;toolchain-installed-path&gt;/bin \
--with-extra-path=&lt;toolchain-installed-path&gt;/bin
make images</code></pre></li>
</ul>
<h3 id="building-for-musl">Building for musl</h3>
<p>Just like it's possible to cross-compile for a different CPU, it's
Expand Down
Loading

0 comments on commit 159949a

Please sign in to comment.