Skip to content

Commit 8a4915e

Browse files
committed
8296904: Improve handling of macos xcode toolchain
Reviewed-by: mbaesken Backport-of: 57e6d92a6ddbfe78cbf250a4502ce0911ee6f75a
1 parent 5f4b38a commit 8a4915e

File tree

4 files changed

+90
-67
lines changed

4 files changed

+90
-67
lines changed

doc/building.html

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
33
<head>
4-
<meta charset="utf-8">
5-
<meta name="generator" content="pandoc">
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
4+
<meta charset="utf-8" />
5+
<meta name="generator" content="pandoc" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
77
<title>Building the JDK</title>
8-
<style type="text/css">code{white-space: pre;}</style>
9-
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css">
8+
<style type="text/css">
9+
code{white-space: pre-wrap;}
10+
span.smallcaps{font-variant: small-caps;}
11+
span.underline{text-decoration: underline;}
12+
div.column{display: inline-block; vertical-align: top; width: 50%;}
13+
</style>
14+
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
1015
<!--[if lt IE 9]>
1116
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
1217
<![endif]-->
1318
<style type="text/css">pre, code, tt { color: #1d6ae5; }</style>
1419
</head>
1520
<body>
16-
<header>
21+
<header id="title-block-header">
1722
<h1 class="title">Building the JDK</h1>
1823
</header>
1924
<nav id="TOC">
@@ -234,57 +239,57 @@ <h2 id="native-compiler-toolchain-requirements">Native Compiler (Toolchain) Requ
234239
<table>
235240
<thead>
236241
<tr class="header">
237-
<th style="text-align: left;">Operating system</th>
238-
<th style="text-align: left;">Supported toolchain</th>
242+
<th>Operating system</th>
243+
<th>Supported toolchain</th>
239244
</tr>
240245
</thead>
241246
<tbody>
242247
<tr class="odd">
243-
<td style="text-align: left;">Linux</td>
244-
<td style="text-align: left;">gcc, clang</td>
248+
<td>Linux</td>
249+
<td>gcc, clang</td>
245250
</tr>
246251
<tr class="even">
247-
<td style="text-align: left;">macOS</td>
248-
<td style="text-align: left;">Apple Xcode (using clang)</td>
252+
<td>macOS</td>
253+
<td>Apple Xcode (using clang)</td>
249254
</tr>
250255
<tr class="odd">
251-
<td style="text-align: left;">Solaris</td>
252-
<td style="text-align: left;">Oracle Solaris Studio</td>
256+
<td>Solaris</td>
257+
<td>Oracle Solaris Studio</td>
253258
</tr>
254259
<tr class="even">
255-
<td style="text-align: left;">AIX</td>
256-
<td style="text-align: left;">IBM XL C/C++</td>
260+
<td>AIX</td>
261+
<td>IBM XL C/C++</td>
257262
</tr>
258263
<tr class="odd">
259-
<td style="text-align: left;">Windows</td>
260-
<td style="text-align: left;">Microsoft Visual Studio</td>
264+
<td>Windows</td>
265+
<td>Microsoft Visual Studio</td>
261266
</tr>
262267
</tbody>
263268
</table>
264269
<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>
265270
<table>
266271
<thead>
267272
<tr class="header">
268-
<th style="text-align: left;">Operating system</th>
269-
<th style="text-align: left;">Toolchain version</th>
273+
<th>Operating system</th>
274+
<th>Toolchain version</th>
270275
</tr>
271276
</thead>
272277
<tbody>
273278
<tr class="odd">
274-
<td style="text-align: left;">Linux</td>
275-
<td style="text-align: left;">gcc 7.3.0</td>
279+
<td>Linux</td>
280+
<td>gcc 7.3.0</td>
276281
</tr>
277282
<tr class="even">
278-
<td style="text-align: left;">macOS</td>
279-
<td style="text-align: left;">Apple Xcode 9.4 (using clang 9.1.0)</td>
283+
<td>macOS</td>
284+
<td>Apple Xcode 9.4 (using clang 9.1.0)</td>
280285
</tr>
281286
<tr class="odd">
282-
<td style="text-align: left;">Solaris</td>
283-
<td style="text-align: left;">Oracle Solaris Studio 12.4 (with compiler version 5.13)</td>
287+
<td>Solaris</td>
288+
<td>Oracle Solaris Studio 12.4 (with compiler version 5.13)</td>
284289
</tr>
285290
<tr class="even">
286-
<td style="text-align: left;">Windows</td>
287-
<td style="text-align: left;">Microsoft Visual Studio 2017 update 15.9.16</td>
291+
<td>Windows</td>
292+
<td>Microsoft Visual Studio 2017 update 15.9.16</td>
288293
</tr>
289294
</tbody>
290295
</table>
@@ -297,9 +302,13 @@ <h3 id="clang">clang</h3>
297302
<p>To use clang instead of gcc on Linux, use <code>--with-toolchain-type=clang</code>.</p>
298303
<h3 id="apple-xcode">Apple Xcode</h3>
299304
<p>The oldest supported version of Xcode is 8.</p>
300-
<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>
305+
<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>
301306
<pre><code>xcode-select --install</code></pre>
302-
<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>
307+
<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>
308+
<ul>
309+
<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>
310+
<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>
311+
</ul>
303312
<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>
304313
<h3 id="oracle-solaris-studio">Oracle Solaris Studio</h3>
305314
<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>
@@ -362,8 +371,8 @@ <h3 id="oracle-solaris-studio">Oracle Solaris Studio</h3>
362371
<h3 id="microsoft-visual-studio">Microsoft Visual Studio</h3>
363372
<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>
364373
<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>
365-
<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>
366374
<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>
375+
<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>
367376
<h3 id="ibm-xl-cc">IBM XL C/C++</h3>
368377
<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>
369378
<p>See the <a href="http://cr.openjdk.java.net/~simonis/ppc-aix-port">OpenJDK PowerPC Port Status Page</a> for details.</p>
@@ -403,7 +412,7 @@ <h3 id="x11">X11</h3>
403412
<ul>
404413
<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>
405414
<li>To install on an rpm-based Linux, try running <code>sudo yum install libXtst-devel libXt-devel libXrender-devel libXi-devel</code>.</li>
406-
<li>To install on Alpine Linux, try running <code>sudo apk add libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev</code>.</li>
415+
<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>
407416
<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>
408417
</ul>
409418
<p>Use <code>--with-x=&lt;path&gt;</code> if <code>configure</code> does not properly locate your X11 files.</p>
@@ -645,11 +654,13 @@ <h4 id="alsa-1">ALSA</h4>
645654
<p>Note that alsa is needed even if you only want to build a headless JDK.</p>
646655
<ul>
647656
<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>
648-
<li><p>Install the libraries into the cross-compilation toolchain. For instance:</p>
657+
<li>Install the libraries into the cross-compilation toolchain. For instance:</li>
658+
</ul>
649659
<pre><code>cd /tools/gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux/arm-linux-gnueabihf/libc
650660
dpkg-deb -x /tmp/libasound2_1.0.25-4_armhf.deb .
651-
dpkg-deb -x /tmp/libasound2-dev_1.0.25-4_armhf.deb .</code></pre></li>
652-
<li><p>If alsa is not properly detected by <code>configure</code>, you can point it out by <code>--with-alsa</code>.</p></li>
661+
dpkg-deb -x /tmp/libasound2-dev_1.0.25-4_armhf.deb .</code></pre>
662+
<ul>
663+
<li>If alsa is not properly detected by <code>configure</code>, you can point it out by <code>--with-alsa</code>.</li>
653664
</ul>
654665
<h4 id="x11-1">X11</h4>
655666
<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>

doc/building.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,13 @@ be able to run on the target platform. In theory, toolchain and operating
291291
system should be independent factors, but in practice there's more or less a
292292
one-to-one correlation between target operating system and toolchain.
293293

294-
Operating system Supported toolchain
295-
------------------ -------------------------
296-
Linux gcc, clang
297-
macOS Apple Xcode (using clang)
298-
Solaris Oracle Solaris Studio
299-
AIX IBM XL C/C++
300-
Windows Microsoft Visual Studio
294+
| Operating system | Supported toolchain |
295+
| ------------------ | ------------------------- |
296+
| Linux | gcc, clang |
297+
| macOS | Apple Xcode (using clang) |
298+
| Solaris | Oracle Solaris Studio |
299+
| AIX | IBM XL C/C++ |
300+
| Windows | Microsoft Visual Studio |
301301

302302
Please see the individual sections on the toolchains for version
303303
recommendations. As a reference, these versions of the toolchains are used, at
@@ -306,12 +306,12 @@ possible to compile the JDK with both older and newer versions, but the closer
306306
you stay to this list, the more likely you are to compile successfully without
307307
issues.
308308

309-
Operating system Toolchain version
310-
------------------ -------------------------------------------------------
311-
Linux gcc 7.3.0
312-
macOS Apple Xcode 9.4 (using clang 9.1.0)
313-
Solaris Oracle Solaris Studio 12.4 (with compiler version 5.13)
314-
Windows Microsoft Visual Studio 2017 update 15.9.16
309+
| Operating system | Toolchain version |
310+
| ------------------ | ------------------------------------------------------- |
311+
| Linux | gcc 7.3.0 |
312+
| macOS | Apple Xcode 9.4 (using clang 9.1.0) |
313+
| Solaris | Oracle Solaris Studio 12.4 (with compiler version 5.13) |
314+
| Windows | Microsoft Visual Studio 2017 update 15.9.16 |
315315

316316
### gcc
317317

@@ -334,20 +334,20 @@ To use clang instead of gcc on Linux, use `--with-toolchain-type=clang`.
334334

335335
The oldest supported version of Xcode is 8.
336336

337-
You will need the Xcode command lines developers tools to be able to build
338-
the JDK. (Actually, *only* the command lines tools are needed, not the IDE.)
337+
You will need the Xcode command line developer tools to be able to build
338+
the JDK. (Actually, *only* the command line tools are needed, not the IDE.)
339339
The simplest way to install these is to run:
340340
```
341341
xcode-select --install
342342
```
343343

344-
It is advisable to keep an older version of Xcode for building the JDK when
345-
updating Xcode. This [blog page](
346-
http://iosdevelopertips.com/xcode/install-multiple-versions-of-xcode.html) has
347-
good suggestions on managing multiple Xcode versions. To use a specific version
348-
of Xcode, use `xcode-select -s` before running `configure`, or use
349-
`--with-toolchain-path` to point to the version of Xcode to use, e.g.
350-
`configure --with-toolchain-path=/Applications/Xcode8.app/Contents/Developer/usr/bin`
344+
When updating Xcode, it is advisable to keep an older version for building the JDK.
345+
To use a specific version of Xcode you have multiple options:
346+
347+
* Use `xcode-select -s` before running `configure`, e.g. `xcode-select -s /Applications/Xcode13.1.app`. The drawback is that the setting
348+
is system wide and you may have to revert it after an OpenJDK build.
349+
* Use configure option `--with-xcode-path`, e.g. `configure --with-xcode-path=/Applications/Xcode13.1.app`
350+
This allows using a specific Xcode version for an OpenJDK build, independently of the active Xcode version by `xcode-select`.
351351

352352
If you have recently (inadvertently) updated your OS and/or Xcode version, and
353353
the JDK can no longer be built, please see the section on [Problems with the

0 commit comments

Comments
 (0)