Skip to content

Commit 85841fb

Browse files
committed
Update readme and actions
1 parent 5c8e859 commit 85841fb

File tree

6,775 files changed

+626564
-107880
lines changed

Some content is hidden

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

6,775 files changed

+626564
-107880
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* -text

.github/workflows/submit.yml

+1,517
Large diffs are not rendered by default.

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/dist/
33
/.idea/
44
/.vscode/
5+
/nbproject/
56
nbproject/private/
67
/webrev
78
/.src-rev
@@ -14,3 +15,4 @@ test/nashorn/lib
1415
NashornProfile.txt
1516
**/JTreport/**
1617
**/JTwork/**
18+
/src/utils/LogCompilation/target/

.hgtags

+1
Original file line numberDiff line numberDiff line change
@@ -661,3 +661,4 @@ e3f940bd3c8fcdf4ca704c6eb1ac745d155859d5 jdk-15+36
661661
5c18d696c7ce724ca36df13933aa53f50e12b9e0 jdk-16+11
662662
fc8e62b399bd93d06e8d13dc3b384c450e853dcd jdk-16+12
663663
fd07cdb26fc70243ef23d688b545514f4ddf1c2b jdk-16+13
664+
36b29df125dc88f11657ce93b4998aa9ff5f5d41 jdk-16+14

.jcheck/conf

+23-26
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,34 @@
1-
;
2-
; Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
3-
; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4-
;
5-
; This code is free software; you can redistribute it and/or modify it
6-
; under the terms of the GNU General Public License version 2 only, as
7-
; published by the Free Software Foundation.
8-
;
9-
; This code is distributed in the hope that it will be useful, but WITHOUT
10-
; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11-
; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12-
; version 2 for more details (a copy is included in the LICENSE file that
13-
; accompanied this code).
14-
;
15-
; You should have received a copy of the GNU General Public License version
16-
; 2 along with this work; if not, write to the Free Software Foundation,
17-
; Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18-
;
19-
; Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20-
; or visit www.oracle.com if you need additional information or have any
21-
; questions.
22-
;
23-
241
[general]
252
project=jdk
26-
repository=playground
273
jbs=JDK
284

295
[checks]
30-
error=author,whitespace,executable
6+
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
7+
8+
[repository]
9+
tags=(?:jdk-(?:[1-9]([0-9]*)(?:\.(?:0|[1-9][0-9]*)){0,4})(?:\+(?:(?:[0-9]+))|(?:-ga)))|(?:jdk[4-9](?:u\d{1,3})?-(?:(?:b\d{2,3})|(?:ga)))|(?:hs\d\d(?:\.\d{1,2})?-b\d\d)
10+
branches=
3111

3212
[census]
3313
version=0
3414
domain=openjdk.org
3515

3616
[checks "whitespace"]
37-
files=.*\.java$|.*\.c$|.*\.h$|.*.\cpp$|.*\.hpp$
17+
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.gmk|.*\.m4|.*\.ac|Makefile
18+
ignore-tabs=.*\.gmk|Makefile
19+
20+
[checks "merge"]
21+
message=Merge
22+
23+
[checks "reviewers"]
24+
reviewers=1
25+
ignore=duke
26+
27+
[checks "committer"]
28+
role=committer
29+
30+
[checks "issues"]
31+
pattern=^([124-8][0-9]{6}): (\S.*)$
32+
33+
[checks "problemlists"]
34+
dirs=test/jdk|test/langtools|test/lib-test|test/hotspot/jtreg|test/jaxp

bin/idea.sh

+12-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,18 @@ for root in $MODULE_ROOTS; do
184184
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
185185
root=`wslpath -am $root`
186186
fi
187-
SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
187+
188+
VM_CI="jdk.internal.vm.ci/share/classes"
189+
VM_COMPILER="src/jdk.internal.vm.compiler/share/classes"
190+
if test "${root#*$VM_CI}" != "$root" || test "${root#*$VM_COMPILER}" != "$root"; then
191+
for subdir in "$root"/*; do
192+
if [ -d "$subdir" ]; then
193+
SOURCES=$SOURCES" $SOURCE_PREFIX""$subdir"/src"$SOURCE_POSTFIX"
194+
fi
195+
done
196+
else
197+
SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
198+
fi
188199
done
189200

190201
add_replacement "###SOURCE_ROOTS###" "$SOURCES"

doc/building.html

+44-17
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ <h1 class="title">Building the JDK</h1>
7878
<li><a href="#native-libraries">Native Libraries</a></li>
7979
<li><a href="#creating-and-using-sysroots-with-qemu-deboostrap">Creating And Using Sysroots With qemu-deboostrap</a></li>
8080
<li><a href="#building-for-armaarch64">Building for ARM/aarch64</a></li>
81+
<li><a href="#building-for-musl">Building for musl</a></li>
8182
<li><a href="#verifying-the-build">Verifying the Build</a></li>
8283
</ul></li>
8384
<li><a href="#build-performance">Build Performance</a><ul>
@@ -224,6 +225,8 @@ <h3 id="linux">Linux</h3>
224225
<pre><code>sudo apt-get install build-essential</code></pre>
225226
<p>For rpm-based distributions (Fedora, Red Hat, etc), try this:</p>
226227
<pre><code>sudo yum groupinstall &quot;Development Tools&quot;</code></pre>
228+
<p>For Alpine Linux, aside from basic tooling, install the GNU versions of some programs:</p>
229+
<pre><code>sudo apk add build-base bash grep zip</code></pre>
227230
<h3 id="aix">AIX</h3>
228231
<p>Please consult the AIX section of the <a href="https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms">Supported Build Platforms</a> OpenJDK Build Wiki page for details about which versions of AIX are supported.</p>
229232
<h2 id="native-compiler-toolchain-requirements">Native Compiler (Toolchain) Requirements</h2>
@@ -265,22 +268,22 @@ <h2 id="native-compiler-toolchain-requirements">Native Compiler (Toolchain) Requ
265268
<tbody>
266269
<tr class="odd">
267270
<td style="text-align: left;">Linux</td>
268-
<td style="text-align: left;">gcc 9.2.0</td>
271+
<td style="text-align: left;">gcc 10.2.0</td>
269272
</tr>
270273
<tr class="even">
271274
<td style="text-align: left;">macOS</td>
272275
<td style="text-align: left;">Apple Xcode 10.1 (using clang 10.0.0)</td>
273276
</tr>
274277
<tr class="odd">
275278
<td style="text-align: left;">Windows</td>
276-
<td style="text-align: left;">Microsoft Visual Studio 2019 update 16.5.3</td>
279+
<td style="text-align: left;">Microsoft Visual Studio 2019 update 16.7.2</td>
277280
</tr>
278281
</tbody>
279282
</table>
280283
<p>All compilers are expected to be able to compile to the C99 language standard, as some C99 features are used in the source code. Microsoft Visual Studio doesn't fully support C99 so in practice shared code is limited to using C99 features that it does support.</p>
281284
<h3 id="gcc">gcc</h3>
282285
<p>The minimum accepted version of gcc is 5.0. Older versions will generate a warning by <code>configure</code> and are unlikely to work.</p>
283-
<p>The JDK is currently known to be able to compile with at least version 9.2 of gcc.</p>
286+
<p>The JDK is currently known to be able to compile with at least version 10.2 of gcc.</p>
284287
<p>In general, any version between these two should be usable.</p>
285288
<h3 id="clang">clang</h3>
286289
<p>The minimum accepted version of clang is 3.5. Older versions will not be accepted by <code>configure</code>.</p>
@@ -313,34 +316,39 @@ <h3 id="freetype">FreeType</h3>
313316
<ul>
314317
<li>To install on an apt-based Linux, try running <code>sudo apt-get install libfreetype6-dev</code>.</li>
315318
<li>To install on an rpm-based Linux, try running <code>sudo yum install freetype-devel</code>.</li>
319+
<li>To install on Alpine Linux, try running <code>sudo apk add freetype-dev</code>.</li>
316320
</ul>
317321
<p>Use <code>--with-freetype-include=&lt;path&gt;</code> and <code>--with-freetype-lib=&lt;path&gt;</code> if <code>configure</code> does not automatically locate the platform FreeType files.</p>
318322
<h3 id="cups">CUPS</h3>
319323
<p>CUPS, <a href="http://www.cups.org">Common UNIX Printing System</a> header files are required on all platforms, except Windows. Often these files are provided by your operating system.</p>
320324
<ul>
321325
<li>To install on an apt-based Linux, try running <code>sudo apt-get install libcups2-dev</code>.</li>
322326
<li>To install on an rpm-based Linux, try running <code>sudo yum install cups-devel</code>.</li>
327+
<li>To install on Alpine Linux, try running <code>sudo apk add cups-dev</code>.</li>
323328
</ul>
324329
<p>Use <code>--with-cups=&lt;path&gt;</code> if <code>configure</code> does not properly locate your CUPS files.</p>
325330
<h3 id="x11">X11</h3>
326331
<p>Certain <a href="http://www.x.org/">X11</a> libraries and include files are required on Linux.</p>
327332
<ul>
328333
<li>To install on an apt-based Linux, try running <code>sudo apt-get install libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev</code>.</li>
329334
<li>To install on an rpm-based Linux, try running <code>sudo yum install libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel</code>.</li>
335+
<li>To install on Alpine Linux, try running <code>sudo apk add libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev</code>.</li>
330336
</ul>
331337
<p>Use <code>--with-x=&lt;path&gt;</code> if <code>configure</code> does not properly locate your X11 files.</p>
332338
<h3 id="alsa">ALSA</h3>
333339
<p>ALSA, <a href="https://www.alsa-project.org/">Advanced Linux Sound Architecture</a> is required on Linux. At least version 0.9.1 of ALSA is required.</p>
334340
<ul>
335341
<li>To install on an apt-based Linux, try running <code>sudo apt-get install libasound2-dev</code>.</li>
336342
<li>To install on an rpm-based Linux, try running <code>sudo yum install alsa-lib-devel</code>.</li>
343+
<li>To install on Alpine Linux, try running <code>sudo apk add alsa-lib-dev</code>.</li>
337344
</ul>
338345
<p>Use <code>--with-alsa=&lt;path&gt;</code> if <code>configure</code> does not properly locate your ALSA files.</p>
339346
<h3 id="libffi">libffi</h3>
340347
<p>libffi, the <a href="http://sourceware.org/libffi">Portable Foreign Function Interface Library</a> is required when building the Zero version of Hotspot.</p>
341348
<ul>
342349
<li>To install on an apt-based Linux, try running <code>sudo apt-get install libffi-dev</code>.</li>
343350
<li>To install on an rpm-based Linux, try running <code>sudo yum install libffi-devel</code>.</li>
351+
<li>To install on Alpine Linux, try running <code>sudo apk add libffi-dev</code>.</li>
344352
</ul>
345353
<p>Use <code>--with-libffi=&lt;path&gt;</code> if <code>configure</code> does not properly locate your libffi files.</p>
346354
<h2 id="build-tools-requirements">Build Tools Requirements</h2>
@@ -349,6 +357,7 @@ <h3 id="autoconf">Autoconf</h3>
349357
<ul>
350358
<li>To install on an apt-based Linux, try running <code>sudo apt-get install autoconf</code>.</li>
351359
<li>To install on an rpm-based Linux, try running <code>sudo yum install autoconf</code>.</li>
360+
<li>To install on Alpine Linux, try running <code>sudo apk add autoconf</code>.</li>
352361
<li>To install on macOS, try running <code>brew install autoconf</code>.</li>
353362
<li>To install on Windows, try running <code>&lt;path to Cygwin setup&gt;/setup-x86_64 -q -P autoconf</code>.</li>
354363
</ul>
@@ -620,21 +629,30 @@ <h3 id="creating-and-using-sysroots-with-qemu-deboostrap">Creating And Using Sys
620629
<p>Fortunately, you can create sysroots for foreign architectures with tools provided by your OS. On Debian/Ubuntu systems, one could use <code>qemu-deboostrap</code> to create the <em>target</em> system chroot, which would have the native libraries and headers specific to that <em>target</em> system. After that, we can use the cross-compiler on the <em>build</em> system, pointing into chroot to get the build dependencies right. This allows building for foreign architectures with native compilation speed.</p>
621630
<p>For example, cross-compiling to AArch64 from x86_64 could be done like this:</p>
622631
<ul>
623-
<li>Install cross-compiler on the <em>build</em> system:</li>
624-
</ul>
625-
<pre><code>apt install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu</code></pre>
626-
<ul>
627-
<li>Create chroot on the <em>build</em> system, configuring it for <em>target</em> system:</li>
628-
</ul>
629-
<pre><code>sudo qemu-debootstrap --arch=arm64 --verbose \
630-
--include=fakeroot,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng12-dev \
631-
--resolve-deps jessie /chroots/arm64 http://httpredir.debian.org/debian/</code></pre>
632-
<ul>
633-
<li>Configure and build with newly created chroot as sysroot/toolchain-path:</li>
634-
</ul>
635-
<pre><code>CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ sh ./configure --openjdk-target=aarch64-linux-gnu --with-sysroot=/chroots/arm64/ --with-toolchain-path=/chroots/arm64/
632+
<li><p>Install cross-compiler on the <em>build</em> system:</p>
633+
<pre><code>apt install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu</code></pre></li>
634+
<li><p>Create chroot on the <em>build</em> system, configuring it for <em>target</em> system:</p>
635+
<pre><code>sudo qemu-debootstrap \
636+
--arch=arm64 \
637+
--verbose \
638+
--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 \
639+
--resolve-deps \
640+
buster \
641+
~/sysroot-arm64 \
642+
http://httpredir.debian.org/debian/</code></pre></li>
643+
<li><p>Make sure the symlinks inside the newly created chroot point to proper locations:</p>
644+
<pre><code>sudo chroot ~/sysroot-arm64 symlinks -cr .</code></pre></li>
645+
<li><p>Configure and build with newly created chroot as sysroot/toolchain-path:</p>
646+
<pre><code>CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ sh ./configure \
647+
--openjdk-target=aarch64-linux-gnu \
648+
--with-sysroot=~/sysroot-arm64 \
649+
--with-toolchain-path=~/sysroot-arm64 \
650+
--with-freetype-lib=~/sysroot-arm64/usr/lib/aarch64-linux-gnu/ \
651+
--with-freetype-include=~/sysroot-arm64/usr/include/freetype2/ \
652+
--x-libraries=~/sysroot-arm64/usr/lib/aarch64-linux-gnu/
636653
make images
637-
ls build/linux-aarch64-normal-server-release/</code></pre>
654+
ls build/linux-aarch64-server-release/</code></pre></li>
655+
</ul>
638656
<p>The build does not create new files in that chroot, so it can be reused for multiple builds without additional cleanup.</p>
639657
<p>Architectures that are known to successfully cross-compile like this are:</p>
640658
<table>
@@ -688,6 +706,15 @@ <h3 id="creating-and-using-sysroots-with-qemu-deboostrap">Creating And Using Sys
688706
<p>Additional architectures might be supported by Debian/Ubuntu Ports.</p>
689707
<h3 id="building-for-armaarch64">Building for ARM/aarch64</h3>
690708
<p>A common cross-compilation target is the ARM CPU. When building for ARM, it is useful to set the ABI profile. A number of pre-defined ABI profiles are available using <code>--with-abi-profile</code>: arm-vfp-sflt, arm-vfp-hflt, arm-sflt, armv5-vfp-sflt, armv6-vfp-hflt. Note that soft-float ABIs are no longer properly supported by the JDK.</p>
709+
<h3 id="building-for-musl">Building for musl</h3>
710+
<p>Just like it's possible to cross-compile for a different CPU, it's possible to cross-compile for musl libc on a glibc-based <em>build</em> system. A devkit suitable for most target CPU architectures can be obtained from <a href="https://musl.cc">musl.cc</a>. After installing the required packages in the sysroot, configure the build with <code>--openjdk-target</code>:</p>
711+
<pre><code>sh ./configure --with-jvm-variants=server \
712+
--with-boot-jdk=$BOOT_JDK \
713+
--with-build-jdk=$BUILD_JDK \
714+
--openjdk-target=x86_64-unknown-linux-musl \
715+
--with-devkit=$DEVKIT \
716+
--with-sysroot=$SYSROOT</code></pre>
717+
<p>and run <code>make</code> normally.</p>
691718
<h3 id="verifying-the-build">Verifying the Build</h3>
692719
<p>The build will end up in a directory named like <code>build/linux-arm-normal-server-release</code>.</p>
693720
<p>Inside this build output directory, the <code>images/jdk</code> will contain the newly built JDK, for your <em>target</em> system.</p>

0 commit comments

Comments
 (0)