Skip to content

Commit c101669

Browse files
committed
Merge
2 parents f0cc6f9 + b9bdbe9 commit c101669

File tree

482 files changed

+8423
-7167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

482 files changed

+8423
-7167
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ NashornProfile.txt
2121
/.project
2222
/.classpath
2323
/.cproject
24+
/compile_commands.json
25+
/.cache

doc/building.html

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ <h1 class="title">Building the JDK</h1>
134134
Debian sysroots</a></li>
135135
<li><a href="#building-for-armaarch64"
136136
id="toc-building-for-armaarch64">Building for ARM/aarch64</a></li>
137+
<li><a href="#building-for-risc-v" id="toc-building-for-risc-v">Building
138+
for RISC-V</a></li>
137139
<li><a href="#building-for-musl" id="toc-building-for-musl">Building for
138140
musl</a></li>
139141
<li><a href="#verifying-the-build"
@@ -1376,10 +1378,10 @@ <h3 id="cross-compiling-with-debian-sysroots">Cross compiling with
13761378
Debian sysroots</h3>
13771379
<p>Fortunately, you can create sysroots for foreign architectures with
13781380
tools provided by your OS. On Debian/Ubuntu systems, one could use
1379-
<code>qemu-deboostrap</code> to create the <em>target</em> system
1380-
chroot, which would have the native libraries and headers specific to
1381-
that <em>target</em> system. After that, we can use the cross-compiler
1382-
on the <em>build</em> system, pointing into chroot to get the build
1381+
<code>debootstrap</code> to create the <em>target</em> system chroot,
1382+
which would have the native libraries and headers specific to that
1383+
<em>target</em> system. After that, we can use the cross-compiler on the
1384+
<em>build</em> system, pointing into chroot to get the build
13831385
dependencies right. This allows building for foreign architectures with
13841386
native compilation speed.</p>
13851387
<p>For example, cross-compiling to AArch64 from x86_64 could be done
@@ -1389,7 +1391,7 @@ <h3 id="cross-compiling-with-debian-sysroots">Cross compiling with
13891391
<code>apt install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu</code></p></li>
13901392
<li><p>Create chroot on the <em>build</em> system, configuring it for
13911393
<em>target</em> system:
1392-
<code>sudo qemu-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/</code></p></li>
1394+
<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>
13931395
<li><p>Make sure the symlinks inside the newly created chroot point to
13941396
proper locations:
13951397
<code>sudo chroot ~/sysroot-arm64 symlinks -cr .</code></p></li>
@@ -1516,6 +1518,13 @@ <h3 id="cross-compiling-with-debian-sysroots">Cross compiling with
15161518
<td style="text-align: left;">sh4-linux-gnu</td>
15171519
<td>zero</td>
15181520
</tr>
1521+
<tr class="even">
1522+
<td style="text-align: left;">riscv64</td>
1523+
<td style="text-align: left;">sid</td>
1524+
<td style="text-align: left;">riscv64</td>
1525+
<td style="text-align: left;">riscv64-linux-gnu</td>
1526+
<td>(all)</td>
1527+
</tr>
15191528
</tbody>
15201529
</table>
15211530
<h3 id="building-for-armaarch64">Building for ARM/aarch64</h3>
@@ -1525,6 +1534,21 @@ <h3 id="building-for-armaarch64">Building for ARM/aarch64</h3>
15251534
arm-vfp-sflt, arm-vfp-hflt, arm-sflt, armv5-vfp-sflt, armv6-vfp-hflt.
15261535
Note that soft-float ABIs are no longer properly supported by the
15271536
JDK.</p>
1537+
<h3 id="building-for-risc-v">Building for RISC-V</h3>
1538+
<p>The RISC-V community provides a basic <a
1539+
href="https://github.com/riscv-collab/riscv-gnu-toolchain">GNU compiler
1540+
toolchain</a>, but the <a href="#External-Library-Requirements">external
1541+
libraries</a> required by OpenJDK complicate the building process. The
1542+
placeholder <code>&lt;toolchain-installed-path&gt;</code> shown below is
1543+
the path where you want to install the toolchain.</p>
1544+
<ul>
1545+
<li><p>Install the RISC-V GNU compiler toolchain:
1546+
<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>
1547+
<li><p>Cross-compile all the required libraries:
1548+
<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>
1549+
<li><p>Configure and build OpenJDK:
1550+
<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>
1551+
</ul>
15281552
<h3 id="building-for-musl">Building for musl</h3>
15291553
<p>Just like it's possible to cross-compile for a different CPU, it's
15301554
possible to cross-compile for musl libc on a glibc-based <em>build</em>

