Skip to content

Commit 9b4184f

Browse files
[GR-50941] Merge in tag jdk-23+13.
PullRequest: labsjdk-ce/62
2 parents 08c9a06 + ccee52d commit 9b4184f

File tree

803 files changed

+5179
-70724
lines changed

Some content is hidden

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

803 files changed

+5179
-70724
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ local contains(str, needle) = std.findSubstr(needle, str) != [];
248248
# next JVMCI release has been made. Add the issue id as a comment here.
249249
# You might want to point this to the merge commit of a Graal PR, i.e., include
250250
# the "_gate" suffix.
251-
local downstream_branch = "labsjdk/automation-3-1-2024-8400_gate",
251+
local downstream_branch = "labsjdk/automation-3-8-2024-3608_gate",
252252

253253
local clone_graal(defs) = {
254254
# Checkout the graal-enterprise repo to the "_gate" version of the

doc/building.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ <h2 id="native-compiler-toolchain-requirements">Native Compiler
562562
</tr>
563563
<tr class="odd">
564564
<td>AIX</td>
565-
<td>IBM XL C/C++</td>
565+
<td>IBM Open XL C/C++</td>
566566
</tr>
567567
<tr class="even">
568568
<td>Windows</td>
@@ -601,13 +601,13 @@ <h2 id="native-compiler-toolchain-requirements">Native Compiler
601601
<p>All compilers are expected to be able to handle the C11 language
602602
standard for C, and C++14 for C++.</p>
603603
<h3 id="gcc">gcc</h3>
604-
<p>The minimum accepted version of gcc is 6.0. Older versions will not
604+
<p>The minimum accepted version of gcc is 10.0. Older versions will not
605605
be accepted by <code>configure</code>.</p>
606606
<p>The JDK is currently known to compile successfully with gcc version
607607
13.2 or newer.</p>
608608
<p>In general, any version between these two should be usable.</p>
609609
<h3 id="clang">clang</h3>
610-
<p>The minimum accepted version of clang is 3.5. Older versions will not
610+
<p>The minimum accepted version of clang is 13. Older versions will not
611611
be accepted by <code>configure</code>.</p>
612612
<p>To use clang instead of gcc on Linux, use
613613
<code>--with-toolchain-type=clang</code>.</p>

doc/building.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ one-to-one correlation between target operating system and toolchain.
382382
| ------------------ | ------------------------- |
383383
| Linux | gcc, clang |
384384
| macOS | Apple Xcode (using clang) |
385-
| AIX | IBM XL C/C++ |
385+
| AIX | IBM Open XL C/C++ |
386386
| Windows | Microsoft Visual Studio |
387387

388388
Please see the individual sections on the toolchains for version
@@ -403,7 +403,7 @@ C, and C++14 for C++.
403403

404404
### gcc
405405

406-
The minimum accepted version of gcc is 6.0. Older versions will not be accepted
406+
The minimum accepted version of gcc is 10.0. Older versions will not be accepted
407407
by `configure`.
408408

409409
The JDK is currently known to compile successfully with gcc version 13.2 or
@@ -413,7 +413,7 @@ In general, any version between these two should be usable.
413413

414414
### clang
415415

416-
The minimum accepted version of clang is 3.5. Older versions will not be
416+
The minimum accepted version of clang is 13. Older versions will not be
417417
accepted by `configure`.
418418

419419
To use clang instead of gcc on Linux, use `--with-toolchain-type=clang`.

doc/hotspot-style.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -748,12 +748,15 @@ <h3 id="thread_local">thread_local</h3>
748748
href="https://bugs.openjdk.org/browse/JDK-8282469">JDK-8282469</a> for
749749
further discussion.</p>
750750
<h3 id="nullptr">nullptr</h3>
751-
<p>Prefer <code>nullptr</code> (<a
751+
<p>Use <code>nullptr</code> (<a
752752
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf">n2431</a>)
753-
to <code>NULL</code>. Don't use (constexpr or literal) 0 for
754-
pointers.</p>
755-
<p>For historical reasons there are widespread uses of both
756-
<code>NULL</code> and of integer 0 as a pointer value.</p>
753+
rather than <code>NULL</code>. See the paper for reasons to avoid
754+
<code>NULL</code>.</p>
755+
<p>Don't use (constant expression or literal) 0 for pointers. Note that
756+
C++14 removed non-literal 0 constants from <em>null pointer
757+
constants</em>, though some compilers continue to treat them as such.
758+
For historical reasons there may be lingering uses of 0 as a
759+
pointer.</p>
757760
<h3 id="atomic">&lt;atomic&gt;</h3>
758761
<p>Do not use facilities provided by the <code>&lt;atomic&gt;</code>
759762
header (<a

doc/hotspot-style.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -725,12 +725,14 @@ for further discussion.
725725

726726
### nullptr
727727

728-
Prefer `nullptr`
728+
Use `nullptr`
729729
([n2431](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf))
730-
to `NULL`. Don't use (constexpr or literal) 0 for pointers.
730+
rather than `NULL`. See the paper for reasons to avoid `NULL`.
731731

732-
For historical reasons there are widespread uses of both `NULL` and of
733-
integer 0 as a pointer value.
732+
Don't use (constant expression or literal) 0 for pointers. Note that C++14
733+
removed non-literal 0 constants from _null pointer constants_, though some
734+
compilers continue to treat them as such. For historical reasons there may be
735+
lingering uses of 0 as a pointer.
734736

735737
### &lt;atomic&gt;
736738

make/Global.gmk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ help:
102102
$(info $(_) # method is 'auto', 'ignore' or 'fail' (default))
103103
$(info $(_) TEST="test1 ..." # Use the given test descriptor(s) for testing, e.g.)
104104
$(info $(_) # make test TEST="jdk_lang gtest:all")
105-
$(info $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness, use 'help' to list)
106-
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness, use 'help' to list)
107-
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness, use 'help' to list)
105+
$(info $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness, use 'make test-only JTREG=help' to list)
106+
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness, use 'make test-only GTEST=help' to list)
107+
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness, use 'make test-only MICRO=help' to list)
108108
$(info $(_) TEST_OPTS="OPT1=x;..." # Generic control of all test harnesses)
109109
$(info $(_) TEST_VM_OPTS="ARG ..." # Same as setting TEST_OPTS to VM_OPTIONS="ARG ...")
110110
$(info )

make/autoconf/flags-cflags.m4

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# Setup flags for C/C++ compiler
2929
#
3030

31-
###############################################################################
31+
################################################################################
3232
#
3333
# How to compile shared libraries.
3434
#
@@ -37,7 +37,10 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
3737
if test "x$TOOLCHAIN_TYPE" = xgcc; then
3838
# Default works for linux, might work on other platforms as well.
3939
SHARED_LIBRARY_FLAGS='-shared'
40-
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
40+
# --disable-new-dtags forces use of RPATH instead of RUNPATH for rpaths.
41+
# This protects internal library dependencies within the JDK from being
42+
# overridden using LD_LIBRARY_PATH. See JDK-8326891 for more information.
43+
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1 -Wl,--disable-new-dtags'
4144
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
4245
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
4346
@@ -60,6 +63,9 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
6063
# Default works for linux, might work on other platforms as well.
6164
SHARED_LIBRARY_FLAGS='-shared'
6265
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
66+
if test "x$OPENJDK_TARGET_OS" = xlinux; then
67+
SET_EXECUTABLE_ORIGIN="$SET_EXECUTABLE_ORIGIN -Wl,--disable-new-dtags"
68+
fi
6369
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
6470
6571
# arm specific settings

make/autoconf/toolchain.m4

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ TOOLCHAIN_DESCRIPTION_microsoft="Microsoft Visual Studio"
5050
TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
5151

5252
# Minimum supported versions, empty means unspecified
53-
TOOLCHAIN_MINIMUM_VERSION_clang="3.5"
54-
TOOLCHAIN_MINIMUM_VERSION_gcc="6.0"
53+
TOOLCHAIN_MINIMUM_VERSION_clang="13.0"
54+
TOOLCHAIN_MINIMUM_VERSION_gcc="10.0"
5555
TOOLCHAIN_MINIMUM_VERSION_microsoft="19.28.0.0" # VS2019 16.8, aka MSVC 14.28
56-
TOOLCHAIN_MINIMUM_VERSION_xlc="16.1.0.0011"
56+
TOOLCHAIN_MINIMUM_VERSION_xlc="17.1.1.4"
5757

5858
# Minimum supported linker versions, empty means unspecified
5959
TOOLCHAIN_MINIMUM_LD_VERSION_gcc="2.18"

make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java

Lines changed: 84 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,10 @@ public class CLDRConverter {
128128
static Map<String, String> pluralRules;
129129
static Map<String, String> dayPeriodRules;
130130

131-
// TZDB Short Names Map
131+
// TZDB maps
132132
private static final Map<String, String> tzdbShortNamesMap = HashMap.newHashMap(512);
133133
private static final Map<String, String> tzdbSubstLetters = HashMap.newHashMap(512);
134+
private static final Map<String, String> tzdbLinks = HashMap.newHashMap(512);
134135

135136
static enum DraftType {
136137
UNCONFIRMED,
@@ -762,12 +763,32 @@ private static Map<String, Object> extractCurrencyNames(Map<String, Object> map,
762763

763764
private static Map<String, Object> extractZoneNames(Map<String, Object> map, String id) {
764765
Map<String, Object> names = new TreeMap<>(KeyComparator.INSTANCE);
766+
var availableIds = getAvailableZoneIds();
765767

766-
getAvailableZoneIds().stream().forEach(tzid -> {
768+
availableIds.forEach(tzid -> {
767769
// If the tzid is deprecated, get the data for the replacement id
768770
String tzKey = Optional.ofNullable((String)handlerSupplMeta.get(tzid))
769771
.orElse(tzid);
772+
// Follow link, if needed
773+
var tzLink = tzdbLinks.get(tzKey);
774+
if (tzLink == null && tzdbLinks.containsValue(tzKey)) {
775+
// reverse link search
776+
// this is needed as in tzdb, "America/Buenos_Aires" links to
777+
// "America/Argentina/Buenos_Aires", but CLDR contains metaZone
778+
// "Argentina" only for "America/Buenos_Aires" (as of CLDR 44)
779+
// Both tzids should have "Argentina" meta zone names
780+
tzLink = tzdbLinks.entrySet().stream()
781+
.filter(e -> e.getValue().equals(tzKey))
782+
.map(Map.Entry::getKey)
783+
.findAny()
784+
.orElse(null);
785+
786+
}
770787
Object data = map.get(TIMEZONE_ID_PREFIX + tzKey);
788+
if (data == null && tzLink != null) {
789+
// data for tzLink
790+
data = map.get(TIMEZONE_ID_PREFIX + tzLink);
791+
}
771792

772793
if (data instanceof String[] tznames) {
773794
// Hack for UTC. UTC is an alias to Etc/UTC in CLDR
@@ -777,20 +798,36 @@ private static Map<String, Object> extractZoneNames(Map<String, Object> map, Str
777798
names.put("UTC", META_ETCUTC_ZONE_NAME);
778799
} else {
779800
// TZDB short names
801+
tznames = Arrays.copyOf(tznames, tznames.length);
780802
fillTZDBShortNames(tzid, tznames);
781803
names.put(tzid, tznames);
782804
}
783805
} else {
784806
String meta = handlerMetaZones.get(tzKey);
807+
if (meta == null && tzLink != null) {
808+
// Check for tzLink
809+
meta = handlerMetaZones.get(tzLink);
810+
}
785811
if (meta != null) {
786812
String metaKey = METAZONE_ID_PREFIX + meta;
787813
data = map.get(metaKey);
788814
if (data instanceof String[] tznames) {
789815
// TZDB short names
816+
tznames = Arrays.copyOf((String[])names.getOrDefault(metaKey, tznames), 6);
790817
fillTZDBShortNames(tzid, tznames);
791818
// Keep the metazone prefix here.
792-
names.put(metaKey, data);
819+
names.putIfAbsent(metaKey, tznames);
793820
names.put(tzid, meta);
821+
if (tzLink != null && availableIds.contains(tzLink)) {
822+
names.put(tzLink, meta);
823+
}
824+
}
825+
} else if (id.equals("root")) {
826+
// supply TZDB short names if available
827+
if (tzdbShortNamesMap.containsKey(tzid)) {
828+
var tznames = new String[6];
829+
fillTZDBShortNames(tzid, tznames);
830+
names.put(tzid, tznames);
794831
}
795832
}
796833
}
@@ -1263,7 +1300,7 @@ private static Map<Locale, String> coverageLevelsMap() throws Exception {
12631300
}
12641301

12651302
/*
1266-
* Generates two maps from TZ database files, where they have usual abbreviation
1303+
* Generates three maps from TZ database files, where they have usual abbreviation
12671304
* of the time zone names as "FORMAT".
12681305
*
12691306
* `tzdbShortNamesMap` maps the time zone id, such as "America/Los_Angeles" to
@@ -1273,53 +1310,46 @@ private static Map<Locale, String> coverageLevelsMap() throws Exception {
12731310
*
12741311
* "America/Los_Angeles" -> "P%sT<NBSP>US"
12751312
*
1276-
* The other map, `tzdbSubstLetters` maps the Rule to its substitution letters.
1313+
* The map, `tzdbSubstLetters` maps the Rule to its substitution letters.
12771314
* The key of the map is the Rule name, appended with "<NBSP>std" or "<NBSP>dst"
12781315
* depending on the savings, e.g.,
12791316
*
12801317
* "US<NBSP>std" -> "S"
12811318
* "US<NBSP>dst" -> "D"
12821319
*
1283-
* These two mappings resolve the short names for time zones in each type,
1320+
* These mappings resolve the short names for time zones in each type,
12841321
* such as:
12851322
*
12861323
* Standard short name for "America/Los_Angeles" -> "PST"
12871324
* DST short name for "America/Los_Angeles" -> "PDT"
12881325
* Generic short name for "America/Los_Angeles" -> "PT"
1326+
*
1327+
* The map, `tzdbLinks` retains `Link`s of time zones. For example,
1328+
* the mapping:
1329+
*
1330+
* "US/Hawaii" -> "Pacific/Honolulu"
1331+
*
1332+
* resolves names for "US/Hawaii" correctly with "Pacific/Honolulu"
1333+
* names.
12891334
*/
12901335
private static void generateTZDBShortNamesMap() throws IOException {
12911336
Files.walk(Path.of(tzDataDir), 1, FileVisitOption.FOLLOW_LINKS)
1292-
.filter(p -> p.toFile().isFile() && !p.endsWith("jdk11_backward"))
1337+
.filter(p -> p.toFile().isFile())
12931338
.forEach(p -> {
12941339
try {
12951340
String zone = null;
12961341
String rule = null;
12971342
String format = null;
12981343
boolean inVanguard = false;
1299-
boolean inRearguard = false;
13001344
for (var line : Files.readAllLines(p)) {
1301-
// Interpret the line in rearguard mode so that STD/DST
1302-
// correctly handles negative DST cases, such as "GMT/IST"
1303-
// vs. "IST/GMT" case for Europe/Dublin
1304-
if (inVanguard) {
1305-
if (line.startsWith("# Rearguard")) {
1306-
inVanguard = false;
1307-
inRearguard = true;
1308-
}
1309-
continue;
1310-
} else if (line.startsWith("# Vanguard")) {
1345+
// check for Vanguard lines
1346+
if (line.startsWith("# Vanguard section")) {
13111347
inVanguard = true;
13121348
continue;
13131349
}
1314-
if (inRearguard) {
1315-
if (line.startsWith("# End of rearguard")) {
1316-
inRearguard = false;
1317-
continue;
1318-
} else {
1319-
if (line.startsWith("#\t")) {
1320-
line = line.substring(1); // omit #
1321-
}
1322-
}
1350+
if (inVanguard && line.startsWith("# Rearguard section")) {
1351+
inVanguard = false;
1352+
continue;
13231353
}
13241354
if (line.isBlank() || line.matches("^[ \t]*#.*")) {
13251355
// ignore blank/comment lines
@@ -1336,7 +1366,7 @@ private static void generateTZDBShortNamesMap() throws IOException {
13361366
var zl = line.split("[ \t]+", -1);
13371367
zone = zl[1];
13381368
rule = zl[3];
1339-
format = zl[4];
1369+
format = flipIfNeeded(inVanguard, zl[4]);
13401370
} else {
13411371
if (zone != null) {
13421372
if (line.startsWith("Rule") ||
@@ -1348,7 +1378,7 @@ private static void generateTZDBShortNamesMap() throws IOException {
13481378
} else {
13491379
var s = line.split("[ \t]+", -1);
13501380
rule = s[2];
1351-
format = s[3];
1381+
format = flipIfNeeded(inVanguard, s[3]);
13521382
}
13531383
}
13541384
}
@@ -1359,18 +1389,42 @@ private static void generateTZDBShortNamesMap() throws IOException {
13591389
tzdbSubstLetters.put(rl[1] + NBSP + (rl[8].equals("0") ? STD : DST),
13601390
rl[9].replace(NO_SUBST, ""));
13611391
}
1392+
1393+
// Link line
1394+
if (line.startsWith("Link")) {
1395+
var ll = line.split("[ \t]+", -1);
1396+
tzdbLinks.put(ll[2], ll[1]);
1397+
}
1398+
}
1399+
1400+
// Last entry
1401+
if (zone != null) {
1402+
tzdbShortNamesMap.put(zone, format + NBSP + rule);
13621403
}
13631404
} catch (IOException ioe) {
13641405
throw new UncheckedIOException(ioe);
13651406
}
13661407
});
13671408
}
13681409

1410+
// Reverse the std/dst FORMAT in Vanguard so that it
1411+
// correctly handles negative DST cases, such as "GMT/IST"
1412+
// vs. "IST/GMT" case for Europe/Dublin
1413+
private static String flipIfNeeded(boolean inVanguard, String format) {
1414+
if (inVanguard) {
1415+
var stddst = format.split("/");
1416+
if (stddst.length == 2) {
1417+
return stddst[1] + "/" + stddst[0];
1418+
}
1419+
}
1420+
return format;
1421+
}
1422+
13691423
/*
13701424
* Fill the TZDB short names if there is no name provided by the CLDR
13711425
*/
13721426
private static void fillTZDBShortNames(String tzid, String[] names) {
1373-
var val = tzdbShortNamesMap.get(tzid);
1427+
var val = tzdbShortNamesMap.get(tzdbLinks.getOrDefault(tzid, tzid));
13741428
if (val != null) {
13751429
var format = val.split(NBSP)[0];
13761430
var rule = val.split(NBSP)[1];

0 commit comments

Comments
 (0)