Skip to content

Commit dbec19c

Browse files
Merge master
2 parents 7b325a4 + 17f04fc commit dbec19c

File tree

2,814 files changed

+417172
-59473
lines changed

Some content is hidden

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

2,814 files changed

+417172
-59473
lines changed

.github/workflows/submit.yml

Lines changed: 394 additions & 11 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ test/nashorn/lib
1414
NashornProfile.txt
1515
**/JTreport/**
1616
**/JTwork/**
17+
/src/utils/LogCompilation/target/

.hgignore

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

doc/building.html

Lines changed: 18 additions & 0 deletions
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>
@@ -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>
@@ -688,6 +697,15 @@ <h3 id="creating-and-using-sysroots-with-qemu-deboostrap">Creating And Using Sys
688697
<p>Additional architectures might be supported by Debian/Ubuntu Ports.</p>
689698
<h3 id="building-for-armaarch64">Building for ARM/aarch64</h3>
690699
<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>
700+
<h3 id="building-for-musl">Building for musl</h3>
701+
<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>
702+
<pre><code>sh ./configure --with-jvm-variants=server \
703+
--with-boot-jdk=$BOOT_JDK \
704+
--with-build-jdk=$BUILD_JDK \
705+
--openjdk-target=x86_64-unknown-linux-musl \
706+
--with-devkit=$DEVKIT \
707+
--with-sysroot=$SYSROOT</code></pre>
708+
<p>and run <code>make</code> normally.</p>
691709
<h3 id="verifying-the-build">Verifying the Build</h3>
692710
<p>The build will end up in a directory named like <code>build/linux-arm-normal-server-release</code>.</p>
693711
<p>Inside this build output directory, the <code>images/jdk</code> will contain the newly built JDK, for your <em>target</em> system.</p>

doc/building.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,13 @@ For rpm-based distributions (Fedora, Red Hat, etc), try this:
273273
sudo yum groupinstall "Development Tools"
274274
```
275275

276+
For Alpine Linux, aside from basic tooling, install the GNU versions of some
277+
programs:
278+
279+
```
280+
sudo apk add build-base bash grep zip
281+
```
282+
276283
### AIX
277284

278285
Please consult the AIX section of the [Supported Build Platforms](
@@ -431,6 +438,7 @@ rather than bundling the JDK's own copy.
431438
libfreetype6-dev`.
432439
* To install on an rpm-based Linux, try running `sudo yum install
433440
freetype-devel`.
441+
* To install on Alpine Linux, try running `sudo apk add freetype-dev`.
434442

435443
Use `--with-freetype-include=<path>` and `--with-freetype-lib=<path>`
436444
if `configure` does not automatically locate the platform FreeType files.
@@ -445,6 +453,7 @@ your operating system.
445453
libcups2-dev`.
446454
* To install on an rpm-based Linux, try running `sudo yum install
447455
cups-devel`.
456+
* To install on Alpine Linux, try running `sudo apk add cups-dev`.
448457

449458
Use `--with-cups=<path>` if `configure` does not properly locate your CUPS
450459
files.
@@ -458,6 +467,8 @@ Linux.
458467
libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev`.
459468
* To install on an rpm-based Linux, try running `sudo yum install
460469
libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel`.
470+
* To install on Alpine Linux, try running `sudo apk add libx11-dev
471+
libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev`.
461472

462473
Use `--with-x=<path>` if `configure` does not properly locate your X11 files.
463474

@@ -470,6 +481,7 @@ required on Linux. At least version 0.9.1 of ALSA is required.
470481
libasound2-dev`.
471482
* To install on an rpm-based Linux, try running `sudo yum install
472483
alsa-lib-devel`.
484+
* To install on Alpine Linux, try running `sudo apk add alsa-lib-dev`.
473485

474486
Use `--with-alsa=<path>` if `configure` does not properly locate your ALSA
475487
files.
@@ -484,6 +496,7 @@ Hotspot.
484496
libffi-dev`.
485497
* To install on an rpm-based Linux, try running `sudo yum install
486498
libffi-devel`.
499+
* To install on Alpine Linux, try running `sudo apk add libffi-dev`.
487500

488501
Use `--with-libffi=<path>` if `configure` does not properly locate your libffi
489502
files.
@@ -499,6 +512,7 @@ platforms. At least version 2.69 is required.
499512
autoconf`.
500513
* To install on an rpm-based Linux, try running `sudo yum install
501514
autoconf`.
515+
* To install on Alpine Linux, try running `sudo apk add autoconf`.
502516
* To install on macOS, try running `brew install autoconf`.
503517
* To install on Windows, try running `<path to Cygwin setup>/setup-x86_64 -q
504518
-P autoconf`.
@@ -1113,6 +1127,25 @@ available using `--with-abi-profile`: arm-vfp-sflt, arm-vfp-hflt, arm-sflt,
11131127
armv5-vfp-sflt, armv6-vfp-hflt. Note that soft-float ABIs are no longer
11141128
properly supported by the JDK.
11151129
1130+
### Building for musl
1131+
1132+
Just like it's possible to cross-compile for a different CPU, it's possible to
1133+
cross-compile for musl libc on a glibc-based *build* system.
1134+
A devkit suitable for most target CPU architectures can be obtained from
1135+
[musl.cc](https://musl.cc). After installing the required packages in the
1136+
sysroot, configure the build with `--openjdk-target`:
1137+
1138+
```
1139+
sh ./configure --with-jvm-variants=server \
1140+
--with-boot-jdk=$BOOT_JDK \
1141+
--with-build-jdk=$BUILD_JDK \
1142+
--openjdk-target=x86_64-unknown-linux-musl \
1143+
--with-devkit=$DEVKIT \
1144+
--with-sysroot=$SYSROOT
1145+
```
1146+
1147+
and run `make` normally.
1148+
11161149
### Verifying the Build
11171150
11181151
The build will end up in a directory named like

make/Bundles.gmk

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -410,17 +410,43 @@ endif
410410

411411
################################################################################
412412

413-
ifneq ($(filter docs-bundles, $(MAKECMDGOALS)), )
414-
DOCS_BUNDLE_FILES := $(call FindFiles, $(DOCS_IMAGE_DIR))
413+
ifneq ($(filter docs-jdk-bundles, $(MAKECMDGOALS)), )
414+
DOCS_JDK_BUNDLE_FILES := $(call FindFiles, $(DOCS_JDK_IMAGE_DIR))
415415

416-
$(eval $(call SetupBundleFile, BUILD_DOCS_BUNDLE, \
417-
BUNDLE_NAME := $(DOCS_BUNDLE_NAME), \
418-
FILES := $(DOCS_BUNDLE_FILES), \
419-
BASE_DIRS := $(DOCS_IMAGE_DIR), \
416+
$(eval $(call SetupBundleFile, BUILD_DOCS_JDK_BUNDLE, \
417+
BUNDLE_NAME := $(DOCS_JDK_BUNDLE_NAME), \
418+
FILES := $(DOCS_JDK_BUNDLE_FILES), \
419+
BASE_DIRS := $(DOCS_JDK_IMAGE_DIR), \
420420
SUBDIR := docs, \
421421
))
422422

423-
DOCS_TARGETS += $(BUILD_DOCS_BUNDLE)
423+
DOCS_JDK_TARGETS += $(BUILD_DOCS_JDK_BUNDLE)
424+
endif
425+
426+
ifneq ($(filter docs-javase-bundles, $(MAKECMDGOALS)), )
427+
DOCS_JAVASE_BUNDLE_FILES := $(call FindFiles, $(DOCS_JAVASE_IMAGE_DIR))
428+
429+
$(eval $(call SetupBundleFile, BUILD_DOCS_JAVASE_BUNDLE, \
430+
BUNDLE_NAME := $(DOCS_JAVASE_BUNDLE_NAME), \
431+
FILES := $(DOCS_JAVASE_BUNDLE_FILES), \
432+
BASE_DIRS := $(DOCS_JAVASE_IMAGE_DIR), \
433+
SUBDIR := docs-javase, \
434+
))
435+
436+
DOCS_JAVASE_TARGETS += $(BUILD_DOCS_JAVASE_BUNDLE)
437+
endif
438+
439+
ifneq ($(filter docs-reference-bundles, $(MAKECMDGOALS)), )
440+
DOCS_REFERENCE_BUNDLE_FILES := $(call FindFiles, $(DOCS_REFERENCE_IMAGE_DIR))
441+
442+
$(eval $(call SetupBundleFile, BUILD_DOCS_REFERENCE_BUNDLE, \
443+
BUNDLE_NAME := $(DOCS_REFERENCE_BUNDLE_NAME), \
444+
FILES := $(DOCS_REFERENCE_BUNDLE_FILES), \
445+
BASE_DIRS := $(DOCS_REFERENCE_IMAGE_DIR), \
446+
SUBDIR := docs-reference, \
447+
))
448+
449+
DOCS_REFERENCE_TARGETS += $(BUILD_DOCS_REFERENCE_BUNDLE)
424450
endif
425451

426452
################################################################################
@@ -469,9 +495,12 @@ $(eval $(call IncludeCustomExtension, Bundles.gmk))
469495
product-bundles: $(PRODUCT_TARGETS)
470496
legacy-bundles: $(LEGACY_TARGETS)
471497
test-bundles: $(TEST_TARGETS)
472-
docs-bundles: $(DOCS_TARGETS)
498+
docs-jdk-bundles: $(DOCS_JDK_TARGETS)
499+
docs-javase-bundles: $(DOCS_JAVASE_TARGETS)
500+
docs-reference-bundles: $(DOCS_REFERENCE_TARGETS)
473501
static-libs-bundles: $(STATIC_LIBS_TARGETS)
474502
jcov-bundles: $(JCOV_TARGETS)
475503

476-
.PHONY: all default product-bundles test-bundles docs-bundles \
504+
.PHONY: all default product-bundles test-bundles \
505+
docs-jdk-bundles docs-javase-bundles docs-reference-bundles \
477506
static-libs-bundles jcov-bundles

make/CompileJavaModules.gmk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,6 @@ ifeq ($(call isTargetOs, windows), true)
184184
java.desktop_EXCLUDES += com/sun/java/swing/plaf/gtk
185185
endif
186186

187-
ifdef BUILD_HEADLESS_ONLY
188-
java.desktop_EXCLUDES += sun/applet
189-
endif
190-
191187
ifeq ($(call isTargetOs, windows macosx), false)
192188
java.desktop_EXCLUDE_FILES += sun/awt/AWTCharset.java
193189
endif
@@ -389,11 +385,11 @@ endif
389385

390386
################################################################################
391387

392-
jdk.incubator.jpackage_COPY += .gif .png .txt .spec .script .prerm .preinst \
388+
jdk.jpackage_COPY += .gif .png .txt .spec .script .prerm .preinst \
393389
.postrm .postinst .list .sh .desktop .copyright .control .plist .template \
394390
.icns .scpt .wxs .wxl .wxi .ico .bmp .tiff
395391

396-
jdk.incubator.jpackage_CLEAN += .properties
392+
jdk.jpackage_CLEAN += .properties
397393

398394
################################################################################
399395

@@ -546,6 +542,10 @@ jdk.jfr_DISABLED_WARNINGS += exports
546542
jdk.jfr_COPY := .xsd .xml .dtd
547543
jdk.jfr_JAVAC_FLAGS := -XDstringConcat=inline
548544

545+
################################################################################
546+
547+
jdk.incubator.vector_DOCLINT += -Xdoclint:all/protected
548+
549549
################################################################################
550550
# If this is an imported module that has prebuilt classes, only compile
551551
# module-info.java.

make/CompileModuleTools.gmk

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,20 @@ include JavaCompilation.gmk
3333

3434
TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes
3535

36+
# When using an external BUILDJDK, make it possible to shortcut building of
37+
# these tools using the BUILD_JAVAC instead of having to build the complete
38+
# exploded image first.
39+
ifeq ($(EXTERNAL_BUILDJDK), true)
40+
COMPILER := buildjdk
41+
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK)
42+
else
43+
COMPILER := interim
44+
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED)
45+
endif
46+
3647
$(eval $(call SetupJavaCompilation, BUILD_JIGSAW_TOOLS, \
37-
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \
48+
TARGET_RELEASE := $(TARGET_RELEASE), \
49+
COMPILER := $(COMPILER), \
3850
SRC := $(TOPDIR)/make/jdk/src/classes, \
3951
INCLUDES := build/tools/deps \
4052
build/tools/docs \

make/CompileToolsJdk.gmk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
5656
DISABLED_WARNINGS := options, \
5757
JAVAC_FLAGS := \
5858
--add-exports java.desktop/sun.awt=ALL-UNNAMED \
59-
--add-exports java.base/sun.text=ALL-UNNAMED, \
59+
--add-exports java.base/sun.text=ALL-UNNAMED \
60+
--add-exports java.base/sun.security.util=ALL-UNNAMED, \
6061
))
6162

6263
TARGETS += $(BUILD_TOOLS_JDK)

make/Docs.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ $(eval $(call SetupApiDocsGeneration, JAVASE_API, \
458458
MODULES := $(JAVASE_MODULES), \
459459
SHORT_NAME := $(JAVASE_SHORT_NAME), \
460460
LONG_NAME := $(JAVASE_LONG_NAME), \
461-
TARGET_DIR := $(IMAGES_OUTPUTDIR)/javase-docs/api, \
461+
TARGET_DIR := $(DOCS_JAVASE_IMAGE_DIR)/api, \
462462
))
463463

464464
# Targets generated are returned in JAVASE_API_JAVADOC_TARGETS and
@@ -476,7 +476,7 @@ $(eval $(call SetupApiDocsGeneration, REFERENCE_API, \
476476
MODULES := $(JAVASE_MODULES), \
477477
SHORT_NAME := $(JAVASE_SHORT_NAME), \
478478
LONG_NAME := $(JAVASE_LONG_NAME), \
479-
TARGET_DIR := $(IMAGES_OUTPUTDIR)/reference-docs/api, \
479+
TARGET_DIR := $(DOCS_REFERENCE_IMAGE_DIR)/api, \
480480
JAVADOC_CMD := $(JAVADOC), \
481481
OPTIONS := $(REFERENCE_OPTIONS), \
482482
TAGS := $(REFERENCE_TAGS), \

0 commit comments

Comments
 (0)