I89CDN: upgrade to jdk17.0.9-ga

This commit is contained in:
kuenking111 2023-10-19 15:55:24 +08:00
parent ee109ab1de
commit ce307d4116
5 changed files with 16 additions and 139 deletions

View File

@ -3,8 +3,6 @@ Date: Wed, 4 Jan 2023 20:41:20 +0800
Subject: 8253495: CDS generates non-deterministic output
---
make/GenerateLinkOptData.gmk | 7 +-
.../build/tools/classlist/SortClasslist.java | 79 +++++++++++++++++++
make/scripts/compare.sh | 8 +-
src/hotspot/share/cds/archiveBuilder.cpp | 5 +-
src/hotspot/share/cds/archiveUtils.hpp | 5 +-
@ -18,129 +16,13 @@ Subject: 8253495: CDS generates non-deterministic output
.../cds/appcds/javaldr/LockDuringDump.java | 4 +-
.../appcds/javaldr/LockDuringDumpAgent.java | 16 +++-
test/lib/jdk/test/lib/cds/CDSOptions.java | 33 ++++++--
15 files changed, 191 insertions(+), 35 deletions(-)
13 files changed, 103 insertions(+), 33 deletions(-)
create mode 100644 make/jdk/src/classes/build/tools/classlist/SortClasslist.java
diff --git a/make/GenerateLinkOptData.gmk b/make/GenerateLinkOptData.gmk
index 0de28d643..5dd766c8c 100644
--- a/make/GenerateLinkOptData.gmk
+++ b/make/GenerateLinkOptData.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -88,7 +88,10 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST
$(CAT) $(LINK_OPT_DIR)/stderr $(JLI_TRACE_FILE) ; \
exit $$exitcode \
)
- $(GREP) -v HelloClasslist $@.raw.2 > $@
+ $(GREP) -v HelloClasslist $@.raw.2 > $@.raw.3
+ $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java \
+ -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
+ build.tools.classlist.SortClasslist $@.raw.3 > $@
# The jli trace is created by the same recipe as classlist. By declaring these
# dependencies, make will correctly rebuild both jli trace and classlist
diff --git a/make/jdk/src/classes/build/tools/classlist/SortClasslist.java b/make/jdk/src/classes/build/tools/classlist/SortClasslist.java
new file mode 100644
index 000000000..cf9e55a7b
--- /dev/null
+++ b/make/jdk/src/classes/build/tools/classlist/SortClasslist.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, Huawei Technologies Co., Ltd. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * This application is meant to be run to create a classlist file representing
+ * common use.
+ *
+ * The classlist is produced by adding -XX:DumpLoadedClassList=classlist
+ */
+package build.tools.classlist;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+import java.util.Scanner;
+
+/**
+ * The classlist generated by build.tools.classlist.HelloClasslist
+ * may have non-deterministic contents, affected by Java thread execution order.
+ * SortClasslist sorts the file to make the JDK image's contents more deterministic.
+ */
+public class SortClasslist {
+ public static void main(String args[]) throws FileNotFoundException {
+ ArrayList<String> classes = new ArrayList<>();
+ ArrayList<String> lambdas = new ArrayList<>();
+
+ FileInputStream fis = new FileInputStream(args[0]);
+ Scanner scanner = new Scanner(fis);
+ while (scanner.hasNextLine()) {
+ String line = scanner.nextLine();
+ if (line.startsWith("#")) {
+ // Comments -- print them first without sorting. These appear only at the top
+ // of the file.
+ System.out.println(line);
+ } else if (line.startsWith("@")) {
+ // @lambda-form-invoker, @lambda-proxy, etc.
+ lambdas.add(line);
+ } else {
+ classes.add(line);
+ }
+ }
+
+ Collections.sort(classes);
+ Collections.sort(lambdas);
+
+ for (String s : classes) {
+ System.out.println(s);
+ }
+ for (String s : lambdas) {
+ System.out.println(s);
+ }
+ }
+}
diff --git a/make/scripts/compare.sh b/make/scripts/compare.sh
index b33c80c78..324529d70 100644
index 76c3a0684..023299771 100644
--- a/make/scripts/compare.sh
+++ b/make/scripts/compare.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -325,7 +325,7 @@ compare_general_files() {
! -name "*.cpl" ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \
! -name "*.lib" ! -name "*.jmod" ! -name "*.exe" \
@ -150,17 +32,6 @@ index b33c80c78..324529d70 100644
! -name "*.map" \
| $GREP -v "./bin/" | $SORT | $FILTER)
@@ -357,8 +357,8 @@ compare_general_files() {
"
$CAT $OTHER_DIR/$f | eval "$SVG_FILTER" > $OTHER_FILE
$CAT $THIS_DIR/$f | eval "$SVG_FILTER" > $THIS_FILE
- elif [[ "$f" = *"/lib/classlist" ]] || [ "$SUFFIX" = "jar_contents" ]; then
- # The classlist files may have some lines in random order
+ elif [ "$SUFFIX" = "jar_contents" ]; then
+ # The jar_contents files may have some lines in random order
OTHER_FILE=$WORK_DIR/$f.other
THIS_FILE=$WORK_DIR/$f.this
$MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE)
diff --git a/src/hotspot/share/cds/archiveBuilder.cpp b/src/hotspot/share/cds/archiveBuilder.cpp
index 699926fcf..8e12cdabb 100644
--- a/src/hotspot/share/cds/archiveBuilder.cpp