doc/building.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ Note that X11 is needed even if you only want to build a headless JDK.
11471147
### Cross compiling with Debian sysroots
11481148
11491149
Fortunately, you can create sysroots for foreign architectures with tools
1150-
provided by your OS. On Debian/Ubuntu systems, one could use `qemu-deboostrap` to
1150+
provided by your OS. On Debian/Ubuntu systems, one could use `debootstrap` to
11511151
create the *target* system chroot, which would have the native libraries and headers
11521152
specific to that *target* system. After that, we can use the cross-compiler on the *build*
11531153
system, pointing into chroot to get the build dependencies right. This allows building
@@ -1162,14 +1162,16 @@ For example, cross-compiling to AArch64 from x86_64 could be done like this:
11621162
11631163
* Create chroot on the *build* system, configuring it for *target* system:
11641164
```
1165-
sudo qemu-debootstrap \
1165+
sudo debootstrap \
11661166
--arch=arm64 \
11671167
--verbose \
11681168
--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 \
11691169
--resolve-deps \
11701170
buster \
11711171
~/sysroot-arm64 \
11721172
http://httpredir.debian.org/debian/
1173+
# If the target architecture is `riscv64`,
1174+
# the path should be `debian-ports` instead of `debian`.
11731175
```
11741176
11751177
* Make sure the symlinks inside the newly created chroot point to proper locations:
@@ -1217,6 +1219,7 @@ Architectures that are known to successfully cross-compile like this are:
12171219
m68k sid m68k m68k-linux-gnu zero
12181220
alpha sid alpha alpha-linux-gnu zero
12191221
sh4 sid sh4 sh4-linux-gnu zero
1222+
riscv64 sid riscv64 riscv64-linux-gnu (all)
12201223
12211224
### Building for ARM/aarch64
12221225
@@ -1226,6 +1229,44 @@ available using `--with-abi-profile`: arm-vfp-sflt, arm-vfp-hflt, arm-sflt,
12261229
armv5-vfp-sflt, armv6-vfp-hflt. Note that soft-float ABIs are no longer
12271230
properly supported by the JDK.
12281231
1232+
### Building for RISC-V
1233+
1234+
The RISC-V community provides a basic
1235+
[GNU compiler toolchain](https://github.com/riscv-collab/riscv-gnu-toolchain),
1236+
but the [external libraries](#External-Library-Requirements) required by OpenJDK
1237+
complicate the building process. The placeholder `<toolchain-installed-path>`
1238+
shown below is the path where you want to install the toolchain.
1239+
1240+
* Install the RISC-V GNU compiler toolchain:
1241+
```
1242+
git clone --recursive https://github.com/riscv-collab/riscv-gnu-toolchain
1243+
cd riscv-gnu-toolchain
1244+
./configure --prefix=<toolchain-installed-path>
1245+
make linux
1246+
export PATH=<toolchain-installed-path>/bin:$PATH
1247+
```
1248+
1249+
* Cross-compile all the required libraries:
1250+
```
1251+
# An example for libffi
1252+
git clone https://github.com/libffi/libffi
1253+
cd libffi
1254+
./configure --host=riscv64-unknown-linux-gnu --prefix=<toolchain-installed-path>/sysroot/usr
1255+
make
1256+
make install
1257+
```
1258+
1259+
* Configure and build OpenJDK:
1260+
```
1261+
bash configure \
1262+
--with-boot-jdk=$BOOT_JDK \
1263+
--openjdk-target=riscv64-linux-gnu \
1264+
--with-sysroot=<toolchain-installed-path>/sysroot \
1265+
--with-toolchain-path=<toolchain-installed-path>/bin \
1266+
--with-extra-path=<toolchain-installed-path>/bin
1267+
make images
1268+
```
1269+
12291270
### Building for musl
12301271
12311272
Just like it's possible to cross-compile for a different CPU, it's possible to

src/demo/share/nbproject/jfc/SwingApplet/build.properties

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/demo/share/nbproject/jfc/SwingApplet/build.xml

Lines changed: 0 additions & 100 deletions
This file was deleted.

src/demo/share/nbproject/jfc/SwingApplet/nbproject/file-targets.xml

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)