Skip to content

Commit 00caf77

Browse files
committed
Merge branch 'master' into jdk-8311302-jmodless-link
2 parents cd47f3d + f62b578 commit 00caf77

File tree

987 files changed

+23819
-19513
lines changed

Some content is hidden

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

987 files changed

+23819
-19513
lines changed

.github/actions/get-jtreg/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,14 @@ runs:
5656

5757
- name: 'Build JTReg'
5858
run: |
59+
# If runner architecture is x64 set JAVA_HOME_17_X64 otherwise set to JAVA_HOME_17_arm64
60+
if [[ '${{ runner.arch }}' == 'X64' ]]; then
61+
JDK="$JAVA_HOME_17_X64"
62+
else
63+
JDK="$JAVA_HOME_17_arm64"
64+
fi
5965
# Build JTReg and move files to the proper locations
60-
bash make/build.sh --jdk "$(realpath bootjdk/jdk)"
66+
bash make/build.sh --jdk "$JDK"
6167
mkdir ../installed
6268
mv build/images/jtreg/* ../installed
6369
working-directory: jtreg/src

.jcheck/conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ version=0
1515
domain=openjdk.org
1616

1717
[checks "whitespace"]
18-
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.md|.*\.gmk|.*\.m4|.*\.ac|Makefile
18+
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.md|.*\.properties|.*\.gmk|.*\.m4|.*\.ac|Makefile
1919
ignore-tabs=.*\.gmk|Makefile
2020

2121
[checks "merge"]

doc/building.html

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ <h1 class="title">Building the JDK</h1>
9292
<li><a href="#autoconf" id="toc-autoconf">Autoconf</a></li>
9393
<li><a href="#gnu-make" id="toc-gnu-make">GNU Make</a></li>
9494
<li><a href="#gnu-bash" id="toc-gnu-bash">GNU Bash</a></li>
95+
<li><a href="#graphviz-and-pandoc" id="toc-graphviz-and-pandoc">Graphviz
96+
and Pandoc</a></li>
9597
</ul></li>
9698
<li><a href="#running-configure" id="toc-running-configure">Running
9799
Configure</a>
@@ -524,7 +526,7 @@ <h3 id="linux">Linux</h3>
524526
<p>The basic tooling is provided as part of the core operating system,
525527
but you will most likely need to install developer packages.</p>
526528
<p>For apt-based distributions (Debian, Ubuntu, etc), try this:</p>
527-
<pre><code>sudo apt-get install build-essential</code></pre>
529+
<pre><code>sudo apt-get install build-essential autoconf</code></pre>
528530
<p>For rpm-based distributions (Fedora, Red Hat, etc), try this:</p>
529531
<pre><code>sudo yum groupinstall &quot;Development Tools&quot;</code></pre>
530532
<p>For Alpine Linux, aside from basic tooling, install the GNU versions
@@ -862,6 +864,13 @@ <h3 id="gnu-bash">GNU Bash</h3>
862864
href="https://www.gnu.org/software/bash">GNU Bash</a>. No other shells
863865
are supported.</p>
864866
<p>At least version 3.2 of GNU Bash must be used.</p>
867+
<h3 id="graphviz-and-pandoc">Graphviz and Pandoc</h3>
868+
<p>In order to build the full docs (see the
869+
<code>--enable-full-docs</code> configure option) <a
870+
href="https://www.graphviz.org">Graphviz</a> and <a
871+
href="https://pandoc.org">Pandoc</a> are required. Any recent versions
872+
should work. For reference, and subject to change, Oracle builds use
873+
Graphviz 9.0.0 and Pandoc 2.19.2.</p>
865874
<h2 id="running-configure">Running Configure</h2>
866875
<p>To build the JDK, you need a "configuration", which consists of a
867876
directory where to store the build output, coupled with information
@@ -2157,15 +2166,26 @@ <h3 id="using-multiple-configurations">Using Multiple
21572166
<code>configure</code> from there, e.g.
21582167
<code>mkdir build/&lt;name&gt; &amp;&amp; cd build/&lt;name&gt; &amp;&amp; bash ../../configure</code>.</p>
21592168
<p>Then you can build that configuration using
2160-
<code>make CONF_NAME=&lt;name&gt;</code> or
2161-
<code>make CONF=&lt;pattern&gt;</code>, where
2162-
<code>&lt;pattern&gt;</code> is a substring matching one or several
2163-
configurations, e.g. <code>CONF=debug</code>. The special empty pattern
2164-
(<code>CONF=</code>) will match <em>all</em> available configuration, so
2165-
<code>make CONF= hotspot</code> will build the <code>hotspot</code>
2166-
target for all configurations. Alternatively, you can execute
2167-
<code>make</code> in the configuration directory, e.g.
2168-
<code>cd build/&lt;name&gt; &amp;&amp; make</code>.</p>
2169+
<code>make CONF=&lt;selector&gt;</code>, where
2170+
<code>&lt;selector&gt;</code> is interpreted as follows:</p>
2171+
<ul>
2172+
<li>If <code>&lt;selector&gt;</code> exacly matches the name of a
2173+
configuration, this and only this configuration will be selected.</li>
2174+
<li>If <code>&lt;selector&gt;</code> matches (i.e. is a substring of)
2175+
the names of several configurations, then all these configurations will
2176+
be selected.</li>
2177+
<li>If <code>&lt;selector&gt;</code> is empty (i.e. <code>CONF=</code>),
2178+
then all configurations will be selected.</li>
2179+
<li>If <code>&lt;selector&gt;</code> begins with <code>!</code>, then
2180+
all configurations <strong>not</strong> matching the string following
2181+
<code>!</code> will be selected.</li>
2182+
</ul>
2183+
<p>A more specialized version, <code>CONF_NAME=&lt;name&gt;</code> also
2184+
exists, which will only match if the given <code>&lt;name&gt;</code>
2185+
exactly matches a single configuration.</p>
2186+
<p>Alternatively, you can execute <code>make</code> in the configuration
2187+
directory, e.g. <code>cd build/&lt;name&gt; &amp;&amp; make</code>.</p>
2188+
<p><code>make CONF_NAME=&lt;name&gt;</code> or</p>
21692189
<h3 id="handling-reconfigurations">Handling Reconfigurations</h3>
21702190
<p>If you update the repository and part of the configure script has
21712191
changed, the build system will force you to re-run

doc/building.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ will most likely need to install developer packages.
349349
For apt-based distributions (Debian, Ubuntu, etc), try this:
350350

351351
```
352-
sudo apt-get install build-essential
352+
sudo apt-get install build-essential autoconf
353353
```
354354

355355
For rpm-based distributions (Fedora, Red Hat, etc), try this:
@@ -685,6 +685,14 @@ shells are supported.
685685

686686
At least version 3.2 of GNU Bash must be used.
687687

688+
### Graphviz and Pandoc
689+
690+
In order to build the full docs (see the `--enable-full-docs`
691+
configure option) [Graphviz](https://www.graphviz.org) and
692+
[Pandoc](https://pandoc.org) are required. Any recent versions should
693+
work. For reference, and subject to change, Oracle builds use Graphviz
694+
9.0.0 and Pandoc 2.19.2.
695+
688696
## Running Configure
689697

690698
To build the JDK, you need a "configuration", which consists of a directory
@@ -1944,12 +1952,25 @@ configuration with the name `<name>`. Alternatively, you can create a directory
19441952
under `build` and run `configure` from there, e.g. `mkdir build/<name> && cd
19451953
build/<name> && bash ../../configure`.
19461954
1947-
Then you can build that configuration using `make CONF_NAME=<name>` or `make
1948-
CONF=<pattern>`, where `<pattern>` is a substring matching one or several
1949-
configurations, e.g. `CONF=debug`. The special empty pattern (`CONF=`) will
1950-
match *all* available configuration, so `make CONF= hotspot` will build the
1951-
`hotspot` target for all configurations. Alternatively, you can execute `make`
1952-
in the configuration directory, e.g. `cd build/<name> && make`.
1955+
Then you can build that configuration using `make CONF=<selector>`, where
1956+
`<selector>` is interpreted as follows:
1957+
1958+
* If `<selector>` exacly matches the name of a configuration, this and only
1959+
this configuration will be selected.
1960+
* If `<selector>` matches (i.e. is a substring of) the names of several
1961+
configurations, then all these configurations will be selected.
1962+
* If `<selector>` is empty (i.e. `CONF=`), then all configurations will be
1963+
selected.
1964+
* If `<selector>` begins with `!`, then all configurations **not** matching the
1965+
string following `!` will be selected.
1966+
1967+
A more specialized version, `CONF_NAME=<name>` also exists, which will only
1968+
match if the given `<name>` exactly matches a single configuration.
1969+
1970+
Alternatively, you can execute `make` in the configuration directory, e.g. `cd
1971+
build/<name> && make`.
1972+
1973+
`make CONF_NAME=<name>` or
19531974
19541975
### Handling Reconfigurations
19551976

make/Global.gmk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@ help:
8787
$(info $(_) # (gensrc, java, copy, libs, launchers, gendata))
8888
$(info )
8989
$(info Make control variables)
90-
$(info $(_) CONF= # Build all configurations (note, assignment is empty))
91-
$(info $(_) CONF=<substring> # Build the configuration(s) with a name matching)
92-
$(info $(_) # <substring>)
93-
$(info $(_) CONF_NAME=<string> # Build the configuration with exactly the <string>)
90+
$(info $(_) CONF=<selector> # Select which configuration(s) to build)
91+
$(info $(_) CONF= # Select all configurations (note, assignment is empty))
92+
$(info $(_) CONF_NAME=<string> # Select the configuration with the name <string>)
9493
$(info $(_) SPEC=<spec file> # Build the configuration given by the spec file)
9594
$(info $(_) LOG=<loglevel> # Change the log level from warn to <loglevel>)
9695
$(info $(_) # Available log levels are:)

make/Hsdis.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -122,8 +122,8 @@ ifeq ($(HSDIS_BACKEND), binutils)
122122

123123
TOOLCHAIN_TYPE := gcc
124124
OPENJDK_TARGET_OS := linux
125+
OPENJDK_TARGET_OS_TYPE := unix
125126
CC_OUT_OPTION := -o$(SPACE)
126-
LD_OUT_OPTION := -o$(SPACE)
127127
GENDEPS_FLAGS := -MMD -MF
128128
CFLAGS_DEBUG_SYMBOLS := -g
129129
DISABLED_WARNINGS :=

make/InitSupport.gmk

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -202,8 +202,14 @@ ifeq ($(HAS_SPEC),)
202202
matching_confs := $$(strip $$(all_confs))
203203
else
204204
# Otherwise select those that contain the given CONF string
205-
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
206-
$$(if $$(findstring $$(CONF), $$(var)), $$(var))))
205+
ifeq ($$(patsubst !%,,$$(CONF)),)
206+
# A CONF starting with ! means we should negate the search term
207+
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
208+
$$(if $$(findstring $$(subst !,,$$(CONF)), $$(var)), ,$$(var))))
209+
else
210+
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
211+
$$(if $$(findstring $$(CONF), $$(var)), $$(var))))
212+
endif
207213
ifneq ($$(filter $$(CONF), $$(matching_confs)), )
208214
# If we found an exact match, use that
209215
matching_confs := $$(CONF)
@@ -421,8 +427,9 @@ else # $(HAS_SPEC)=true
421427

422428
# Cleanup after a compare build
423429
define CleanupCompareBuild
424-
# If running with a COMPARE_BUILD patch, reverse-apply it
425-
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH))
430+
# If running with a COMPARE_BUILD patch, reverse-apply it, but continue
431+
# even if that fails (can happen with removed files).
432+
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH) || true)
426433
# Move this build away and restore the original build
427434
$(MKDIR) -p $(topdir)/build/compare-build
428435
$(MV) $(OUTPUTDIR) $(COMPARE_BUILD_OUTPUTDIR)

make/autoconf/build-aux/pkg.m4

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# questions.
2626
#
2727

28-
#
28+
#
2929
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
3030
#
3131
# This program is free software; you can redistribute it and/or modify
@@ -54,18 +54,18 @@ AC_DEFUN([PKG_PROG_PKG_CONFIG],
5454
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
5555
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
5656
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
57-
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
57+
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
5858
fi
5959
if test -n "$PKG_CONFIG"; then
60-
_pkg_min_version=m4_default([$1], [0.9.0])
61-
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
62-
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
63-
AC_MSG_RESULT([yes])
64-
else
65-
AC_MSG_RESULT([no])
66-
PKG_CONFIG=""
67-
fi
68-
60+
_pkg_min_version=m4_default([$1], [0.9.0])
61+
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
62+
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
63+
AC_MSG_RESULT([yes])
64+
else
65+
AC_MSG_RESULT([no])
66+
PKG_CONFIG=""
67+
fi
68+
6969
fi[]dnl
7070
])# PKG_PROG_PKG_CONFIG
7171

@@ -97,7 +97,7 @@ m4_define([_PKG_CONFIG],
9797
elif test -n "$PKG_CONFIG"; then
9898
PKG_CHECK_EXISTS([$3],
9999
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
100-
[pkg_failed=yes])
100+
[pkg_failed=yes])
101101
else
102102
pkg_failed=untried
103103
fi[]dnl
@@ -143,14 +143,14 @@ See the pkg-config man page for more details.])
143143
if test $pkg_failed = yes; then
144144
_PKG_SHORT_ERRORS_SUPPORTED
145145
if test $_pkg_short_errors_supported = yes; then
146-
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
147-
else
148-
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
146+
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
147+
else
148+
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
149149
fi
150-
# Put the nasty error message in config.log where it belongs
151-
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
150+
# Put the nasty error message in config.log where it belongs
151+
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
152152
153-
ifelse([$4], , [AC_MSG_ERROR(dnl
153+
ifelse([$4], , [AC_MSG_ERROR(dnl
154154
[Package requirements ($2) were not met:
155155
156156
$$1_PKG_ERRORS
@@ -160,22 +160,22 @@ installed software in a non-standard prefix.
160160
161161
_PKG_TEXT
162162
])],
163-
[AC_MSG_RESULT([no])
163+
[AC_MSG_RESULT([no])
164164
$4])
165165
elif test $pkg_failed = untried; then
166-
ifelse([$4], , [AC_MSG_FAILURE(dnl
166+
ifelse([$4], , [AC_MSG_FAILURE(dnl
167167
[The pkg-config script could not be found or is too old. Make sure it
168168
is in your PATH or set the PKG_CONFIG environment variable to the full
169169
path to pkg-config.
170170
171171
_PKG_TEXT
172172
173173
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
174-
[$4])
174+
[$4])
175175
else
176-
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
177-
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
176+
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
177+
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
178178
AC_MSG_RESULT([yes])
179-
ifelse([$3], , :, [$3])
179+
ifelse([$3], , :, [$3])
180180
fi[]dnl
181181
])# PKG_CHECK_MODULES

make/autoconf/buildjdk-spec.gmk.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@ LDCXX := @BUILD_LDCXX@
4040
AS := @BUILD_AS@
4141
NM := @BUILD_NM@
4242
AR := @BUILD_AR@
43+
LIB := @BUILD_LIB@
4344
OBJCOPY := @BUILD_OBJCOPY@
4445
STRIP := @BUILD_STRIP@
4546
SYSROOT_CFLAGS := @BUILD_SYSROOT_CFLAGS@

make/autoconf/flags-cflags.m4

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,13 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
480480
#### OS DEFINES, these should be independent on toolchain
481481
if test "x$OPENJDK_TARGET_OS" = xlinux; then
482482
CFLAGS_OS_DEF_JVM="-DLINUX -D_FILE_OFFSET_BITS=64"
483-
CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
483+
CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64"
484484
elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
485485
CFLAGS_OS_DEF_JVM="-D_ALLBSD_SOURCE -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE"
486486
CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
487487
elif test "x$OPENJDK_TARGET_OS" = xaix; then
488488
CFLAGS_OS_DEF_JVM="-DAIX -D_LARGE_FILES"
489+
CFLAGS_OS_DEF_JDK="-D_LARGE_FILES"
489490
elif test "x$OPENJDK_TARGET_OS" = xbsd; then
490491
CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE"
491492
elif test "x$OPENJDK_TARGET_OS" = xwindows; then
@@ -543,7 +544,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
543544
ALWAYS_DEFINES_JVM="-D_GNU_SOURCE"
544545
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
545546
ALWAYS_DEFINES_JVM="-D_REENTRANT"
546-
ALWAYS_DEFINES_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
547+
ALWAYS_DEFINES_JDK="-D_GNU_SOURCE -D_REENTRANT -DSTDC"
547548
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
548549
# Access APIs for Windows 8 and above
549550
# see https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170

make/autoconf/flags-ldflags.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -93,7 +93,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
9393
BASIC_LDFLAGS_JVM_ONLY="-Wl,-lC_r -bbigtoc"
9494
9595
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
96-
BASIC_LDFLAGS="-nologo -opt:ref"
96+
BASIC_LDFLAGS="-opt:ref"
9797
BASIC_LDFLAGS_JDK_ONLY="-incremental:no"
9898
BASIC_LDFLAGS_JVM_ONLY="-opt:icf,8 -subsystem:windows"
9999
fi

0 commit comments

Comments
 (0)