View File

@ -357,13 +357,14 @@ index 7e5bb9ae5..83a652a8e 100644
* @test TestStringDeduplicationFullGC
* @summary Test string deduplication during full GC
diff --git a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java
index 072f10e10..145adb946 100644
index a5720b88e..a39419f0a 100644
--- a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java
+++ b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java
@@ -36,6 +36,19 @@ package gc.stringdedup;
* @run driver gc.stringdedup.TestStringDeduplicationInterned G1
@@ -48,6 +48,20 @@ package gc.stringdedup;
* java.management
* @run driver gc.stringdedup.TestStringDeduplicationInterned Shenandoah
*/
+
+/*
+ * @test TestStringDeduplicationInterned
+ * @summary Test string deduplication of interned strings

View File

@ -13,7 +13,7 @@ index 000000000..b717bafbe
--- /dev/null
+++ b/version.txt
@@ -0,0 +1 @@
+17.0.8.0.13
+17.0.9.0.13
--
2.19.0

View File

@ -161,7 +161,7 @@
# Used via new version scheme. JDK 17 was
# GA'ed in March 2021 => 21.9
%global vendor_version_string 21.9
%global securityver 8
%global securityver 9
# buildjdkver is usually same as %%{majorver},
# but in time of bootstrap of next jdk, it is majorver-1,
# and this it is better to change it here, on single place
@ -181,7 +181,7 @@
%global origin_nice OpenJDK
%global top_level_dir_name %{origin}
%global minorver 0
%global buildver 7
%global buildver 8
# priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit
%if %is_system_jdk
%global priority %( printf '%02d%02d%02d%02d' %{majorver} %{minorver} %{securityver} %{buildver} )
@ -891,7 +891,7 @@ Provides: java-src%{?1} = %{epoch}:%{version}-%{release}
Name: java-%{javaver}-%{origin}
Version: %{newjavaver}.%{buildver}
Release: 2
Release: 0
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
@ -1821,6 +1821,11 @@ cjc.mainProgram(arg)
%changelog
* Tue Oct 17 2023 kuenking111 <wangkun49@huawei.com> - 1:17.0.9.8-0.rolling
- fix 8253495-CDS-generates-non-deterministic-outpu.patch
- fix add-8267185-Add-string-deduplication-support-to.patch
- fix add-version-txt.patch
* Mon Sep 25 2023 kuenking111 <wangkun49@huawei.com> - 1:17.0.8.7-2
- add add-Parallel-Full-gc-mark-stack-draining-should.patch
- add add-8271579-G1-Move-copy-before-CAS-in-do_copy.patch