Skip to content

Commit

Permalink
Merge pull request #552 from dragonwell-project/wip_dragonwell_standa…
Browse files Browse the repository at this point in the history
…rd_squash_branch

Merge branch 'standard' into wip_dragonwell_standard_merge_branch
  • Loading branch information
Accelerator1996 authored May 9, 2023
2 parents 3178d1e + 3aa9fa9 commit b94533c
Show file tree
Hide file tree
Showing 578 changed files with 26,186 additions and 6,718 deletions.
2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
project=jdk-updates
jbs=JDK
version=11.0.18
version=11.0.19

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace
Expand Down
96 changes: 58 additions & 38 deletions doc/building.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
<!DOCTYPE html>
<html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>Building the JDK</title>
<style type="text/css">code{white-space: pre;}</style>
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css">
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
<style type="text/css">pre, code, tt { color: #1d6ae5; }</style>
</head>
<body>
<header>
<header id="title-block-header">
<h1 class="title">Building the JDK</h1>
</header>
<nav id="TOC">
Expand Down Expand Up @@ -67,6 +72,9 @@ <h1 class="title">Building the JDK</h1>
<li><a href="#make-control-variables">Make Control Variables</a></li>
</ul></li>
<li><a href="#running-tests">Running Tests</a></li>
<li><a href="#signing">Signing</a><ul>
<li><a href="#macos-1">macOS</a></li>
</ul></li>
<li><a href="#cross-compiling">Cross-compiling</a><ul>
<li><a href="#cross-compiling-the-easy-way-with-openjdk-devkits">Cross compiling the easy way with OpenJDK devkits</a></li>
<li><a href="#boot-jdk-and-build-jdk">Boot JDK and Build JDK</a></li>
Expand Down Expand Up @@ -234,57 +242,57 @@ <h2 id="native-compiler-toolchain-requirements">Native Compiler (Toolchain) Requ
<table>
<thead>
<tr class="header">
<th style="text-align: left;">Operating system</th>
<th style="text-align: left;">Supported toolchain</th>
<th>Operating system</th>
<th>Supported toolchain</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Linux</td>
<td style="text-align: left;">gcc, clang</td>
<td>Linux</td>
<td>gcc, clang</td>
</tr>
<tr class="even">
<td style="text-align: left;">macOS</td>
<td style="text-align: left;">Apple Xcode (using clang)</td>
<td>macOS</td>
<td>Apple Xcode (using clang)</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Solaris</td>
<td style="text-align: left;">Oracle Solaris Studio</td>
<td>Solaris</td>
<td>Oracle Solaris Studio</td>
</tr>
<tr class="even">
<td style="text-align: left;">AIX</td>
<td style="text-align: left;">IBM XL C/C++</td>
<td>AIX</td>
<td>IBM XL C/C++</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Windows</td>
<td style="text-align: left;">Microsoft Visual Studio</td>
<td>Windows</td>
<td>Microsoft Visual Studio</td>
</tr>
</tbody>
</table>
<p>Please see the individual sections on the toolchains for version recommendations. As a reference, these versions of the toolchains are used, at the time of writing, by Oracle for the daily builds of the JDK. It should be possible to compile the JDK with both older and newer versions, but the closer you stay to this list, the more likely you are to compile successfully without issues.</p>
<table>
<thead>
<tr class="header">
<th style="text-align: left;">Operating system</th>
<th style="text-align: left;">Toolchain version</th>
<th>Operating system</th>
<th>Toolchain version</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Linux</td>
<td style="text-align: left;">gcc 7.3.0</td>
<td>Linux</td>
<td>gcc 7.3.0</td>
</tr>
<tr class="even">
<td style="text-align: left;">macOS</td>
<td style="text-align: left;">Apple Xcode 9.4 (using clang 9.1.0)</td>
<td>macOS</td>
<td>Apple Xcode 9.4 (using clang 9.1.0)</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Solaris</td>
<td style="text-align: left;">Oracle Solaris Studio 12.4 (with compiler version 5.13)</td>
<td>Solaris</td>
<td>Oracle Solaris Studio 12.4 (with compiler version 5.13)</td>
</tr>
<tr class="even">
<td style="text-align: left;">Windows</td>
<td style="text-align: left;">Microsoft Visual Studio 2017 update 15.9.16</td>
<td>Windows</td>
<td>Microsoft Visual Studio 2017 update 15.9.16</td>
</tr>
</tbody>
</table>
Expand All @@ -297,9 +305,13 @@ <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>You will need the Xcode command lines developers tools to be able to build the JDK. (Actually, <em>only</em> the command lines tools are needed, not the IDE.) The simplest way to install these is to run:</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>
<pre><code>xcode-select --install</code></pre>
<p>It is advisable to keep an older version of Xcode for building the JDK when updating Xcode. This <a href="http://iosdevelopertips.com/xcode/install-multiple-versions-of-xcode.html">blog page</a> has good suggestions on managing multiple Xcode versions. To use a specific version of Xcode, use <code>xcode-select -s</code> before running <code>configure</code>, or use <code>--with-toolchain-path</code> to point to the version of Xcode to use, e.g. <code>configure --with-toolchain-path=/Applications/Xcode8.app/Contents/Developer/usr/bin</code></p>
<p>When updating Xcode, it is advisable to keep an older version for building the JDK. To use a specific version of Xcode you have multiple options:</p>
<ul>
<li>Use <code>xcode-select -s</code> before running <code>configure</code>, e.g. <code>xcode-select -s /Applications/Xcode13.1.app</code>. The drawback is that the setting is system wide and you may have to revert it after an OpenJDK build.</li>
<li>Use configure option <code>--with-xcode-path</code>, e.g. <code>configure --with-xcode-path=/Applications/Xcode13.1.app</code> This allows using a specific Xcode version for an OpenJDK build, independently of the active Xcode version by <code>xcode-select</code>.</li>
</ul>
<p>If you have recently (inadvertently) updated your OS and/or Xcode version, and the JDK can no longer be built, please see the section on <a href="#problems-with-the-build-environment">Problems with the Build Environment</a>, and <a href="#getting-help">Getting Help</a> to find out if there are any recent, non-merged patches available for this update.</p>
<h3 id="oracle-solaris-studio">Oracle Solaris Studio</h3>
<p>The minimum accepted version of the Solaris Studio compilers is 5.13 (corresponding to Solaris Studio 12.4). Older versions will not be accepted by configure.</p>
Expand Down Expand Up @@ -362,8 +374,8 @@ <h3 id="oracle-solaris-studio">Oracle Solaris Studio</h3>
<h3 id="microsoft-visual-studio">Microsoft Visual Studio</h3>
<p>The minimum accepted version of Visual Studio is 2010. Older versions will not be accepted by <code>configure</code>. The maximum accepted version of Visual Studio is 2019. Versions older than 2017 are unlikely to continue working for long.</p>
<p>If you have multiple versions of Visual Studio installed, <code>configure</code> will by default pick the latest. You can request a specific version to be used by setting <code>--with-toolchain-version</code>, e.g. <code>--with-toolchain-version=2015</code>.</p>
<p>If you have Visual Studio installed but <code>configure</code> fails to detect it, it may be because of <a href="#spaces-in-path">spaces in path</a>.</p>
<p>If you get <code>LINK: fatal error LNK1123: failure during conversion to COFF: file invalid</code> when building using Visual Studio 2010, you have encountered <a href="http://support.microsoft.com/kb/2757355">KB2757355</a>, a bug triggered by a specific installation order. However, the solution suggested by the KB article does not always resolve the problem. See <a href="https://stackoverflow.com/questions/10888391">this stackoverflow discussion</a> for other suggestions.</p>
<p>If you have Visual Studio installed but <code>configure</code> fails to detect it, it may be because of <a href="#spaces-in-path">spaces in path</a>.</p>
<h3 id="ibm-xl-cc">IBM XL C/C++</h3>
<p>The regular builds by SAP is using version 12.1, described as <code>IBM XL C/C++ for AIX, V12.1 (5765-J02, 5725-C72) Version: 12.01.0000.0017</code>.</p>
<p>See the <a href="http://cr.openjdk.java.net/~simonis/ppc-aix-port">OpenJDK PowerPC Port Status Page</a> for details.</p>
Expand Down Expand Up @@ -403,7 +415,7 @@ <h3 id="x11">X11</h3>
<ul>
<li>To install on an apt-based Linux, try running <code>sudo apt-get install libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev</code>.</li>
<li>To install on an rpm-based Linux, try running <code>sudo yum install libXtst-devel libXt-devel libXrender-devel libXi-devel</code>.</li>
<li>To install on Alpine Linux, try running <code>sudo apk add libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev</code>.</li>
<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>
<li>To install on Solaris, try running <code>pkg install x11/header/x11-protocols x11/library/libice x11/library/libpthread-stubs x11/library/libsm x11/library/libx11 x11/library/libxau x11/library/libxcb x11/library/libxdmcp x11/library/libxevie x11/library/libxext x11/library/libxrender x11/library/libxscrnsaver x11/library/libxtst x11/library/toolkit/libxt</code>.</li>
</ul>
<p>Use <code>--with-x=&lt;path&gt;</code> if <code>configure</code> does not properly locate your X11 files.</p>
Expand Down Expand Up @@ -553,7 +565,7 @@ <h4 id="general-make-control-variables">General Make Control Variables</h4>
<li><code>CONF</code> and <code>CONF_NAME</code> - Selecting the configuration(s) to use. See <a href="#using-multiple-configurations">Using Multiple Configurations</a></li>
</ul>
<h4 id="test-make-control-variables">Test Make Control Variables</h4>
<p>These make control variables only make sense when running tests. Please see <a href="testing.html">Testing the JDK</a> for details.</p>
<p>These make control variables only make sense when running tests. Please see <strong>Testing the JDK</strong> (<a href="testing.html">html</a>, <a href="testing.md">markdown</a>) for details.</p>
<ul>
<li><code>TEST</code></li>
<li><code>TEST_JOBS</code></li>
Expand All @@ -573,7 +585,13 @@ <h2 id="running-tests">Running Tests</h2>
<p>The <a href="https://wiki.openjdk.java.net/display/Adoption">Adoption Group</a> provides recent builds of jtreg <a href="https://adopt-openjdk.ci.cloudbees.com/job/jtreg/lastSuccessfulBuild/artifact">here</a>. Download the latest <code>.tar.gz</code> file, unpack it, and point <code>--with-jtreg</code> to the <code>jtreg</code> directory that you just unpacked.</p>
<p>To execute the most basic tests (tier 1), use:</p>
<pre><code>make run-test-tier1</code></pre>
<p>For more details on how to run tests, please see the <a href="testing.html">Testing the JDK</a> document.</p>
<p>For more details on how to run tests, please see <strong>Testing the JDK</strong> (<a href="testing.html">html</a>, <a href="testing.md">markdown</a>).</p>
<h2 id="signing">Signing</h2>
<h3 id="macos-1">macOS</h3>
<p>Modern versions of macOS require applications to be signed and notarizied before distribution. See Apple's documentation for more background on what this means and how it works. To help support this, the JDK build can be configured to automatically sign all native binaries, and the JDK bundle, with all the options needed for successful notarization, as well as all the entitlements required by the JDK. To enable <code>hardened</code> signing, use configure parameter <code>--with-macosx-codesign=hardened</code> and configure the signing identity you wish to use with <code>--with-macosx-codesign-identity=&lt;identity&gt;</code>. The identity refers to a signing identity from Apple that needs to be preinstalled on the build host.</p>
<p>When not signing for distribution with the hardened option, the JDK build will still attempt to perform <code>adhoc</code> signing to add the special entitlement <code>com.apple.security.get-task-allow</code> to each binary. This entitlement is required to be able to dump core files from a process. Note that adding this entitlement makes the build invalid for notarization, so it is only added when signing in <code>debug</code> mode. To explicitly enable this kind of adhoc signing, use configure parameter <code>--with-macosx-codesign=debug</code>. It will be enabled by default in most cases.</p>
<p>It's also possible to completely disable any explicit codesign operations done by the JDK build using the configure parameter <code>--without-macosx-codesign</code>. The exact behavior then depends on the architecture. For macOS on x64, it (at least at the time of this writing) results in completely unsigned binaries that should still work fine for development and debugging purposes. On aarch64, the Xcode linker will apply a default &quot;adhoc&quot; signing, without any entitlements. Such a build does not allow dumping core files.</p>
<p>The default mode &quot;auto&quot; will try for <code>hardened</code> signing if the debug level is <code>release</code> and either the default identity or the specified identity is valid. If hardened isn't possible, then <code>debug</code> signing is chosen if it works. If nothing works, the codesign build step is disabled.</p>
<h2 id="cross-compiling">Cross-compiling</h2>
<p>Cross-compiling means using one platform (the <em>build</em> platform) to generate output that can ran on another platform (the <em>target</em> platform).</p>
<p>The typical reason for cross-compiling is that the build is performed on a more powerful desktop computer, but the resulting binaries will be able to run on a different, typically low-performing system. Most of the complications that arise when building for embedded is due to this separation of <em>build</em> and <em>target</em> systems.</p>
Expand Down Expand Up @@ -645,11 +663,13 @@ <h4 id="alsa-1">ALSA</h4>
<p>Note that alsa is needed even if you only want to build a headless JDK.</p>
<ul>
<li><p>Go to <a href="https://www.debian.org/distrib/packages">Debian Package Search</a> and search for the <code>libasound2</code> and <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>Install the libraries into the cross-compilation toolchain. For instance:</li>
</ul>
<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></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>
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>
</ul>
<h4 id="x11-1">X11</h4>
<p>You will need X11 libraries suitable for your <em>target</em> system. For most cases, using Debian's pre-built libraries work fine.</p>
Expand Down
Loading

0 comments on commit b94533c

Please sign in to comment.