From 030257700b910a4757bbe8d220c14828967f2f52 Mon Sep 17 00:00:00 2001 From: Jiri Date: Wed, 14 Jun 2023 21:59:48 +0200 Subject: [PATCH 01/86] Redeclared ForFiles release sections as %%nil no longer works with %%1 RPM 4.19 no longer accept our double percentaged %%{nil} passed to %%{1} so we have to pass in "" but evaluate it, otherwise files record will include it --- java-latest-openjdk-portable.spec | 51 +++++++++++++++++++------------ 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index a1153c8..5139467 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -391,7 +391,7 @@ %global top_level_dir_name %{origin} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 9 -%global rpmrelease 3 +%global rpmrelease 4 # 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 # Using 10 digits may overflow the int used for priority, so we combine the patch and build versions @@ -472,6 +472,14 @@ # top of the JDK archive %define staticlibsportablename() %{expand:%{jdkportablenameimpl -- %%{1}}} +# RPM 4.19 no longer accept our double percentaged %%{nil} passed to %%{1} +# so we have to pass in "" but evaluate it, otherwise files record will include it +%define jreportablearchiveForFiles() %(echo %{jreportablearchive -- ""}) +%define jdkportablearchiveForFiles() %(echo %{jdkportablearchive -- ""}) +%define jdkportablesourcesarchiveForFiles() %(echo %{jdkportablesourcesarchive -- ""}) +%define staticlibsportablearchiveForFiles() %(echo %{staticlibsportablearchive -- ""}) +%define jdkportablesourcesnameForFiles() %(echo %{jdkportablesourcesname -- ""}) + ################################################################# # fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349 # https://bugzilla.redhat.com/show_bug.cgi?id=1590796#c14 @@ -1556,9 +1564,9 @@ done %if %{include_normal_build} %files # main package builds always -%{_jvmdir}/%{jreportablearchive -- %%{nil}} -%{_jvmdir}/%{jreportablearchive -- %%{nil}}.sha256sum -%license %{unpacked_licenses}/%{jdkportablesourcesarchive -- %%{nil}} +%{_jvmdir}/%{jreportablearchiveForFiles} +%{_jvmdir}/%{jreportablearchiveForFiles}.sha256sum +%license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %else %files # placeholder @@ -1566,19 +1574,19 @@ done %if %{include_normal_build} %files devel -%{_jvmdir}/%{jdkportablearchive -- %%{nil}} +%{_jvmdir}/%{jdkportablearchiveForFiles} #%{_jvmdir}/%{jdkportablearchive -- .debuginfo} -%{_jvmdir}/%{jdkportablearchive -- %%{nil}}.sha256sum +%{_jvmdir}/%{jdkportablearchiveForFiles}.sha256sum #%{_jvmdir}/%{jdkportablearchive -- .debuginfo}.sha256sum -%license %{unpacked_licenses}/%{jdkportablesourcesarchive -- %%{nil}} +%license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %endif %if %{include_normal_build} %if %{include_staticlibs} %files static-libs -%{_jvmdir}/%{staticlibsportablearchive -- %%{nil}} -%{_jvmdir}/%{staticlibsportablearchive -- %%{nil}}.sha256sum -%license %{unpacked_licenses}/%{jdkportablesourcesarchive -- %%{nil}} +%{_jvmdir}/%{staticlibsportablearchiveForFiles} +%{_jvmdir}/%{staticlibsportablearchiveForFiles}.sha256sum +%license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %endif %endif @@ -1586,18 +1594,18 @@ done %files slowdebug %{_jvmdir}/%{jreportablearchive -- .slowdebug} %{_jvmdir}/%{jreportablearchive -- .slowdebug}.sha256sum -%license %{unpacked_licenses}/%{jdkportablesourcesarchive -- %%{nil}} +%license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %files devel-slowdebug %{_jvmdir}/%{jdkportablearchive -- .slowdebug} %{_jvmdir}/%{jdkportablearchive -- .slowdebug}.sha256sum -%license %{unpacked_licenses}/%{jdkportablesourcesarchive -- %%{nil}} +%license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %if %{include_staticlibs} %files static-libs-slowdebug %{_jvmdir}/%{staticlibsportablearchive -- .slowdebug} %{_jvmdir}/%{staticlibsportablearchive -- .slowdebug}.sha256sum -%license %{unpacked_licenses}/%{jdkportablesourcesarchive -- %%{nil}} +%license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %endif %endif @@ -1605,27 +1613,32 @@ done %files fastdebug %{_jvmdir}/%{jreportablearchive -- .fastdebug} %{_jvmdir}/%{jreportablearchive -- .fastdebug}.sha256sum -%license %{unpacked_licenses}/%{jdkportablesourcesarchive -- %%{nil}} +%license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %files devel-fastdebug %{_jvmdir}/%{jdkportablearchive -- .fastdebug} %{_jvmdir}/%{jdkportablearchive -- .fastdebug}.sha256sum -%license %{unpacked_licenses}/%{jdkportablesourcesarchive -- %%{nil}} +%license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %if %{include_staticlibs} %files static-libs-fastdebug %{_jvmdir}/%{staticlibsportablearchive -- .fastdebug} %{_jvmdir}/%{staticlibsportablearchive -- .fastdebug}.sha256sum -%license %{unpacked_licenses}/%{jdkportablesourcesarchive -- %%{nil}} +%license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %endif %endif %files sources -%{_jvmdir}/%{jdkportablesourcesarchive -- %%{nil}} -%{_jvmdir}/%{jdkportablesourcesarchive -- %%{nil}}.sha256sum -%license %{unpacked_licenses}/%{jdkportablesourcesarchive -- %%{nil}} +%{_jvmdir}/%{jdkportablesourcesarchiveForFiles} +%{_jvmdir}/%{jdkportablesourcesarchiveForFiles}.sha256sum +%license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %changelog +* Mon May 15 2023 Jiri Vanek - 1:20.0.1.0.9-4.rolling +- Redeclared ForFiles release sections as %%nil no longer works with %%1 +- RPM 4.19 no longer accept our double percentaged %%{nil} passed to %%{1} +- so we have to pass in "" but evaluate it, otherwise files record will include it + * Mon May 15 2023 Jiri Vanek - 1:20.0.1.0.9-3.rolling - no longer using system cacerts during build - they are already mv-ed as .upstream in rpms From 3cc86460bc71caa08e6acd81bf11337bb7d85df1 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Tue, 27 Jun 2023 11:30:56 +0000 Subject: [PATCH 02/86] Simplify portable archive name macros Avoid using fragile regex and instead match on "%{version}-%{release}" to do the substitutions. This should make it both simpler (avoiding separate rhel7 conditional) and more robust in case the build system sets a different dist tag than what the regex expected. --- java-latest-openjdk-portable.spec | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 5139467..7cd4c1e 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -391,7 +391,7 @@ %global top_level_dir_name %{origin} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 9 -%global rpmrelease 4 +%global rpmrelease 5 # 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 # Using 10 digits may overflow the int used for priority, so we combine the patch and build versions @@ -450,17 +450,10 @@ %define uniquesuffix() %{expand:%{fullversion}.%{_arch}%{?1}} # portable only declarations %global jreimage jre -%if (0%{?rhel} > 0 && 0%{?rhel} < 8) -%define jreportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;el7\\(_[0-9]\\)*;portable%{1}.jre.;g" | sed "s;openjdkportable;el;g") -%define jdkportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;el7\\(_[0-9]\\)*;portable%{1}.jdk.;g" | sed "s;openjdkportable;el;g") -%define jdkportablesourcesnameimpl() %(echo %{uniquesuffix ""} | sed "s;el7\\(_[0-9]\\)*;portable%{1}.sources.;g" | sed "s;openjdkportable;el;g" | sed "s;.%{_arch};.noarch;g") -%define staticlibsportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;el7\\(_[0-9]\\)*;portable%{1}.static-libs.;g" | sed "s;openjdkportable;el;g") -%else -%define jreportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;fc\\([0-9]\\)*;\\0.portable%{1}.jre;g" | sed "s;openjdkportable;el;g") -%define jdkportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;fc\\([0-9]\\)*;\\0.portable%{1}.jdk;g" | sed "s;openjdkportable;el;g") -%define jdkportablesourcesnameimpl() %(echo %{uniquesuffix ""} | sed "s;fc\\([0-9]\\)*;\\0.portable%{1}.sources;g" | sed "s;openjdkportable;el;g" | sed "s;.%{_arch};.noarch;g") -%define staticlibsportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;fc\\([0-9]\\)*;\\0.portable%{1}.static-libs;g" | sed "s;openjdkportable;el;g") -%endif +%define jreportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.jre;g" | sed "s;openjdkportable;el;g") +%define jdkportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.jdk;g" | sed "s;openjdkportable;el;g") +%define jdkportablesourcesnameimpl() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.sources;g" | sed "s;openjdkportable;el;g" | sed "s;.%{_arch};.noarch;g") +%define staticlibsportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.static-libs;g" | sed "s;openjdkportable;el;g") %define jreportablearchive() %{expand:%{jreportablenameimpl -- %%{1}}.tar.xz} %define jdkportablearchive() %{expand:%{jdkportablenameimpl -- %%{1}}.tar.xz} %define jdkportablesourcesarchive() %{expand:%{jdkportablesourcesnameimpl -- %%{1}}.tar.xz} @@ -1634,6 +1627,9 @@ done %license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %changelog +* Tue Jun 27 2023 Kalev Lember - 1:20.0.1.0.9-5.rolling +- Simplify portable archive name macros + * Mon May 15 2023 Jiri Vanek - 1:20.0.1.0.9-4.rolling - Redeclared ForFiles release sections as %%nil no longer works with %%1 - RPM 4.19 no longer accept our double percentaged %%{nil} passed to %%{1} From ca9d901084a4565bb7fe3326ed7f9d517af41c6a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jul 2023 07:54:02 +0000 Subject: [PATCH 03/86] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- java-latest-openjdk-portable.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 7cd4c1e..8364bc6 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -561,7 +561,7 @@ Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as # java-X-openjdk. See: https://bugzilla.redhat.com/show_bug.cgi?id=1647298 -Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist} +Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist}.1 # 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 # also included the epoch in their virtual provides. This created a @@ -1627,6 +1627,9 @@ done %license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %changelog +* Thu Jul 20 2023 Fedora Release Engineering - 1:20.0.1.0.9-5.rolling.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Tue Jun 27 2023 Kalev Lember - 1:20.0.1.0.9-5.rolling - Simplify portable archive name macros From d4939813c159ef71142a9c2ef8b1fed01e4915b7 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Thu, 3 Aug 2023 18:24:31 +0200 Subject: [PATCH 04/86] Updated to 20.0.2 --- .gitignore | 1 + NEWS | 38 +++++++++++++++++++++++++++++++ java-latest-openjdk-portable.spec | 8 +++++-- sources | 2 +- 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 882a87e..8540e85 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ /openjdk-jdk19u-jdk-19.0.2+7.tar.xz /openjdk-jdk20u-jdk-20+36.tar.xz /openjdk-jdk20u-jdk-20.0.1+9.tar.xz +/openjdk-jdk20u-jdk-20.0.2+9.tar.xz diff --git a/NEWS b/NEWS index 3eb277e..9e7234f 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,44 @@ Key: JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY +New in release OpenJDK 20.0.2 (2023-07-18): +=========================================== +* CVEs + - CVE-2023-22041 + - CVE-2023-22051 + - CVE-2023-25193 + - CVE-2023-22044 + - CVE-2023-22045 + - CVE-2023-22049 + - CVE-2023-22036 + - CVE-2023-22006 +* Other changes + - JDK-8208077: File.listRoots performance degradation + - JDK-8304741 C2 Intrinsification of Float.floatToFloat16 and Float.float16ToFloat Yields Different Result than the Interpreter + - JDK-8306763 GHA: MSVC installation is failing + - JDK-8304075 Consider removal of expiry check in VerifyCACerts.java test + - JDK-8304077 The "ZonedDateTime.parse" may not accept the "UTC+XX" zone id + - JDK-8304227 Corrupted heap dumps due to missing retries for os::write() + - JDK-8304424 Update HarfBuzz to 7.0.1 + - JDK-8304887 javax/swing/JFileChooser/4847375/bug4847375.java fails with AssertionError + - JDK-8305123 javac regression: Compilation with --release 8 fails on underscore in enum identifiers + - JDK-8305537 Use default visibility for static library builds + - JDK-8305540 ArrayFill with store on backedge needs to reduce length by 1 + - JDK-8305541 C2: Div/Mod nodes without zero check could be split through iv phi of loop resulting in SIGFPE + - JDK-8305542 C2: PhaseCFG::convert_NeverBranch_to_Goto must handle both orders of successors + - JDK-8305546 C2: Arraycopy intrinsic throws incorrect exception + - JDK-8305548 use-after-free related to GraphKit::clone_map + - JDK-8305549 SIGSEGV in LibraryCallKit::inline_string_copy due to constant NULL src argument + - JDK-8305550 C2: CmpU::Value must filter overflow computation against local sub computation + - JDK-8305551 C2 compiled code crashes with SIGFPE with -XX:+StressLCM and -XX:+StressGCM + - JDK-8305554 C2: java.lang.StringUTF16::indexOfChar intrinsic called with negative character argument + - JDK-8305555 C2: assert(get_ctrl(n) == cle_out) during unrolling + - JDK-8305557 Vector.lane() gets wrong value on x86 + +The full list of changes in 20u can be found at: +- * https://builds.shipilev.net/backports-monitor/release-notes-20.0.2.txt +- * https://builds.shipilev.net/backports-monitor/pushes-20.0.2.txt + New in release OpenJDK 20.0.1 (2023-04-18): =========================================== diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 8364bc6..e69d40b 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -333,7 +333,7 @@ # New Version-String scheme-style defines %global featurever 20 %global interimver 0 -%global updatever 1 +%global updatever 2 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, @@ -391,7 +391,7 @@ %global top_level_dir_name %{origin} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 9 -%global rpmrelease 5 +%global rpmrelease 1 # 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 # Using 10 digits may overflow the int used for priority, so we combine the patch and build versions @@ -1627,6 +1627,10 @@ done %license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %changelog +* Thu Aug 03 2023 Jiri Vanek - 1:20.0.2.0.9-1.rolling +- Update to jdk-20.0.2+9 +- Update release notes to 20.0.2+9 + * Thu Jul 20 2023 Fedora Release Engineering - 1:20.0.1.0.9-5.rolling.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild diff --git a/sources b/sources index d90c787..c44230f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-jdk20u-jdk-20.0.1+9.tar.xz) = 41585ff383497464e5d6c278b39bed9eeddc80add72b65bd2ab8c95867ce5bc8bfb0ea860fcaf7c4cc5d41122fd62cf3348fa6c788a1978bdc7f20c3d0289b9b +SHA512 (openjdk-jdk20u-jdk-20.0.2+9.tar.xz) = ce5383228c42f612e79e65300c048e91ec3ae5941b6769c67c05aa4e98299f8044b2945e64cd38b2e60f3c7558e608a3baa20cf7af2b0108d48c865a71ee1979 From 78e31cb2a6834c9ae130eccd045509e51770be34 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Thu, 3 Aug 2023 18:39:00 +0200 Subject: [PATCH 05/86] Finished release notes --- NEWS | 114 ++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 93 insertions(+), 21 deletions(-) diff --git a/NEWS b/NEWS index 9e7234f..256b111 100644 --- a/NEWS +++ b/NEWS @@ -14,28 +14,100 @@ New in release OpenJDK 20.0.2 (2023-07-18): - CVE-2023-22049 - CVE-2023-22036 - CVE-2023-22006 +* Security fixes + - JDK-8299945: Update the release version after forking Apr CPU23_04 + - JDK-8299946: Update the Jul CPU23_07 release date in master branch after forking Apr CPU23_04 + - JDK-8299129: Enhance NameService lookups + - JDK-8295304: Runtime support improvements + - JDK-8300285: Enhance TLS data handling + - JDK-8298676: Enhanced Look and Feel + - JDK-8304460: Improve array usages + - JDK-8304468: Better array usages + - JDK-8302483: Enhance ZIP performance + - JDK-8305565: Incorrect milestone for release JDK 20.0.2 + - JDK-8300596: Enhance Jar Signature validation + - JDK-8302475: Enhance HTTP client file downloading + - JDK-8305421: Work around JDK-8305420 in CDSJDITest.java + - JDK-8294323: Improve Shared Class Data + - JDK-8305312: Enhanced path handling + - JDK-8296565: Enhanced archival support + - JDK-8306049: Change milestone to fcs for all releases + - JDK-8303376: Better launching of JDI + - JDK-8308682: Enhance AES performance * Other changes - - JDK-8208077: File.listRoots performance degradation - - JDK-8304741 C2 Intrinsification of Float.floatToFloat16 and Float.float16ToFloat Yields Different Result than the Interpreter - - JDK-8306763 GHA: MSVC installation is failing - - JDK-8304075 Consider removal of expiry check in VerifyCACerts.java test - - JDK-8304077 The "ZonedDateTime.parse" may not accept the "UTC+XX" zone id - - JDK-8304227 Corrupted heap dumps due to missing retries for os::write() - - JDK-8304424 Update HarfBuzz to 7.0.1 - - JDK-8304887 javax/swing/JFileChooser/4847375/bug4847375.java fails with AssertionError - - JDK-8305123 javac regression: Compilation with --release 8 fails on underscore in enum identifiers - - JDK-8305537 Use default visibility for static library builds - - JDK-8305540 ArrayFill with store on backedge needs to reduce length by 1 - - JDK-8305541 C2: Div/Mod nodes without zero check could be split through iv phi of loop resulting in SIGFPE - - JDK-8305542 C2: PhaseCFG::convert_NeverBranch_to_Goto must handle both orders of successors - - JDK-8305546 C2: Arraycopy intrinsic throws incorrect exception - - JDK-8305548 use-after-free related to GraphKit::clone_map - - JDK-8305549 SIGSEGV in LibraryCallKit::inline_string_copy due to constant NULL src argument - - JDK-8305550 C2: CmpU::Value must filter overflow computation against local sub computation - - JDK-8305551 C2 compiled code crashes with SIGFPE with -XX:+StressLCM and -XX:+StressGCM - - JDK-8305554 C2: java.lang.StringUTF16::indexOfChar intrinsic called with negative character argument - - JDK-8305555 C2: assert(get_ctrl(n) == cle_out) during unrolling - - JDK-8305557 Vector.lane() gets wrong value on x86 + - JDK-8304741: C2 Intrinsification of Float.floatToFloat16 and Float.float16ToFloat Yields Different Result than the Interpreter + - JDK-8306763: GHA: MSVC installation is failing + - JDK-8304075: Consider removal of expiry check in VerifyCACerts.java test + - JDK-8304077: The "ZonedDateTime.parse" may not accept the "UTC+XX" zone id + - JDK-8304227: Corrupted heap dumps due to missing retries for os::write() + - JDK-8304424: Update HarfBuzz to 7.0.1 + - JDK-8304887: javax/swing/JFileChooser/4847375/bug4847375.java fails with AssertionError + - JDK-8305123: javac regression: Compilation with --release 8 fails on underscore in enum identifiers + - JDK-8305537: Use default visibility for static library builds + - JDK-8305540: ArrayFill with store on backedge needs to reduce length by 1 + - JDK-8305541: C2: Div/Mod nodes without zero check could be split through iv phi of loop resulting in SIGFPE + - JDK-8305542: C2: PhaseCFG::convert_NeverBranch_to_Goto must handle both orders of successors + - JDK-8305546: C2: Arraycopy intrinsic throws incorrect exception + - JDK-8305548: use-after-free related to GraphKit::clone_map + - JDK-8305549: SIGSEGV in LibraryCallKit::inline_string_copy due to constant NULL src argument + - JDK-8305550: C2: CmpU::Value must filter overflow computation against local sub computation + - JDK-8305551: C2 compiled code crashes with SIGFPE with -XX:+StressLCM and -XX:+StressGCM + - JDK-8305554: C2: java.lang.StringUTF16::indexOfChar intrinsic called with negative character argument + - JDK-8305555: C2: assert(get_ctrl(n) == cle_out) during unrolling + - JDK-8305557: Vector.lane() gets wrong value on x86 + - JDK-8305558: [JVMCI] Insufficient error handling when CodeBuffer is exhausted + - JDK-8305560: C2: "Bad graph detected in build_loop_late" after a CMove is wrongly split thru phi + - JDK-8305561: DebugNonSafepoints generates incorrect information + - JDK-8305850: Fastdebug build fails after JDK-8296389 + - JDK-8305851: use-def assert: special case undetected loops nested in infinite loops + - JDK-8305865: (tz) Update Timezone Data to 2023c + - JDK-8305876: Special case infinite loops with unmerged backedges in IdealLoopTree::check_safepts + - JDK-8306319: Add the runtime version in the release file of a JDK image + - JDK-8306478: On the latest macOS+XCode the Robot API may report wrong colors + - JDK-8306750: Upgrade JLine to 3.22.0 + - JDK-8306751: JShell does not switch to raw mode when there is no /bin/test + - JDK-8306771: [AIX] Broken build after JDK-8301998 + - JDK-8307107: updateIconImages may lead to deadlock after JDK-8276849 + - JDK-8307111: Shenandoah evacuation workers may deadlock + - JDK-8307112: GHA: MSVC installation could be optional since it might already be pre-installed + - JDK-8307151: Shenandoah: Missing barriers on deoptimization path + - JDK-8307364: Make runtime/Monitor/GuaranteedAsyncDeflationIntervalTest.java more reliable + - JDK-8307372: Add TWCA Global Root CA + - JDK-8307373: Add 2 Microsoft TLS roots + - JDK-8307391: Monitor deflation might be accidentally disabled by zero intervals + - JDK-8307631: Add GTS root CAs + - JDK-8308008: java.time.Instant calculation bug in until and between methods + - JDK-8309850: ConcurrentModificationException in javadoc tool + - JDK-8301870: Include cdb in the Windows devkit + - JDK-8303906: Update jdk20u fix version to 20.0.2 + - JDK-8303958: Missing Classpath exception from Continuation.c + - JDK-8304417: GCC 12 reports some compiler warnings in bundled freetype + - JDK-8304981: jcmd: ManagementAgent.status truncates the text longer than O_BUFLEN + - JDK-8305545: [JVMCI] HotSpotResolvedJavaMethodImpl.canBeInlined must respect ForceInline + - JDK-8305547: use-after-free in Node::destruct + - JDK-8305552: [JVMCI] BytecodeFrame.equals is broken + - JDK-8305553: C2: assert in PhaseIdealLoop::do_unroll() is subject to undefined behavior + - JDK-8305789: Update Commons BCEL to Version 6.7.0 + - JDK-8305849: Memory leak in CompilerOracle::parse_from_line + - JDK-8305859: ProblemList runtime/CompressedOops/CompressedClassPointers.java + - JDK-8305948: Performance degradation for float/double modulo on Linux + - JDK-8306448: NoClassDefFoundError omits the original cause of an error + - JDK-8307209: Thread stacksize is reported with wrong units in os::create_thread logging + - JDK-8307360: [vectorapi] The typeChar of LaneType is incorrect when default locale is tr + - JDK-8307361: Guarantee eventual async monitor deflation + - JDK-8307380: harfbuzz build fails with GCC 7 after JDK-8301998 + - JDK-8307419: UTIL_LOOKUP_PROGS fails on pathes with space + - JDK-8307420: UTIL_REQUIRE_SPECIAL warning on grep + - JDK-8307705: Support for GB18030-2022 + - JDK-8308112: Allow collectors to provide specific values for GC notifications' actions + - JDK-8308390: Font.getStringBounds calculates wrong width for TextAttribute.TRACKING other than 0.0 + - JDK-8308418: Socket input stream read burns CPU cycles with back-to-back poll(0) calls + - JDK-8308457: [AIX] VM crashes with UseRTMLocking on Power10 + - JDK-8308693: Add missing gc+phases logging for ObjectCount(AfterGC) JFR event collection code + - JDK-8309483: PPC: Non-Top Interpreted frames should be independent of ABI_ELFv2 + - JDK-8305544: UB: Compile::_phase_optimize_finished is initialized too late + - JDK-8305556: Memory leak in WB_IsMethodCompatible + - JDK-8305559: Identical branch conditions in CompileBroker::print_heapinfo The full list of changes in 20u can be found at: - * https://builds.shipilev.net/backports-monitor/release-notes-20.0.2.txt From 27c4a8f2a99cb1f490ece8c29fe2a89fca7dad4a Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 4 Aug 2023 15:36:25 +0200 Subject: [PATCH 06/86] Removed wrong, rcms .1 --- java-latest-openjdk-portable.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index e69d40b..6d96bdf 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -561,7 +561,7 @@ Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as # java-X-openjdk. See: https://bugzilla.redhat.com/show_bug.cgi?id=1647298 -Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist}.1 +Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist} # 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 # also included the epoch in their virtual provides. This created a From dee0f272933f5c2a5e590e84d17e96577a7ce8b3 Mon Sep 17 00:00:00 2001 From: Petra Alice Mikova Date: Tue, 8 Aug 2023 14:49:30 +0200 Subject: [PATCH 07/86] Update to JDK21 ea version - initial update to jdk21 - commented out fips patches - updated to jdk21 ea - updated patch 1001 - rh1648249-add_commented_out_nss_cfg_provider_to_java_security - replaced files used for static libs smoke tests --- .gitignore | 1 + java-latest-openjdk-portable.spec | 26 ++++++++++++------- ...ut_nss_cfg_provider_to_java_security.patch | 13 +++++----- sources | 2 +- 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 8540e85..f411948 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ /openjdk-jdk20u-jdk-20+36.tar.xz /openjdk-jdk20u-jdk-20.0.1+9.tar.xz /openjdk-jdk20u-jdk-20.0.2+9.tar.xz +/openjdk-jdk21u-jdk-21+34.tar.xz diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 6d96bdf..0d8400d 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -331,14 +331,14 @@ %endif # New Version-String scheme-style defines -%global featurever 20 +%global featurever 21 %global interimver 0 -%global updatever 2 +%global updatever 0 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, # and this it is better to change it here, on single place -%global buildjdkver %{featurever} +%global buildjdkver 20 # We don't add any LTS designator for STS packages (Fedora and EPEL). # We need to explicitly exclude EPEL as it would have the %%{rhel} macro defined. %if 0%{?rhel} && !0%{?epel} @@ -390,7 +390,7 @@ %global origin_nice OpenJDK %global top_level_dir_name %{origin} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 9 +%global buildver 34 %global rpmrelease 1 # 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 @@ -417,7 +417,7 @@ # Release will be (where N is usually a number starting at 1): # - 0.N%%{?extraver}%%{?dist} for EA releases, # - N%%{?extraver}{?dist} for GA releases -%global is_ga 1 +%global is_ga 0 %if %{is_ga} %global build_type GA %global ea_designator "" @@ -692,7 +692,7 @@ Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-d # RH2104724: Avoid import/export of DH private keys # RH2092507: P11Key.getEncoded does not work for DH keys in FIPS mode # Build the systemconf library on all platforms -Patch1001: fips-20u-%{fipsver}.patch +# Patch1001: fips-20u-%{fipsver}.patch ############################################# # @@ -977,7 +977,7 @@ pushd %{top_level_dir_name} %patch3 -p1 %patch6 -p1 # Add crypto policy and FIPS support -%patch1001 -p1 +# %patch1001 -p1 # nss.cfg PKCS11 support; must come last as it also alters java.security %patch1000 -p1 popd # openjdk @@ -1151,7 +1151,6 @@ function buildjdk() { --with-boot-jdk=${buildjdk} \ --with-debug-level=${debuglevel} \ --with-native-debug-symbols="%{debug_symbols}" \ - --disable-sysconf-nss \ --enable-unlimited-crypto \ --with-zlib=%{link_type} \ --with-freetype=%{link_type} \ @@ -1534,8 +1533,8 @@ $JAVA_HOME/bin/java -Djava.locale.providers=CLDR $(echo $(basename %{SOURCE18})| %if %{include_staticlibs} # Check debug symbols in static libraries (smoke test) export STATIC_LIBS_HOME=${top_dir_abs_main_build_path}/../../%{buildoutputdir -- ${suffix}%{staticlibs_suffix}}/images/static-libs/lib/ -readelf --debug-dump $STATIC_LIBS_HOME/libfdlibm.a | grep w_remainder.c -readelf --debug-dump $STATIC_LIBS_HOME/libfdlibm.a | grep e_remainder.c +readelf --debug-dump $STATIC_LIBS_HOME/libnet.a | grep Inet4AddressImpl.c +readelf --debug-dump $STATIC_LIBS_HOME/libnet.a | grep Inet6AddressImpl.c %endif # Check src.zip has all sources. See RHBZ#1130490 @@ -1627,6 +1626,13 @@ done %license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %changelog +* Tue Aug 08 2023 Petra Alice Mikova 1:21.0.0.0.34-0.1.ea.rolling +- initial update to jdk21 +- commented out fips patches +- updated to jdk21 ea +- updated patch 1001 - rh1648249-add_commented_out_nss_cfg_provider_to_java_security +- replace smoketests in staticlibs test, as the previous files used were removed by a patch in JDK + * Thu Aug 03 2023 Jiri Vanek - 1:20.0.2.0.9-1.rolling - Update to jdk-20.0.2+9 - Update release notes to 20.0.2+9 diff --git a/rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch b/rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch index c178077..ff3a79b 100644 --- a/rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch +++ b/rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch @@ -1,12 +1,13 @@ -diff --git openjdk.orig/src/java.base/share/conf/security/java.security openjdk/src/java.base/share/conf/security/java.security -index 68a9c1a2d08..7aa25eb2cb7 100644 ---- openjdk.orig/src/java.base/share/conf/security/java.security -+++ openjdk/src/java.base/share/conf/security/java.security -@@ -78,6 +78,7 @@ security.provider.tbd=SunMSCAPI +diff --git a/src/java.base/share/conf/security/java.security b/src/java.base/share/conf/security/java.security +index 5149edba0e5..7676c695b36 100644 +--- a/src/java.base/share/conf/security/java.security ++++ b/src/java.base/share/conf/security/java.security +@@ -84,6 +84,8 @@ security.provider.tbd=SunMSCAPI security.provider.tbd=Apple #endif security.provider.tbd=SunPKCS11 +#security.provider.tbd=SunPKCS11 ${java.home}/lib/security/nss.cfg ++ # - # Security providers used when FIPS mode support is active + # A list of preferred providers for specific algorithms. These providers will diff --git a/sources b/sources index c44230f..c74d310 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-jdk20u-jdk-20.0.2+9.tar.xz) = ce5383228c42f612e79e65300c048e91ec3ae5941b6769c67c05aa4e98299f8044b2945e64cd38b2e60f3c7558e608a3baa20cf7af2b0108d48c865a71ee1979 +SHA512 (openjdk-jdk21u-jdk-21+34.tar.xz) = 18254fa72851666d9e80a56dc85052d8711794b9c7f81c3f7a80e3c585b13eab783060b04fc3b3bbddbebbb8c4148109a9e822aba2f54aa3b614fd16149017b2 From 43b5b84321eb2306baa4a3155b8475f5f24cf727 Mon Sep 17 00:00:00 2001 From: Petra Alice Mikova Date: Tue, 15 Aug 2023 10:58:47 +0200 Subject: [PATCH 08/86] Modified README.md, NEWS file --- NEWS | 287 +++++++++++++++++++----------------------------------- README.md | 2 +- 2 files changed, 99 insertions(+), 190 deletions(-) diff --git a/NEWS b/NEWS index 256b111..06591a2 100644 --- a/NEWS +++ b/NEWS @@ -3,161 +3,11 @@ Key: JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY -New in release OpenJDK 20.0.2 (2023-07-18): -=========================================== -* CVEs - - CVE-2023-22041 - - CVE-2023-22051 - - CVE-2023-25193 - - CVE-2023-22044 - - CVE-2023-22045 - - CVE-2023-22049 - - CVE-2023-22036 - - CVE-2023-22006 -* Security fixes - - JDK-8299945: Update the release version after forking Apr CPU23_04 - - JDK-8299946: Update the Jul CPU23_07 release date in master branch after forking Apr CPU23_04 - - JDK-8299129: Enhance NameService lookups - - JDK-8295304: Runtime support improvements - - JDK-8300285: Enhance TLS data handling - - JDK-8298676: Enhanced Look and Feel - - JDK-8304460: Improve array usages - - JDK-8304468: Better array usages - - JDK-8302483: Enhance ZIP performance - - JDK-8305565: Incorrect milestone for release JDK 20.0.2 - - JDK-8300596: Enhance Jar Signature validation - - JDK-8302475: Enhance HTTP client file downloading - - JDK-8305421: Work around JDK-8305420 in CDSJDITest.java - - JDK-8294323: Improve Shared Class Data - - JDK-8305312: Enhanced path handling - - JDK-8296565: Enhanced archival support - - JDK-8306049: Change milestone to fcs for all releases - - JDK-8303376: Better launching of JDI - - JDK-8308682: Enhance AES performance -* Other changes - - JDK-8304741: C2 Intrinsification of Float.floatToFloat16 and Float.float16ToFloat Yields Different Result than the Interpreter - - JDK-8306763: GHA: MSVC installation is failing - - JDK-8304075: Consider removal of expiry check in VerifyCACerts.java test - - JDK-8304077: The "ZonedDateTime.parse" may not accept the "UTC+XX" zone id - - JDK-8304227: Corrupted heap dumps due to missing retries for os::write() - - JDK-8304424: Update HarfBuzz to 7.0.1 - - JDK-8304887: javax/swing/JFileChooser/4847375/bug4847375.java fails with AssertionError - - JDK-8305123: javac regression: Compilation with --release 8 fails on underscore in enum identifiers - - JDK-8305537: Use default visibility for static library builds - - JDK-8305540: ArrayFill with store on backedge needs to reduce length by 1 - - JDK-8305541: C2: Div/Mod nodes without zero check could be split through iv phi of loop resulting in SIGFPE - - JDK-8305542: C2: PhaseCFG::convert_NeverBranch_to_Goto must handle both orders of successors - - JDK-8305546: C2: Arraycopy intrinsic throws incorrect exception - - JDK-8305548: use-after-free related to GraphKit::clone_map - - JDK-8305549: SIGSEGV in LibraryCallKit::inline_string_copy due to constant NULL src argument - - JDK-8305550: C2: CmpU::Value must filter overflow computation against local sub computation - - JDK-8305551: C2 compiled code crashes with SIGFPE with -XX:+StressLCM and -XX:+StressGCM - - JDK-8305554: C2: java.lang.StringUTF16::indexOfChar intrinsic called with negative character argument - - JDK-8305555: C2: assert(get_ctrl(n) == cle_out) during unrolling - - JDK-8305557: Vector.lane() gets wrong value on x86 - - JDK-8305558: [JVMCI] Insufficient error handling when CodeBuffer is exhausted - - JDK-8305560: C2: "Bad graph detected in build_loop_late" after a CMove is wrongly split thru phi - - JDK-8305561: DebugNonSafepoints generates incorrect information - - JDK-8305850: Fastdebug build fails after JDK-8296389 - - JDK-8305851: use-def assert: special case undetected loops nested in infinite loops - - JDK-8305865: (tz) Update Timezone Data to 2023c - - JDK-8305876: Special case infinite loops with unmerged backedges in IdealLoopTree::check_safepts - - JDK-8306319: Add the runtime version in the release file of a JDK image - - JDK-8306478: On the latest macOS+XCode the Robot API may report wrong colors - - JDK-8306750: Upgrade JLine to 3.22.0 - - JDK-8306751: JShell does not switch to raw mode when there is no /bin/test - - JDK-8306771: [AIX] Broken build after JDK-8301998 - - JDK-8307107: updateIconImages may lead to deadlock after JDK-8276849 - - JDK-8307111: Shenandoah evacuation workers may deadlock - - JDK-8307112: GHA: MSVC installation could be optional since it might already be pre-installed - - JDK-8307151: Shenandoah: Missing barriers on deoptimization path - - JDK-8307364: Make runtime/Monitor/GuaranteedAsyncDeflationIntervalTest.java more reliable - - JDK-8307372: Add TWCA Global Root CA - - JDK-8307373: Add 2 Microsoft TLS roots - - JDK-8307391: Monitor deflation might be accidentally disabled by zero intervals - - JDK-8307631: Add GTS root CAs - - JDK-8308008: java.time.Instant calculation bug in until and between methods - - JDK-8309850: ConcurrentModificationException in javadoc tool - - JDK-8301870: Include cdb in the Windows devkit - - JDK-8303906: Update jdk20u fix version to 20.0.2 - - JDK-8303958: Missing Classpath exception from Continuation.c - - JDK-8304417: GCC 12 reports some compiler warnings in bundled freetype - - JDK-8304981: jcmd: ManagementAgent.status truncates the text longer than O_BUFLEN - - JDK-8305545: [JVMCI] HotSpotResolvedJavaMethodImpl.canBeInlined must respect ForceInline - - JDK-8305547: use-after-free in Node::destruct - - JDK-8305552: [JVMCI] BytecodeFrame.equals is broken - - JDK-8305553: C2: assert in PhaseIdealLoop::do_unroll() is subject to undefined behavior - - JDK-8305789: Update Commons BCEL to Version 6.7.0 - - JDK-8305849: Memory leak in CompilerOracle::parse_from_line - - JDK-8305859: ProblemList runtime/CompressedOops/CompressedClassPointers.java - - JDK-8305948: Performance degradation for float/double modulo on Linux - - JDK-8306448: NoClassDefFoundError omits the original cause of an error - - JDK-8307209: Thread stacksize is reported with wrong units in os::create_thread logging - - JDK-8307360: [vectorapi] The typeChar of LaneType is incorrect when default locale is tr - - JDK-8307361: Guarantee eventual async monitor deflation - - JDK-8307380: harfbuzz build fails with GCC 7 after JDK-8301998 - - JDK-8307419: UTIL_LOOKUP_PROGS fails on pathes with space - - JDK-8307420: UTIL_REQUIRE_SPECIAL warning on grep - - JDK-8307705: Support for GB18030-2022 - - JDK-8308112: Allow collectors to provide specific values for GC notifications' actions - - JDK-8308390: Font.getStringBounds calculates wrong width for TextAttribute.TRACKING other than 0.0 - - JDK-8308418: Socket input stream read burns CPU cycles with back-to-back poll(0) calls - - JDK-8308457: [AIX] VM crashes with UseRTMLocking on Power10 - - JDK-8308693: Add missing gc+phases logging for ObjectCount(AfterGC) JFR event collection code - - JDK-8309483: PPC: Non-Top Interpreted frames should be independent of ABI_ELFv2 - - JDK-8305544: UB: Compile::_phase_optimize_finished is initialized too late - - JDK-8305556: Memory leak in WB_IsMethodCompatible - - JDK-8305559: Identical branch conditions in CompileBroker::print_heapinfo - -The full list of changes in 20u can be found at: -- * https://builds.shipilev.net/backports-monitor/release-notes-20.0.2.txt -- * https://builds.shipilev.net/backports-monitor/pushes-20.0.2.txt - -New in release OpenJDK 20.0.1 (2023-04-18): -=========================================== - -* CVEs - - CVE-2023-21930 - - CVE-2023-21937 - - CVE-2023-21938 - - CVE-2023-21939 - - CVE-2023-21967 - - CVE-2023-21968 -* Security fixes - - JDK-8287404: Improve ping times - - JDK-8288436: Improve Xalan supports - - JDK-8294474: Better AES support - - JDK-8295304: Runtime support improvements - - JDK-8296676, JDK-8296622: Improve String platform support - - JDK-8296684: Improve String platform support - - JDK-8296692: Improve String platform support - - JDK-8296832: Improve Swing platform support - - JDK-8297371: Improve UTF8 representation redux - - JDK-8298310: Enhance TLS session negotiation - - JDK-8298667: Improved path handling - - JDK-8299129: Enhance NameService lookups -* Other changes - - JDK-8208077: File.listRoots performance degradation - - JDK-8245654: Add Certigna Root CA - - JDK-8278965: crash in SymbolTable::do_lookup - - JDK-8295951: intermittent cmp_baseline task failures with CDS files - - JDK-8299194: CustomTzIDCheckDST.java may fail at future date - - JDK-8299843: Bump version numbers for 20.0.1 - - JDK-8299947: Change milestone to fcs for all releases - - JDK-8301123: Enable Symbol refcounting underflow checks in PRODUCT - - JDK-8301858: Verification error when compiling switch with record patterns - - JDK-8301876: Crash in DumpTimeClassInfo::add_verification_constraint - - JDK-8302202: Incorrect desugaring of null-allowed nested patterns - - JDK-8302879: doc/building.md update link to jtreg builds - - JDK-8303412: Update linux_x64-to-linux_aarch64 cross compilation devkit at Oracle - -New in release OpenJDK 20.0.0 (2023-03-21): +New in release OpenJDK 21.0.0 (2023-09-XX): =========================================== Major changes are listed below. Some changes may have been backported -to earlier releases following their first appearance in OpenJDK 20. - -The full list of changes in 20u can be found at: -- * https://builds.shipilev.net/backports-monitor/release-notes-20.txt +to earlier releases following their first appearance in OpenJDK 18 +through to 21. NEW FEATURES ============ @@ -171,6 +21,7 @@ https://openjdk.org/jeps/406 https://openjdk.org/jeps/420 https://openjdk.org/jeps/427 https://openjdk.org/jeps/433 +https://openjdk.org/jeps/441 Enhance the Java programming language with pattern matching for `switch` expressions and statements, along with extensions to the @@ -179,39 +30,53 @@ expression to be tested against a number of patterns, each with a specific action, so that complex data-oriented queries can be expressed concisely and safely. -This is a preview feature (http://openjdk.java.net/jeps/12) introduced -in OpenJDK 17 (JEP 406), which saw a second preview in OpenJDK 18 (JEP -420) and a third in OpenJDK 19 (JEP 427). It reaches its fourth -preview (JEP 427) in OpenJDK 20. +This was a preview feature (http://openjdk.java.net/jeps/12) +introduced in OpenJDK 17 (JEP 406), which saw a second preview in +OpenJDK 18 (JEP 420), a third in OpenJDK 19 (JEP 427) and a fourth +(JEP 427) in OpenJDK 20. It became final with OpenJDK 21 (JEP 441). Record Patterns =============== https://openjdk.org/jeps/405 https://openjdk.org/jeps/432 +https://openjdk.org/jeps/440 Enhance the Java programming language with record patterns to deconstruct record values. Record patterns and type patterns can be nested to enable a powerful, declarative, and composable form of data navigation and processing. +This was a preview feature (http://openjdk.java.net/jeps/12) introduced +in OpenJDK 19 (JEP 405) with a second preview (JEP 432) in OpenJDK 20. +It became final with OpenJDK 21 (JEP 440). + +String Templates +================ +https://openjdk.org/jeps/430 + +Enhance the Java programming language with string templates. String +templates complement Java's existing string literals and text blocks +by coupling literal text with embedded expressions and template +processors to produce specialized results. + This is a preview feature (http://openjdk.java.net/jeps/12) introduced -in OpenJDK 19 (JEP 405). It reaches its second preview (JEP 432) in -OpenJDK 20. +in OpenJDK 21 (JEP 430). + +Unnamed Patterns and Variables +============================== +https://openjdk.org/jeps/443 + +Enhance the Java language with unnamed patterns, which match a record +component without stating the component's name or type, and unnamed +variables, which can be initialized but not used. Both are denoted by +an underscore character, _. + +This is a preview feature (http://openjdk.java.net/jeps/12) introduced +in OpenJDK 21 (JEP 443). Library Features ================ -Scoped Values -============= -https://openjdk.org/jeps/429 - -Introduce scoped values, which enable the sharing of immutable data -within and across threads. They are preferred to thread-local -variables, especially when using large numbers of virtual threads. - -This is an incubation feature (https://openjdk.java.net/jeps/11) -introduced in OpenJDK 20 (JEP 429). - Vector API ========== https://openjdk.org/jeps/338 @@ -219,6 +84,7 @@ https://openjdk.org/jeps/414 https://openjdk.org/jeps/417 https://openjdk.org/jeps/426 https://openjdk.org/jeps/438 +https://openjdk.org/jeps/448 Introduce an API to express vector computations that reliably compile at runtime to optimal vector hardware instructions on supported CPU @@ -228,7 +94,8 @@ scalar computations. This is an incubation feature (https://openjdk.java.net/jeps/11) introduced in OpenJDK 16 (JEP 338). A second round of incubation took place in OpenJDK 17 (JEP 414), OpenJDK 18 (JEP 417) saw a third, -OpenJDK 19 a fourth (JEP 426) and OpenJDK 20 (JEP 438) sees its fifth. +OpenJDK 19 a fourth (JEP 426), OpenJDK 20 (JEP 438) a fifth and +OpenJDK 21 a sixth (JEP 448). Foreign Function & Memory API ============================= @@ -236,6 +103,7 @@ https://openjdk.org/jeps/412 https://openjdk.org/jeps/419 https://openjdk.org/jeps/424 https://openjdk.org/jeps/434 +https://openjdk.org/jeps/442 Introduce an API by which Java programs can interoperate with code and data outside of the Java runtime. By efficiently invoking foreign @@ -250,26 +118,15 @@ It was first introduced in incubation evolution of the Foreign Memory Access API (OpenJDK 14 through 16) and Foreign Linker API (OpenJDK 16) (see release notes for java-17-openjdk). OpenJDK 18 saw a second round of incubation (JEP -419) before its inclusion as a preview in OpenJDK 19 (JEP 424). It -reaches a second preview in OpenJDK 20 (JEP 434). - -Virtual Threads -=============== -https://openjdk.org/jeps/425 -https://openjdk.org/jeps/436 - -Introduce virtual threads to the Java Platform. Virtual threads are -lightweight threads that dramatically reduce the effort of writing, -maintaining, and observing high-throughput concurrent applications. - -This is a preview feature (http://openjdk.java.net/jeps/12) introduced -in OpenJDK 19 (JEP 425) and reaching its second preview in OpenJDK 20 -(JEP 436). +419) before its inclusion as a preview in OpenJDK 19 (JEP 424) and a +second in OpenJDK 20 (JEP 434). It reaches a third preview in OpenJDK +21 (JEP 442). Structured Concurrency ====================== https://openjdk.org/jeps/428 https://openjdk.org/jeps/437 +https://openjdk.org/jeps/453 Simplify multithreaded programming by introducing an API for structured concurrency. Structured concurrency treats multiple tasks @@ -277,6 +134,58 @@ running in different threads as a single unit of work, thereby streamlining error handling and cancellation, improving reliability, and enhancing observability. -This is an incubation feature (https://openjdk.java.net/jeps/11) -introduced in OpenJDK 19 (JEP 428). A second round of incubation takes -place in OpenJDK 20 (JEP 437). +This API is now a preview feature (http://openjdk.java.net/jeps/12) in +OpenJDK 21 (JEP 453). It was first introduced in incubation +(https://openjdk.java.net/jeps/11) in OpenJDK 19 (JEP 428) and had a +second round of incubation in OpenJDK 20 (JEP 437). + +Sequenced Collections +===================== +https://openjdk.org/jeps/431 + +Introduce new interfaces to represent collections with a defined +encounter order. Each such collection has a well-defined first +element, second element, and so forth, up to the last element. It also +provides uniform APIs for accessing its first and last elements, and +for processing its elements in reverse order. + +Key Encapsulation Mechanism API +=============================== +https://openjdk.org/jeps/452 + +Introduce an API for key encapsulation mechanisms (KEMs), an +encryption technique for securing symmetric keys using public key +cryptography. + +Virtual Machine Enhancements +============================ + +Generational ZGC +================ +https://openjdk.org/jeps/439 + +Improve application performance by extending the Z Garbage Collector +(ZGC) to maintain separate generations for young and old objects. This +will allow ZGC to collect young objects — which tend to die young — +more frequently. + +DEPRECATIONS +============ + +Deprecate the Windows 32-bit x86 Port for Removal +================================================= +https://openjdk.org/jeps/449 + +Deprecate the Windows 32-bit x86 port, with the intent to remove it in +a future release. + +Prepare to Disallow the Dynamic Loading of Agents +================================================= +https://openjdk.org/jeps/451 + +Issue warnings when agents are loaded dynamically into a running +JVM. These warnings aim to prepare users for a future release which +disallows the dynamic loading of agents by default in order to improve +integrity by default. Serviceability tools that load agents at startup +will not cause warnings to be issued in any release. + diff --git a/README.md b/README.md index 32ed900..d139d7d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The java-latest-openjdk-portable package Rolling release of (usually) STSs OpenJDK OpenJDK has release cadence of 6 months, but 3/4 of them are Short Term Supported for 6 months only. This package is designed to harbor them. Currently it is build of OpenJDK 12. LTSs will go also as separate packages. -JDK12 is current release of Java platform. It is bringing many cool improvements - https://openjdk.java.net/projects/jdk/12/ and is landing to your Fedora. Where it will be maintained for f28 and newer. Unluckily, this package is STS (short term support) version. Between individual LTS there will be always several STS. Again, please see announcement: http://mail.openjdk.java.net/pipermail/discuss/2017-September/004281.html and See java SIG plans: https://jvanek.fedorapeople.org/devconf/2018/changesInjavaReleaseProcess.pdf . So this is rolling release of all STSs to come. Its fate during the release of fresh LTS is yet to be decided. You will always be allowed to install LTS in fedora build root, alongside with latest STS via alternatives. +JDK21 is current release of Java platform. It is bringing many cool improvements - https://openjdk.org/projects/jdk/21/ and is landing to your Fedora. Where it will be maintained for f28 and newer. Unluckily, this package is STS (short term support) version. Between individual LTS there will be always several STS. Again, please see announcement: http://mail.openjdk.java.net/pipermail/discuss/2017-September/004281.html and See java SIG plans: https://jvanek.fedorapeople.org/devconf/2018/changesInjavaReleaseProcess.pdf . So this is rolling release of all STSs to come. Its fate during the release of fresh LTS is yet to be decided. You will always be allowed to install LTS in fedora build root, alongside with latest STS via alternatives. See announcement: http://mail.openjdk.java.net/pipermail/discuss/2017-September/004281.html From a238aebf8e39ec86d5288906e184b5aae541c130 Mon Sep 17 00:00:00 2001 From: Petra Alice Mikova Date: Fri, 25 Aug 2023 09:14:14 +0200 Subject: [PATCH 09/86] Update FIPS support to bring in latest changes - * RH2048582: Support PKCS#12 keystores - * RH2020290: Support TLS 1.3 in FIPS mode - * Add nss.fips.cfg support to OpenJDK tree - * RH2117972: Extend the support for NSS DBs (PKCS11) in FIPS mode - * Remove forgotten dead code from RH2020290 and RH2104724 - * OJ1357: Fix issue on FIPS with a SecurityManager in place - * RH2134669: Add missing attributes when registering services in FIPS mode. - * test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java: fixed jtreg main class - * RH1940064: Enable XML Signature provider in FIPS mode - * Remove GCC minor versioning (JDK-8284772) to unbreak testing - Drop local nss.fips.cfg.in handling now this is handled in the patched OpenJDK build - require tzdata 2023c --- ...3d95b5.patch => fips-21u-75ffdc48eda.patch | 1256 +++++++++++++---- java-latest-openjdk-portable.spec | 47 +- nss.fips.cfg.in | 8 - ...ut_nss_cfg_provider_to_java_security.patch | 14 +- 4 files changed, 1044 insertions(+), 281 deletions(-) rename fips-20u-fd3de3d95b5.patch => fips-21u-75ffdc48eda.patch (77%) delete mode 100644 nss.fips.cfg.in diff --git a/fips-20u-fd3de3d95b5.patch b/fips-21u-75ffdc48eda.patch similarity index 77% rename from fips-20u-fd3de3d95b5.patch rename to fips-21u-75ffdc48eda.patch index c36a5b6..7ffbe3a 100644 --- a/fips-20u-fd3de3d95b5.patch +++ b/fips-21u-75ffdc48eda.patch @@ -1,9 +1,33 @@ +diff --git a/make/autoconf/build-aux/pkg.m4 b/make/autoconf/build-aux/pkg.m4 +index 5f4b22bb27f..1ca9f5b8ffe 100644 +--- a/make/autoconf/build-aux/pkg.m4 ++++ b/make/autoconf/build-aux/pkg.m4 +@@ -179,3 +179,19 @@ else + ifelse([$3], , :, [$3]) + fi[]dnl + ])# PKG_CHECK_MODULES ++ ++dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, ++dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) ++dnl ------------------------------------------- ++dnl Since: 0.28 ++dnl ++dnl Retrieves the value of the pkg-config variable for the given module. ++AC_DEFUN([PKG_CHECK_VAR], ++[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl ++AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl ++ ++_PKG_CONFIG([$1], [variable="][$3]["], [$2]) ++AS_VAR_COPY([$1], [pkg_cv_][$1]) ++ ++AS_VAR_IF([$1], [""], [$5], [$4])dnl ++])dnl PKG_CHECK_VAR diff --git a/make/autoconf/lib-sysconf.m4 b/make/autoconf/lib-sysconf.m4 new file mode 100644 -index 00000000000..b2b1c1787da +index 00000000000..f48fc7f7e80 --- /dev/null +++ b/make/autoconf/lib-sysconf.m4 -@@ -0,0 +1,84 @@ +@@ -0,0 +1,87 @@ +# +# Copyright (c) 2021, Red Hat, Inc. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,8 +62,10 @@ index 00000000000..b2b1c1787da + # + # Check for the NSS library + # ++ AC_MSG_CHECKING([for NSS library directory]) ++ PKG_CHECK_VAR(NSS_LIBDIR, nss, libdir, [AC_MSG_RESULT([$NSS_LIBDIR])], [AC_MSG_RESULT([not found])]) + -+ AC_MSG_CHECKING([whether to use the system NSS library with the System Configurator (libsysconf)]) ++ AC_MSG_CHECKING([whether to link the system NSS library with the System Configurator (libsysconf)]) + + # default is not available + DEFAULT_SYSCONF_NSS=no @@ -87,9 +113,10 @@ index 00000000000..b2b1c1787da + fi + fi + AC_SUBST(USE_SYSCONF_NSS) ++ AC_SUBST(NSS_LIBDIR) +]) diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4 -index 7a1d8d80bb2..1807cb71073 100644 +index a1fc81564b1..ebad69d9dcf 100644 --- a/make/autoconf/libraries.m4 +++ b/make/autoconf/libraries.m4 @@ -35,6 +35,7 @@ m4_include([lib-std.m4]) @@ -100,31 +127,54 @@ index 7a1d8d80bb2..1807cb71073 100644 ################################################################################ # Determine which libraries are needed for this configuration -@@ -107,6 +108,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES], +@@ -134,6 +135,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES], LIB_SETUP_X11 LIB_TESTS_SETUP_GTEST + LIB_SETUP_SYSCONF_LIBS BASIC_JDKLIB_LIBS="" - if test "x$TOOLCHAIN_TYPE" != xmicrosoft; then + BASIC_JDKLIB_LIBS_TARGET="" diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in -index 9448cb9b7e8..8d3d931e951 100644 +index 0f85917814e..9419562b654 100644 --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in -@@ -859,6 +859,10 @@ INSTALL_SYSCONFDIR=@sysconfdir@ +@@ -867,6 +867,11 @@ INSTALL_SYSCONFDIR=@sysconfdir@ # Libraries # +USE_SYSCONF_NSS:=@USE_SYSCONF_NSS@ +NSS_LIBS:=@NSS_LIBS@ +NSS_CFLAGS:=@NSS_CFLAGS@ ++NSS_LIBDIR:=@NSS_LIBDIR@ + USE_EXTERNAL_LCMS:=@USE_EXTERNAL_LCMS@ LCMS_CFLAGS:=@LCMS_CFLAGS@ LCMS_LIBS:=@LCMS_LIBS@ +diff --git a/make/modules/java.base/Gendata.gmk b/make/modules/java.base/Gendata.gmk +index 9e5cfe2d0fc..434ade8e182 100644 +--- a/make/modules/java.base/Gendata.gmk ++++ b/make/modules/java.base/Gendata.gmk +@@ -98,3 +98,17 @@ $(GENDATA_JAVA_SECURITY): $(BUILD_TOOLS_JDK) $(GENDATA_JAVA_SECURITY_SRC) $(REST + TARGETS += $(GENDATA_JAVA_SECURITY) + + ################################################################################ ++ ++GENDATA_NSS_FIPS_CFG_SRC := $(TOPDIR)/src/java.base/share/conf/security/nss.fips.cfg.in ++GENDATA_NSS_FIPS_CFG := $(SUPPORT_OUTPUTDIR)/modules_conf/java.base/security/nss.fips.cfg ++ ++$(GENDATA_NSS_FIPS_CFG): $(GENDATA_NSS_FIPS_CFG_SRC) ++ $(call LogInfo, Generating nss.fips.cfg) ++ $(call MakeTargetDir) ++ $(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/gensrc/java.base/_$(@F), \ ++ ( $(SED) -e 's:@NSS_LIBDIR@:$(NSS_LIBDIR):g' $< ) > $@ \ ++ ) ++ ++TARGETS += $(GENDATA_NSS_FIPS_CFG) ++ ++################################################################################ diff --git a/make/modules/java.base/Lib.gmk b/make/modules/java.base/Lib.gmk -index 3b782577258..f515b0ba241 100644 +index 1e0f66726d0..59fe923f2c5 100644 --- a/make/modules/java.base/Lib.gmk +++ b/make/modules/java.base/Lib.gmk @@ -163,6 +163,29 @@ ifeq ($(call isTargetOsType, unix), true) @@ -158,7 +208,7 @@ index 3b782577258..f515b0ba241 100644 # Create the symbols file for static builds. diff --git a/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java b/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java -index 38836d2701e..d967010b848 100644 +index 10093137151..b023c63ae58 100644 --- a/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java +++ b/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java @@ -31,6 +31,7 @@ import java.security.SecureRandom; @@ -169,7 +219,7 @@ index 38836d2701e..d967010b848 100644 import static sun.security.util.SecurityConstants.PROVIDER_VER; import static sun.security.util.SecurityProviderConstants.*; -@@ -78,6 +79,10 @@ import static sun.security.util.SecurityProviderConstants.*; +@@ -82,6 +83,10 @@ import static sun.security.util.SecurityProviderConstants.*; public final class SunJCE extends Provider { @@ -180,7 +230,7 @@ index 38836d2701e..d967010b848 100644 @java.io.Serial private static final long serialVersionUID = 6812507587804302833L; -@@ -143,285 +148,287 @@ public final class SunJCE extends Provider { +@@ -147,298 +152,299 @@ public final class SunJCE extends Provider { void putEntries() { // reuse attribute map and reset before each reuse HashMap attrs = new HashMap<>(3); @@ -388,6 +438,13 @@ index 38836d2701e..d967010b848 100644 - ps("Cipher", "PBEWithHmacSHA512AndAES_128", - "com.sun.crypto.provider.PBES2Core$HmacSHA512AndAES_128"); - +- ps("Cipher", "PBEWithHmacSHA512/224AndAES_128", +- "com.sun.crypto.provider.PBES2Core$HmacSHA512_224AndAES_128"); +- +- ps("Cipher", "PBEWithHmacSHA512/256AndAES_128", +- "com.sun.crypto.provider.PBES2Core$HmacSHA512_256AndAES_128"); +- +- - ps("Cipher", "PBEWithHmacSHA1AndAES_256", - "com.sun.crypto.provider.PBES2Core$HmacSHA1AndAES_256"); - @@ -403,6 +460,12 @@ index 38836d2701e..d967010b848 100644 - ps("Cipher", "PBEWithHmacSHA512AndAES_256", - "com.sun.crypto.provider.PBES2Core$HmacSHA512AndAES_256"); - +- ps("Cipher", "PBEWithHmacSHA512/224AndAES_256", +- "com.sun.crypto.provider.PBES2Core$HmacSHA512_224AndAES_256"); +- +- ps("Cipher", "PBEWithHmacSHA512/256AndAES_256", +- "com.sun.crypto.provider.PBES2Core$HmacSHA512_256AndAES_256"); +- - /* - * Key(pair) Generator engines - */ @@ -668,6 +731,12 @@ index 38836d2701e..d967010b848 100644 + ps("Cipher", "PBEWithHmacSHA512AndAES_128", + "com.sun.crypto.provider.PBES2Core$HmacSHA512AndAES_128"); + ++ ps("Cipher", "PBEWithHmacSHA512/224AndAES_128", ++ "com.sun.crypto.provider.PBES2Core$HmacSHA512_224AndAES_128"); ++ ++ ps("Cipher", "PBEWithHmacSHA512/256AndAES_128", ++ "com.sun.crypto.provider.PBES2Core$HmacSHA512_256AndAES_128"); ++ + ps("Cipher", "PBEWithHmacSHA1AndAES_256", + "com.sun.crypto.provider.PBES2Core$HmacSHA1AndAES_256"); + @@ -683,6 +752,12 @@ index 38836d2701e..d967010b848 100644 + ps("Cipher", "PBEWithHmacSHA512AndAES_256", + "com.sun.crypto.provider.PBES2Core$HmacSHA512AndAES_256"); + ++ ps("Cipher", "PBEWithHmacSHA512/224AndAES_256", ++ "com.sun.crypto.provider.PBES2Core$HmacSHA512_224AndAES_256"); ++ ++ ps("Cipher", "PBEWithHmacSHA512/256AndAES_256", ++ "com.sun.crypto.provider.PBES2Core$HmacSHA512_256AndAES_256"); ++ + /* + * Key(pair) Generator engines + */ @@ -747,7 +822,7 @@ index 38836d2701e..d967010b848 100644 /* * Algorithm parameter generation engines -@@ -430,15 +437,17 @@ public final class SunJCE extends Provider { +@@ -447,15 +453,17 @@ public final class SunJCE extends Provider { "DiffieHellman", "com.sun.crypto.provider.DHParameterGenerator", null); @@ -774,9 +849,22 @@ index 38836d2701e..d967010b848 100644 /* * Algorithm Parameter engines -@@ -610,118 +619,120 @@ public final class SunJCE extends Provider { - ps("SecretKeyFactory", "PBEWithHmacSHA512AndAES_256", - "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512AndAES_256"); +@@ -625,10 +633,10 @@ public final class SunJCE extends Provider { + "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512AndAES_128"); + + ps("SecretKeyFactory", "PBEWithHmacSHA512/224AndAES_128", +- "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_224AndAES_128"); ++ "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_224AndAES_128"); + + ps("SecretKeyFactory", "PBEWithHmacSHA512/256AndAES_128", +- "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_256AndAES_128"); ++ "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_256AndAES_128"); + + ps("SecretKeyFactory", "PBEWithHmacSHA1AndAES_256", + "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA1AndAES_256"); +@@ -651,136 +659,137 @@ public final class SunJCE extends Provider { + ps("SecretKeyFactory", "PBEWithHmacSHA512/256AndAES_256", + "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_256AndAES_256"); - // PBKDF2 - psA("SecretKeyFactory", "PBKDF2WithHmacSHA1", @@ -790,6 +878,10 @@ index 38836d2701e..d967010b848 100644 - "com.sun.crypto.provider.PBKDF2Core$HmacSHA384"); - ps("SecretKeyFactory", "PBKDF2WithHmacSHA512", - "com.sun.crypto.provider.PBKDF2Core$HmacSHA512"); +- ps("SecretKeyFactory", "PBKDF2WithHmacSHA512/224", +- "com.sun.crypto.provider.PBKDF2Core$HmacSHA512_224"); +- ps("SecretKeyFactory", "PBKDF2WithHmacSHA512/256", +- "com.sun.crypto.provider.PBKDF2Core$HmacSHA512_256"); - - /* - * MAC @@ -854,6 +946,11 @@ index 38836d2701e..d967010b848 100644 - "com.sun.crypto.provider.PBMAC1Core$HmacSHA384", null, attrs); - ps("Mac", "PBEWithHmacSHA512", - "com.sun.crypto.provider.PBMAC1Core$HmacSHA512", null, attrs); +- ps("Mac", "PBEWithHmacSHA512/224", +- "com.sun.crypto.provider.PBMAC1Core$HmacSHA512_224", null, attrs); +- ps("Mac", "PBEWithHmacSHA512/256", +- "com.sun.crypto.provider.PBMAC1Core$HmacSHA512_256", null, attrs); +- - ps("Mac", "SslMacMD5", - "com.sun.crypto.provider.SslMacCore$SslMacMD5", null, attrs); - ps("Mac", "SslMacSHA1", @@ -866,6 +963,15 @@ index 38836d2701e..d967010b848 100644 - "com.sun.crypto.provider.JceKeyStore"); - - /* +- * KEMs +- */ +- attrs.clear(); +- attrs.put("ImplementedIn", "Software"); +- attrs.put("SupportedKeyClasses", "java.security.interfaces.ECKey" + +- "|java.security.interfaces.XECKey"); +- ps("KEM", "DHKEM", "com.sun.crypto.provider.DHKEM", null, attrs); +- +- /* - * SSL/TLS mechanisms - * - * These are strictly internal implementations and may @@ -903,6 +1009,10 @@ index 38836d2701e..d967010b848 100644 + "com.sun.crypto.provider.PBKDF2Core$HmacSHA384"); + ps("SecretKeyFactory", "PBKDF2WithHmacSHA512", + "com.sun.crypto.provider.PBKDF2Core$HmacSHA512"); ++ ps("SecretKeyFactory", "PBKDF2WithHmacSHA512/224", ++ "com.sun.crypto.provider.PBKDF2Core$HmacSHA512_224"); ++ ps("SecretKeyFactory", "PBKDF2WithHmacSHA512/256", ++ "com.sun.crypto.provider.PBKDF2Core$HmacSHA512_256"); + + /* + * MAC @@ -955,7 +1065,6 @@ index 38836d2701e..d967010b848 100644 + "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA512_256", + null, attrs); + -+ + // PBMAC1 + ps("Mac", "PBEWithHmacSHA1", + "com.sun.crypto.provider.PBMAC1Core$HmacSHA1", null, attrs); @@ -967,6 +1076,11 @@ index 38836d2701e..d967010b848 100644 + "com.sun.crypto.provider.PBMAC1Core$HmacSHA384", null, attrs); + ps("Mac", "PBEWithHmacSHA512", + "com.sun.crypto.provider.PBMAC1Core$HmacSHA512", null, attrs); ++ ps("Mac", "PBEWithHmacSHA512/224", ++ "com.sun.crypto.provider.PBMAC1Core$HmacSHA512_224", null, attrs); ++ ps("Mac", "PBEWithHmacSHA512/256", ++ "com.sun.crypto.provider.PBMAC1Core$HmacSHA512_256", null, attrs); ++ + ps("Mac", "SslMacMD5", + "com.sun.crypto.provider.SslMacCore$SslMacMD5", null, attrs); + ps("Mac", "SslMacSHA1", @@ -979,6 +1093,15 @@ index 38836d2701e..d967010b848 100644 + "com.sun.crypto.provider.JceKeyStore"); + + /* ++ * KEMs ++ */ ++ attrs.clear(); ++ attrs.put("ImplementedIn", "Software"); ++ attrs.put("SupportedKeyClasses", "java.security.interfaces.ECKey" + ++ "|java.security.interfaces.XECKey"); ++ ps("KEM", "DHKEM", "com.sun.crypto.provider.DHKEM", null, attrs); ++ ++ /* + * SSL/TLS mechanisms + * + * These are strictly internal implementations and may @@ -1008,7 +1131,7 @@ index 38836d2701e..d967010b848 100644 // Return the instance of this class or create one if needed. diff --git a/src/java.base/share/classes/java/security/Security.java b/src/java.base/share/classes/java/security/Security.java -index 257dc172ee2..35cea6c54e7 100644 +index 671529f71a1..af632936921 100644 --- a/src/java.base/share/classes/java/security/Security.java +++ b/src/java.base/share/classes/java/security/Security.java @@ -34,6 +34,7 @@ import java.net.URL; @@ -1406,7 +1529,7 @@ index 00000000000..3f3caac64dc + boolean isPlainKeySupportEnabled(); +} diff --git a/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java b/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java -index cf76aa9ff94..9ecb14db126 100644 +index 919d758a6e3..b1e5fbaf84a 100644 --- a/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java +++ b/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java @@ -43,6 +43,7 @@ import java.io.PrintStream; @@ -1417,15 +1540,15 @@ index cf76aa9ff94..9ecb14db126 100644 import java.security.Signature; /** A repository of "shared secrets", which are a mechanism for -@@ -89,6 +90,7 @@ public class SharedSecrets { - private static JavaSecuritySpecAccess javaSecuritySpecAccess; +@@ -90,6 +91,7 @@ public class SharedSecrets { private static JavaxCryptoSealedObjectAccess javaxCryptoSealedObjectAccess; private static JavaxCryptoSpecAccess javaxCryptoSpecAccess; + private static JavaTemplateAccess javaTemplateAccess; + private static JavaSecuritySystemConfiguratorAccess javaSecuritySystemConfiguratorAccess; public static void setJavaUtilCollectionAccess(JavaUtilCollectionAccess juca) { javaUtilCollectionAccess = juca; -@@ -521,4 +523,15 @@ public class SharedSecrets { +@@ -537,4 +539,15 @@ public class SharedSecrets { MethodHandles.lookup().ensureInitialized(c); } catch (IllegalAccessException e) {} } @@ -1442,10 +1565,10 @@ index cf76aa9ff94..9ecb14db126 100644 + } } diff --git a/src/java.base/share/classes/module-info.java b/src/java.base/share/classes/module-info.java -index d985dec174f..a5b9cbf7fbc 100644 +index 06b141dcf22..e8cbf7f15d7 100644 --- a/src/java.base/share/classes/module-info.java +++ b/src/java.base/share/classes/module-info.java -@@ -163,6 +163,7 @@ module java.base { +@@ -158,6 +158,7 @@ module java.base { java.naming, java.rmi, jdk.charsets, @@ -1454,7 +1577,7 @@ index d985dec174f..a5b9cbf7fbc 100644 jdk.jlink, jdk.jfr, diff --git a/src/java.base/share/classes/sun/security/provider/SunEntries.java b/src/java.base/share/classes/sun/security/provider/SunEntries.java -index 0d4ae1019e1..e839866a28c 100644 +index f036a411f1d..1e9de933bd9 100644 --- a/src/java.base/share/classes/sun/security/provider/SunEntries.java +++ b/src/java.base/share/classes/sun/security/provider/SunEntries.java @@ -38,6 +38,7 @@ import java.util.HashMap; @@ -1476,7 +1599,7 @@ index 0d4ae1019e1..e839866a28c 100644 // the default algo used by SecureRandom class for new SecureRandom() calls public static final String DEF_SECURE_RANDOM_ALGO; -@@ -102,99 +107,101 @@ public final class SunEntries { +@@ -102,89 +107,92 @@ public final class SunEntries { // common attribute map HashMap attrs = new HashMap<>(3); @@ -1540,8 +1663,6 @@ index 0d4ae1019e1..e839866a28c 100644 - "sun.security.provider.DSA$SHA3_384withDSA", attrs); - addWithAlias(p, "Signature", "SHA3-512withDSA", - "sun.security.provider.DSA$SHA3_512withDSA", attrs); -- -- attrs.remove("KeySize"); + if (!systemFipsEnabled) { + /* + * SecureRandom engines @@ -1564,32 +1685,7 @@ index 0d4ae1019e1..e839866a28c 100644 + add(p, "SecureRandom", "SHA1PRNG", + "sun.security.provider.SecureRandom", attrs); -- add(p, "Signature", "SHA1withDSAinP1363Format", -- "sun.security.provider.DSA$SHA1withDSAinP1363Format"); -- add(p, "Signature", "NONEwithDSAinP1363Format", -- "sun.security.provider.DSA$RawDSAinP1363Format"); -- add(p, "Signature", "SHA224withDSAinP1363Format", -- "sun.security.provider.DSA$SHA224withDSAinP1363Format"); -- add(p, "Signature", "SHA256withDSAinP1363Format", -- "sun.security.provider.DSA$SHA256withDSAinP1363Format"); -- add(p, "Signature", "SHA384withDSAinP1363Format", -- "sun.security.provider.DSA$SHA384withDSAinP1363Format"); -- add(p, "Signature", "SHA512withDSAinP1363Format", -- "sun.security.provider.DSA$SHA512withDSAinP1363Format"); -- add(p, "Signature", "SHA3-224withDSAinP1363Format", -- "sun.security.provider.DSA$SHA3_224withDSAinP1363Format"); -- add(p, "Signature", "SHA3-256withDSAinP1363Format", -- "sun.security.provider.DSA$SHA3_256withDSAinP1363Format"); -- add(p, "Signature", "SHA3-384withDSAinP1363Format", -- "sun.security.provider.DSA$SHA3_384withDSAinP1363Format"); -- add(p, "Signature", "SHA3-512withDSAinP1363Format", -- "sun.security.provider.DSA$SHA3_512withDSAinP1363Format"); -- /* -- * Key Pair Generator engines -- */ -- attrs.clear(); -- attrs.put("ImplementedIn", "Software"); -- attrs.put("KeySize", "2048"); // for DSA KPG and APG only +- attrs.remove("KeySize"); + /* + * Signature engines + */ @@ -1652,16 +1748,39 @@ index 0d4ae1019e1..e839866a28c 100644 + "sun.security.provider.DSA$SHA3_384withDSAinP1363Format"); + add(p, "Signature", "SHA3-512withDSAinP1363Format", + "sun.security.provider.DSA$SHA3_512withDSAinP1363Format"); -+ /* -+ * Key Pair Generator engines -+ */ -+ attrs.clear(); -+ attrs.put("ImplementedIn", "Software"); -+ attrs.put("KeySize", "2048"); // for DSA KPG and APG only + +- add(p, "Signature", "SHA1withDSAinP1363Format", +- "sun.security.provider.DSA$SHA1withDSAinP1363Format"); +- add(p, "Signature", "NONEwithDSAinP1363Format", +- "sun.security.provider.DSA$RawDSAinP1363Format"); +- add(p, "Signature", "SHA224withDSAinP1363Format", +- "sun.security.provider.DSA$SHA224withDSAinP1363Format"); +- add(p, "Signature", "SHA256withDSAinP1363Format", +- "sun.security.provider.DSA$SHA256withDSAinP1363Format"); +- add(p, "Signature", "SHA384withDSAinP1363Format", +- "sun.security.provider.DSA$SHA384withDSAinP1363Format"); +- add(p, "Signature", "SHA512withDSAinP1363Format", +- "sun.security.provider.DSA$SHA512withDSAinP1363Format"); +- add(p, "Signature", "SHA3-224withDSAinP1363Format", +- "sun.security.provider.DSA$SHA3_224withDSAinP1363Format"); +- add(p, "Signature", "SHA3-256withDSAinP1363Format", +- "sun.security.provider.DSA$SHA3_256withDSAinP1363Format"); +- add(p, "Signature", "SHA3-384withDSAinP1363Format", +- "sun.security.provider.DSA$SHA3_384withDSAinP1363Format"); +- add(p, "Signature", "SHA3-512withDSAinP1363Format", +- "sun.security.provider.DSA$SHA3_512withDSAinP1363Format"); ++ } + + attrs.clear(); + attrs.put("ImplementedIn", "Software"); +@@ -196,9 +204,11 @@ public final class SunEntries { + attrs.put("ImplementedIn", "Software"); + attrs.put("KeySize", "2048"); // for DSA KPG and APG only - String dsaKPGImplClass = "sun.security.provider.DSAKeyPairGenerator$"; - dsaKPGImplClass += (useLegacyDSA? "Legacy" : "Current"); - addWithAlias(p, "KeyPairGenerator", "DSA", dsaKPGImplClass, attrs); ++ if (!systemFipsEnabled) { + String dsaKPGImplClass = "sun.security.provider.DSAKeyPairGenerator$"; + dsaKPGImplClass += (useLegacyDSA? "Legacy" : "Current"); + addWithAlias(p, "KeyPairGenerator", "DSA", dsaKPGImplClass, attrs); @@ -1669,7 +1788,7 @@ index 0d4ae1019e1..e839866a28c 100644 /* * Algorithm Parameter Generator engines -@@ -209,42 +216,44 @@ public final class SunEntries { +@@ -213,44 +223,46 @@ public final class SunEntries { addWithAlias(p, "AlgorithmParameters", "DSA", "sun.security.provider.DSAParameters", attrs); @@ -1678,6 +1797,8 @@ index 0d4ae1019e1..e839866a28c 100644 - */ - addWithAlias(p, "KeyFactory", "DSA", - "sun.security.provider.DSAKeyFactory", attrs); +- addWithAlias(p, "KeyFactory", "HSS/LMS", +- "sun.security.provider.HSS$KeyFactoryImpl", attrs); - - /* - * Digest engines @@ -1694,6 +1815,8 @@ index 0d4ae1019e1..e839866a28c 100644 + */ + addWithAlias(p, "KeyFactory", "DSA", + "sun.security.provider.DSAKeyFactory", attrs); ++ addWithAlias(p, "KeyFactory", "HSS/LMS", ++ "sun.security.provider.HSS$KeyFactoryImpl", attrs); - addWithAlias(p, "MessageDigest", "SHA-224", - "sun.security.provider.SHA2$SHA224", attrs); @@ -1750,7 +1873,7 @@ index 0d4ae1019e1..e839866a28c 100644 /* * Certificates diff --git a/src/java.base/share/classes/sun/security/rsa/SunRsaSignEntries.java b/src/java.base/share/classes/sun/security/rsa/SunRsaSignEntries.java -index 539ef1e8ee8..7662684797e 100644 +index 539ef1e8ee8..435f57e3ff2 100644 --- a/src/java.base/share/classes/sun/security/rsa/SunRsaSignEntries.java +++ b/src/java.base/share/classes/sun/security/rsa/SunRsaSignEntries.java @@ -27,6 +27,7 @@ package sun.security.rsa; @@ -1772,19 +1895,7 @@ index 539ef1e8ee8..7662684797e 100644 private void add(Provider p, String type, String algo, String cn, List aliases, HashMap attrs) { services.add(new Provider.Service(p, type, algo, cn, -@@ -56,49 +61,58 @@ public final class SunRsaSignEntries { - // start populating content using the specified provider - // common attribute map - HashMap attrs = new HashMap<>(3); -- attrs.put("SupportedKeyClasses", -- "java.security.interfaces.RSAPublicKey" + -- "|java.security.interfaces.RSAPrivateKey"); -+ if (!systemFipsEnabled) { -+ attrs.put("SupportedKeyClasses", -+ "java.security.interfaces.RSAPublicKey" + -+ "|java.security.interfaces.RSAPrivateKey"); -+ } - +@@ -63,42 +68,49 @@ public final class SunRsaSignEntries { add(p, "KeyFactory", "RSA", "sun.security.rsa.RSAKeyFactory$Legacy", getAliases("PKCS1"), null); @@ -1867,139 +1978,11 @@ index 539ef1e8ee8..7662684797e 100644 addA(p, "AlgorithmParameters", "RSASSA-PSS", "sun.security.rsa.PSSParameters", null); } -diff --git a/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java b/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java -index a9f97c76cb9..3571778367f 100644 ---- a/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java -+++ b/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java -@@ -32,6 +32,7 @@ import java.security.cert.*; - import java.util.*; - import java.util.concurrent.locks.ReentrantLock; - import javax.net.ssl.*; -+import jdk.internal.access.SharedSecrets; - import sun.security.action.GetPropertyAction; - import sun.security.provider.certpath.AlgorithmChecker; - import sun.security.validator.Validator; -@@ -530,22 +531,40 @@ public abstract class SSLContextImpl extends SSLContextSpi { - private static final List serverDefaultCipherSuites; - - static { -- supportedProtocols = Arrays.asList( -- ProtocolVersion.TLS13, -- ProtocolVersion.TLS12, -- ProtocolVersion.TLS11, -- ProtocolVersion.TLS10, -- ProtocolVersion.SSL30, -- ProtocolVersion.SSL20Hello -- ); -- -- serverDefaultProtocols = getAvailableProtocols( -- new ProtocolVersion[] { -- ProtocolVersion.TLS13, -- ProtocolVersion.TLS12, -- ProtocolVersion.TLS11, -- ProtocolVersion.TLS10 -- }); -+ if (SharedSecrets.getJavaSecuritySystemConfiguratorAccess() -+ .isSystemFipsEnabled()) { -+ // RH1860986: TLSv1.3 key derivation not supported with -+ // the Security Providers available in system FIPS mode. -+ supportedProtocols = Arrays.asList( -+ ProtocolVersion.TLS12, -+ ProtocolVersion.TLS11, -+ ProtocolVersion.TLS10 -+ ); -+ -+ serverDefaultProtocols = getAvailableProtocols( -+ new ProtocolVersion[] { -+ ProtocolVersion.TLS12, -+ ProtocolVersion.TLS11, -+ ProtocolVersion.TLS10 -+ }); -+ } else { -+ supportedProtocols = Arrays.asList( -+ ProtocolVersion.TLS13, -+ ProtocolVersion.TLS12, -+ ProtocolVersion.TLS11, -+ ProtocolVersion.TLS10, -+ ProtocolVersion.SSL30, -+ ProtocolVersion.SSL20Hello -+ ); -+ -+ serverDefaultProtocols = getAvailableProtocols( -+ new ProtocolVersion[] { -+ ProtocolVersion.TLS13, -+ ProtocolVersion.TLS12, -+ ProtocolVersion.TLS11, -+ ProtocolVersion.TLS10 -+ }); -+ } - - supportedCipherSuites = getApplicableSupportedCipherSuites( - supportedProtocols); -@@ -836,12 +855,23 @@ public abstract class SSLContextImpl extends SSLContextSpi { - ProtocolVersion[] candidates; - if (refactored.isEmpty()) { - // Client and server use the same default protocols. -- candidates = new ProtocolVersion[] { -- ProtocolVersion.TLS13, -- ProtocolVersion.TLS12, -- ProtocolVersion.TLS11, -- ProtocolVersion.TLS10 -- }; -+ if (SharedSecrets.getJavaSecuritySystemConfiguratorAccess() -+ .isSystemFipsEnabled()) { -+ // RH1860986: TLSv1.3 key derivation not supported with -+ // the Security Providers available in system FIPS mode. -+ candidates = new ProtocolVersion[] { -+ ProtocolVersion.TLS12, -+ ProtocolVersion.TLS11, -+ ProtocolVersion.TLS10 -+ }; -+ } else { -+ candidates = new ProtocolVersion[] { -+ ProtocolVersion.TLS13, -+ ProtocolVersion.TLS12, -+ ProtocolVersion.TLS11, -+ ProtocolVersion.TLS10 -+ }; -+ } - } else { - // Use the customized TLS protocols. - candidates = -diff --git a/src/java.base/share/classes/sun/security/ssl/SunJSSE.java b/src/java.base/share/classes/sun/security/ssl/SunJSSE.java -index 894e26dfad8..8b16378b96b 100644 ---- a/src/java.base/share/classes/sun/security/ssl/SunJSSE.java -+++ b/src/java.base/share/classes/sun/security/ssl/SunJSSE.java -@@ -27,6 +27,8 @@ package sun.security.ssl; - - import java.security.*; - import java.util.*; -+ -+import jdk.internal.access.SharedSecrets; - import static sun.security.util.SecurityConstants.PROVIDER_VER; - - /** -@@ -102,8 +104,13 @@ public class SunJSSE extends java.security.Provider { - "sun.security.ssl.SSLContextImpl$TLS11Context", null, null); - ps("SSLContext", "TLSv1.2", - "sun.security.ssl.SSLContextImpl$TLS12Context", null, null); -- ps("SSLContext", "TLSv1.3", -- "sun.security.ssl.SSLContextImpl$TLS13Context", null, null); -+ if (!SharedSecrets.getJavaSecuritySystemConfiguratorAccess() -+ .isSystemFipsEnabled()) { -+ // RH1860986: TLSv1.3 key derivation not supported with -+ // the Security Providers available in system FIPS mode. -+ ps("SSLContext", "TLSv1.3", -+ "sun.security.ssl.SSLContextImpl$TLS13Context", null, null); -+ } - ps("SSLContext", "TLS", - "sun.security.ssl.SSLContextImpl$TLSContext", - List.of("SSL"), null); diff --git a/src/java.base/share/conf/security/java.security b/src/java.base/share/conf/security/java.security -index 8156eea7e11..6a7f6eeafcc 100644 +index 5149edba0e5..8227d650a03 100644 --- a/src/java.base/share/conf/security/java.security +++ b/src/java.base/share/conf/security/java.security -@@ -85,6 +85,16 @@ security.provider.tbd=Apple +@@ -85,6 +85,17 @@ security.provider.tbd=Apple #endif security.provider.tbd=SunPKCS11 @@ -2012,23 +1995,60 @@ index 8156eea7e11..6a7f6eeafcc 100644 +fips.provider.4=SunJSSE +fips.provider.5=SunJCE +fips.provider.6=SunRsaSign ++fips.provider.7=XMLDSig + # # A list of preferred providers for specific algorithms. These providers will # be searched for matching algorithms before the list of registered providers. -@@ -295,6 +305,11 @@ policy.ignoreIdentityScope=false +@@ -295,6 +306,47 @@ policy.ignoreIdentityScope=false # keystore.type=pkcs12 +# +# Default keystore type used when global crypto-policies are set to FIPS. +# -+fips.keystore.type=PKCS11 ++fips.keystore.type=pkcs12 ++ ++# ++# Location of the NSS DB keystore (PKCS11) in FIPS mode. ++# ++# The syntax for this property is identical to the 'nssSecmodDirectory' ++# attribute available in the SunPKCS11 NSS configuration file. Use the ++# 'sql:' prefix to refer to an SQLite DB. ++# ++# If the system property fips.nssdb.path is also specified, it supersedes ++# the security property value defined here. ++# ++# Note: the default value for this property points to an NSS DB that might be ++# readable by multiple operating system users and unsuitable to store keys. ++# ++fips.nssdb.path=sql:/etc/pki/nssdb ++ ++# ++# PIN for the NSS DB keystore (PKCS11) in FIPS mode. ++# ++# Values must take any of the following forms: ++# 1) pin: ++# Value: clear text PIN value. ++# 2) env: ++# Value: environment variable containing the PIN value. ++# 3) file: ++# Value: path to a file containing the PIN value in its first ++# line. ++# ++# If the system property fips.nssdb.pin is also specified, it supersedes ++# the security property value defined here. ++# ++# When used as a system property, UTF-8 encoded values are valid. When ++# used as a security property (such as in this file), encode non-Basic ++# Latin Unicode characters with \uXXXX. ++# ++fips.nssdb.pin=pin: + # # Controls compatibility mode for JKS and PKCS12 keystore types. # -@@ -332,6 +347,13 @@ package.definition=sun.misc.,\ +@@ -332,6 +384,13 @@ package.definition=sun.misc.,\ # security.overridePropertiesFile=true @@ -2042,11 +2062,25 @@ index 8156eea7e11..6a7f6eeafcc 100644 # # Determines the default key and trust manager factory algorithms for # the javax.net.ssl package. +diff --git a/src/java.base/share/conf/security/nss.fips.cfg.in b/src/java.base/share/conf/security/nss.fips.cfg.in +new file mode 100644 +index 00000000000..55bbba98b7a +--- /dev/null ++++ b/src/java.base/share/conf/security/nss.fips.cfg.in +@@ -0,0 +1,8 @@ ++name = NSS-FIPS ++nssLibraryDirectory = @NSS_LIBDIR@ ++nssSecmodDirectory = ${fips.nssdb.path} ++nssDbMode = readWrite ++nssModule = fips ++ ++attributes(*,CKO_SECRET_KEY,CKK_GENERIC_SECRET)={ CKA_SIGN=true } ++ diff --git a/src/java.base/share/lib/security/default.policy b/src/java.base/share/lib/security/default.policy -index 2a01c06250a..aea4620b1ab 100644 +index 86d45147709..22fd8675503 100644 --- a/src/java.base/share/lib/security/default.policy +++ b/src/java.base/share/lib/security/default.policy -@@ -124,6 +124,7 @@ grant codeBase "jrt:/jdk.charsets" { +@@ -130,6 +130,7 @@ grant codeBase "jrt:/jdk.charsets" { grant codeBase "jrt:/jdk.crypto.ec" { permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*"; @@ -2054,6 +2088,15 @@ index 2a01c06250a..aea4620b1ab 100644 permission java.lang.RuntimePermission "loadLibrary.sunec"; permission java.security.SecurityPermission "putProviderProperty.SunEC"; permission java.security.SecurityPermission "clearProviderProperties.SunEC"; +@@ -150,6 +151,8 @@ grant codeBase "jrt:/jdk.crypto.cryptoki" { + permission java.util.PropertyPermission "os.name", "read"; + permission java.util.PropertyPermission "os.arch", "read"; + permission java.util.PropertyPermission "jdk.crypto.KeyAgreement.legacyKDF", "read"; ++ permission java.util.PropertyPermission "fips.nssdb.path", "read,write"; ++ permission java.util.PropertyPermission "fips.nssdb.pin", "read"; + permission java.security.SecurityPermission "putProviderProperty.*"; + permission java.security.SecurityPermission "clearProviderProperties.*"; + permission java.security.SecurityPermission "removeProviderProperty.*"; diff --git a/src/java.base/share/native/libsystemconf/systemconf.c b/src/java.base/share/native/libsystemconf/systemconf.c new file mode 100644 index 00000000000..ddf9befe5bc @@ -2298,10 +2341,10 @@ index 00000000000..ddf9befe5bc +#endif diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/FIPSKeyImporter.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/FIPSKeyImporter.java new file mode 100644 -index 00000000000..52a403107c3 +index 00000000000..48d6d656a28 --- /dev/null +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/FIPSKeyImporter.java -@@ -0,0 +1,461 @@ +@@ -0,0 +1,457 @@ +/* + * Copyright (c) 2021, Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2376,9 +2419,6 @@ index 00000000000..52a403107c3 + private static volatile Provider sunECProvider = null; + private static final ReentrantLock sunECProviderLock = new ReentrantLock(); + -+ private static volatile KeyFactory DHKF = null; -+ private static final ReentrantLock DHKFLock = new ReentrantLock(); -+ + static Long importKey(SunPKCS11 sunPKCS11, long hSession, CK_ATTRIBUTE[] attributes) + throws PKCS11Exception { + long keyID = -1; @@ -2623,8 +2663,7 @@ index 00000000000..52a403107c3 + CKA_PRIVATE_EXPONENT, CKA_PRIME_1, CKA_PRIME_2, + CKA_EXPONENT_1, CKA_EXPONENT_2, CKA_COEFFICIENT); + RSAPrivateKey rsaPKey = RSAPrivateCrtKeyImpl.newKey( -+ RSAUtil.KeyType.RSA, "PKCS#8", plainExportedKey -+ ); ++ RSAUtil.KeyType.RSA, "PKCS#8", plainExportedKey); + CK_ATTRIBUTE attr; + if ((attr = sensitiveAttrs.get(CKA_PRIVATE_EXPONENT)) != null) { + attr.pValue = rsaPKey.getPrivateExponent().toByteArray(); @@ -2763,8 +2802,164 @@ index 00000000000..52a403107c3 + } + } +} +diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/FIPSTokenLoginHandler.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/FIPSTokenLoginHandler.java +new file mode 100644 +index 00000000000..f8d505ca815 +--- /dev/null ++++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/FIPSTokenLoginHandler.java +@@ -0,0 +1,149 @@ ++/* ++ * Copyright (c) 2022, Red Hat, Inc. ++ * 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. ++ */ ++ ++package sun.security.pkcs11; ++ ++import java.io.BufferedReader; ++import java.io.ByteArrayInputStream; ++import java.io.InputStream; ++import java.io.InputStreamReader; ++import java.io.IOException; ++import java.nio.charset.StandardCharsets; ++import java.nio.file.Files; ++import java.nio.file.Path; ++import java.nio.file.Paths; ++import java.nio.file.StandardOpenOption; ++import java.security.ProviderException; ++ ++import javax.security.auth.callback.Callback; ++import javax.security.auth.callback.CallbackHandler; ++import javax.security.auth.callback.PasswordCallback; ++import javax.security.auth.callback.UnsupportedCallbackException; ++ ++import sun.security.util.Debug; ++import sun.security.util.SecurityProperties; ++ ++final class FIPSTokenLoginHandler implements CallbackHandler { ++ ++ private static final String FIPS_NSSDB_PIN_PROP = "fips.nssdb.pin"; ++ ++ private static final Debug debug = Debug.getInstance("sunpkcs11"); ++ ++ public void handle(Callback[] callbacks) ++ throws IOException, UnsupportedCallbackException { ++ if (!(callbacks[0] instanceof PasswordCallback)) { ++ throw new UnsupportedCallbackException(callbacks[0]); ++ } ++ PasswordCallback pc = (PasswordCallback)callbacks[0]; ++ pc.setPassword(getFipsNssdbPin()); ++ } ++ ++ private static char[] getFipsNssdbPin() throws ProviderException { ++ if (debug != null) { ++ debug.println("FIPS: Reading NSS DB PIN for token..."); ++ } ++ String pinProp = SecurityProperties ++ .privilegedGetOverridable(FIPS_NSSDB_PIN_PROP); ++ if (pinProp != null && !pinProp.isEmpty()) { ++ String[] pinPropParts = pinProp.split(":", 2); ++ if (pinPropParts.length < 2) { ++ throw new ProviderException("Invalid " + FIPS_NSSDB_PIN_PROP + ++ " property value."); ++ } ++ String prefix = pinPropParts[0].toLowerCase(); ++ String value = pinPropParts[1]; ++ String pin = null; ++ if (prefix.equals("env")) { ++ if (debug != null) { ++ debug.println("FIPS: PIN value from the '" + value + ++ "' environment variable."); ++ } ++ pin = System.getenv(value); ++ } else if (prefix.equals("file")) { ++ if (debug != null) { ++ debug.println("FIPS: PIN value from the '" + value + ++ "' file."); ++ } ++ pin = getPinFromFile(Paths.get(value)); ++ } else if (prefix.equals("pin")) { ++ if (debug != null) { ++ debug.println("FIPS: PIN value from the " + ++ FIPS_NSSDB_PIN_PROP + " property."); ++ } ++ pin = value; ++ } else { ++ throw new ProviderException("Unsupported prefix for " + ++ FIPS_NSSDB_PIN_PROP + "."); ++ } ++ if (pin != null && !pin.isEmpty()) { ++ if (debug != null) { ++ debug.println("FIPS: non-empty PIN."); ++ } ++ /* ++ * C_Login in libj2pkcs11 receives the PIN in a char[] and ++ * discards the upper byte of each char, before passing ++ * the value to the NSS Software Token. However, the ++ * NSS Software Token accepts any UTF-8 PIN value. Thus, ++ * expand the PIN here to account for later truncation. ++ */ ++ byte[] pinUtf8 = pin.getBytes(StandardCharsets.UTF_8); ++ char[] pinChar = new char[pinUtf8.length]; ++ for (int i = 0; i < pinChar.length; i++) { ++ pinChar[i] = (char)(pinUtf8[i] & 0xFF); ++ } ++ return pinChar; ++ } ++ } ++ if (debug != null) { ++ debug.println("FIPS: empty PIN."); ++ } ++ return null; ++ } ++ ++ /* ++ * This method extracts the token PIN from the first line of a password ++ * file in the same way as NSS modutil. See for example the -newpwfile ++ * argument used to change the password for an NSS DB. ++ */ ++ private static String getPinFromFile(Path f) throws ProviderException { ++ try (InputStream is = ++ Files.newInputStream(f, StandardOpenOption.READ)) { ++ /* ++ * SECU_FilePasswd in NSS (nss/cmd/lib/secutil.c), used by modutil, ++ * reads up to 4096 bytes. In addition, the NSS Software Token ++ * does not accept PINs longer than 500 bytes (see SFTK_MAX_PIN ++ * in nss/lib/softoken/pkcs11i.h). ++ */ ++ BufferedReader in = ++ new BufferedReader(new InputStreamReader( ++ new ByteArrayInputStream(is.readNBytes(4096)), ++ StandardCharsets.UTF_8)); ++ return in.readLine(); ++ } catch (IOException ioe) { ++ throw new ProviderException("Error reading " + FIPS_NSSDB_PIN_PROP + ++ " from the '" + f + "' file.", ioe); ++ } ++ } ++} +\ No newline at end of file diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java -index af6fbeba48a..a20278cb683 100644 +index 6b26297b1b4..7ee5e07756c 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java @@ -37,6 +37,8 @@ import javax.crypto.*; @@ -2786,7 +2981,7 @@ index af6fbeba48a..a20278cb683 100644 private static final String PUBLIC = "public"; private static final String PRIVATE = "private"; private static final String SECRET = "secret"; -@@ -391,8 +396,10 @@ abstract class P11Key implements Key, Length { +@@ -401,8 +406,10 @@ abstract class P11Key implements Key, Length { new CK_ATTRIBUTE(CKA_EXTRACTABLE), }); @@ -2799,7 +2994,7 @@ index af6fbeba48a..a20278cb683 100644 return switch (algorithm) { case "RSA" -> P11RSAPrivateKeyInternal.of(session, keyID, algorithm, -@@ -444,7 +451,8 @@ abstract class P11Key implements Key, Length { +@@ -454,7 +461,8 @@ abstract class P11Key implements Key, Length { public String getFormat() { token.ensureValid(); @@ -2809,13 +3004,13 @@ index af6fbeba48a..a20278cb683 100644 return null; } else { return "RAW"; -@@ -1575,4 +1583,3 @@ final class SessionKeyRef extends PhantomReference { +@@ -1624,4 +1632,3 @@ final class SessionKeyRef extends PhantomReference { this.clear(); } } - diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java -index 04a1a70ed23..a5c9b5fddf4 100644 +index 5cd6828d293..bae49c4e8a9 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java @@ -26,6 +26,9 @@ @@ -2828,7 +3023,7 @@ index 04a1a70ed23..a5c9b5fddf4 100644 import java.util.*; import java.security.*; -@@ -42,6 +45,7 @@ import javax.security.auth.callback.PasswordCallback; +@@ -42,10 +45,12 @@ import javax.security.auth.callback.PasswordCallback; import com.sun.crypto.provider.ChaCha20Poly1305Parameters; @@ -2836,7 +3031,12 @@ index 04a1a70ed23..a5c9b5fddf4 100644 import jdk.internal.misc.InnocuousThread; import sun.security.util.Debug; import sun.security.util.ResourcesMgr; -@@ -65,6 +69,37 @@ public final class SunPKCS11 extends AuthProvider { + import static sun.security.util.SecurityConstants.PROVIDER_VER; ++import sun.security.util.SecurityProperties; + import static sun.security.util.SecurityProviderConstants.getAliases; + + import sun.security.pkcs11.Secmod.*; +@@ -65,6 +70,39 @@ public final class SunPKCS11 extends AuthProvider { @Serial private static final long serialVersionUID = -1354835039035306505L; @@ -2870,11 +3070,43 @@ index 04a1a70ed23..a5c9b5fddf4 100644 + fipsImportKey = fipsImportKeyTmp; + fipsExportKey = fipsExportKeyTmp; + } ++ ++ private static final String FIPS_NSSDB_PATH_PROP = "fips.nssdb.path"; + static final Debug debug = Debug.getInstance("sunpkcs11"); // the PKCS11 object through which we make the native calls @SuppressWarnings("serial") // Type of field is not Serializable; -@@ -325,9 +360,19 @@ public final class SunPKCS11 extends AuthProvider { +@@ -123,6 +161,29 @@ public final class SunPKCS11 extends AuthProvider { + return AccessController.doPrivileged(new PrivilegedExceptionAction<>() { + @Override + public SunPKCS11 run() throws Exception { ++ if (systemFipsEnabled) { ++ /* ++ * The nssSecmodDirectory attribute in the SunPKCS11 ++ * NSS configuration file takes the value of the ++ * fips.nssdb.path System property after expansion. ++ * Security properties expansion is unsupported. ++ */ ++ String nssdbPath = ++ SecurityProperties.privilegedGetOverridable( ++ FIPS_NSSDB_PATH_PROP); ++ if (System.getSecurityManager() != null) { ++ AccessController.doPrivileged( ++ (PrivilegedAction) () -> { ++ System.setProperty( ++ FIPS_NSSDB_PATH_PROP, ++ nssdbPath); ++ return null; ++ }); ++ } else { ++ System.setProperty( ++ FIPS_NSSDB_PATH_PROP, nssdbPath); ++ } ++ } + return new SunPKCS11(new Config(newConfigName)); + } + }); +@@ -325,9 +386,19 @@ public final class SunPKCS11 extends AuthProvider { // request multithreaded access first initArgs.flags = CKF_OS_LOCKING_OK; PKCS11 tmpPKCS11; @@ -2896,7 +3128,7 @@ index 04a1a70ed23..a5c9b5fddf4 100644 } catch (PKCS11Exception e) { if (debug != null) { debug.println("Multi-threaded initialization failed: " + e); -@@ -342,8 +387,9 @@ public final class SunPKCS11 extends AuthProvider { +@@ -342,8 +413,9 @@ public final class SunPKCS11 extends AuthProvider { } else { initArgs.flags = 0; } @@ -2908,31 +3140,116 @@ index 04a1a70ed23..a5c9b5fddf4 100644 } p11 = tmpPKCS11; -@@ -383,6 +429,24 @@ public final class SunPKCS11 extends AuthProvider { - if (nssModule != null) { - nssModule.setProvider(this); +@@ -1389,11 +1461,52 @@ public final class SunPKCS11 extends AuthProvider { + } + + @Override ++ @SuppressWarnings("removal") + public Object newInstance(Object param) + throws NoSuchAlgorithmException { + if (!token.isValid()) { + throw new NoSuchAlgorithmException("Token has been removed"); } -+ if (systemFipsEnabled) { -+ // The NSS Software Token in FIPS 140-2 mode requires a user -+ // login for most operations. See sftk_fipsCheck. The NSS DB -+ // (/etc/pki/nssdb) PIN is empty. -+ Session session = null; ++ if (systemFipsEnabled && !token.fipsLoggedIn && ++ !getType().equals("KeyStore")) { ++ /* ++ * The NSS Software Token in FIPS 140-2 mode requires a ++ * user login for most operations. See sftk_fipsCheck ++ * (nss/lib/softoken/fipstokn.c). In case of a KeyStore ++ * service, let the caller perform the login with ++ * KeyStore::load. Keytool, for example, does this to pass a ++ * PIN from either the -srcstorepass or -deststorepass ++ * argument. In case of a non-KeyStore service, perform the ++ * login now with the PIN available in the fips.nssdb.pin ++ * property. ++ */ + try { -+ session = token.getOpSession(); -+ p11.C_Login(session.id(), CKU_USER, new char[] {}); -+ } catch (PKCS11Exception p11e) { -+ if (debug != null) { -+ debug.println("Error during token login: " + -+ p11e.getMessage()); ++ if (System.getSecurityManager() != null) { ++ try { ++ AccessController.doPrivileged( ++ (PrivilegedExceptionAction) () -> { ++ token.ensureLoggedIn(null); ++ return null; ++ }); ++ } catch (PrivilegedActionException pae) { ++ Exception e = pae.getException(); ++ if (e instanceof LoginException le) { ++ throw le; ++ } else if (e instanceof PKCS11Exception p11e) { ++ throw p11e; ++ } else { ++ throw new RuntimeException(e); ++ } ++ } ++ } else { ++ token.ensureLoggedIn(null); + } -+ throw p11e; -+ } finally { -+ token.releaseSession(session); ++ } catch (PKCS11Exception | LoginException e) { ++ throw new ProviderException("FIPS: error during the Token" + ++ " login required for the " + getType() + ++ " service.", e); + } + } - } catch (Exception e) { - if (config.getHandleStartupErrors() == Config.ERR_IGNORE_ALL) { - throw new UnsupportedOperationException + try { + return newInstance0(param); + } catch (PKCS11Exception e) { +@@ -1750,6 +1863,9 @@ public final class SunPKCS11 extends AuthProvider { + try { + session = token.getOpSession(); + p11.C_Logout(session.id()); ++ if (systemFipsEnabled) { ++ token.fipsLoggedIn = false; ++ } + if (debug != null) { + debug.println("logout succeeded"); + } +diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Token.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Token.java +index 3378409ca1c..7602a92a252 100644 +--- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Token.java ++++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Token.java +@@ -33,6 +33,7 @@ import java.lang.ref.*; + import java.security.*; + import javax.security.auth.login.LoginException; + ++import jdk.internal.access.SharedSecrets; + import sun.security.jca.JCAUtil; + + import sun.security.pkcs11.wrapper.*; +@@ -48,6 +49,9 @@ import static sun.security.pkcs11.wrapper.PKCS11Exception.RV.*; + */ + final class Token implements Serializable { + ++ private static final boolean systemFipsEnabled = SharedSecrets ++ .getJavaSecuritySystemConfiguratorAccess().isSystemFipsEnabled(); ++ + // need to be serializable to allow SecureRandom to be serialized + @Serial + private static final long serialVersionUID = 2541527649100571747L; +@@ -125,6 +129,10 @@ final class Token implements Serializable { + // flag indicating whether we are logged in + private volatile boolean loggedIn; + ++ // Flag indicating the login status for the NSS Software Token in FIPS mode. ++ // This Token is never asynchronously removed. Used from SunPKCS11. ++ volatile boolean fipsLoggedIn; ++ + // time we last checked login status + private long lastLoginCheck; + +@@ -242,7 +250,12 @@ final class Token implements Serializable { + // call provider.login() if not + void ensureLoggedIn(Session session) throws PKCS11Exception, LoginException { + if (!isLoggedIn(session)) { +- provider.login(null, null); ++ if (systemFipsEnabled) { ++ provider.login(null, new FIPSTokenLoginHandler()); ++ fipsLoggedIn = true; ++ } else { ++ provider.login(null, null); ++ } + } + } + diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java index 4b06daaf264..55e14945469 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java @@ -3209,7 +3526,7 @@ index 920422376f8..6aa308fa5f8 100644 * Constructor taking the error code (the CKR_* constants in PKCS#11) and * extra info for error message. diff --git a/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java b/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java -index 3cfb74c8115..0e333d8ba74 100644 +index 7f8c4dba002..e65b11fc3ee 100644 --- a/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java +++ b/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java @@ -34,6 +34,7 @@ import java.security.ProviderException; @@ -3231,7 +3548,7 @@ index 3cfb74c8115..0e333d8ba74 100644 private static class ProviderServiceA extends ProviderService { ProviderServiceA(Provider p, String type, String algo, String cn, HashMap attrs) { -@@ -243,83 +248,85 @@ public final class SunEC extends Provider { +@@ -240,83 +245,85 @@ public final class SunEC extends Provider { putXDHEntries(); putEdDSAEntries(); @@ -3394,7 +3711,7 @@ index 3cfb74c8115..0e333d8ba74 100644 } private void putXDHEntries() { -@@ -336,23 +343,25 @@ public final class SunEC extends Provider { +@@ -333,23 +340,25 @@ public final class SunEC extends Provider { "X448", "sun.security.ec.XDHKeyFactory.X448", ATTRS)); @@ -3437,7 +3754,7 @@ index 3cfb74c8115..0e333d8ba74 100644 } private void putEdDSAEntries() { -@@ -367,21 +376,23 @@ public final class SunEC extends Provider { +@@ -364,21 +373,23 @@ public final class SunEC extends Provider { putService(new ProviderServiceA(this, "KeyFactory", "Ed448", "sun.security.ec.ed.EdDSAKeyFactory.Ed448", ATTRS)); @@ -3476,3 +3793,442 @@ index 3cfb74c8115..0e333d8ba74 100644 } } +diff --git a/test/jdk/sun/security/pkcs11/fips/NssdbPin.java b/test/jdk/sun/security/pkcs11/fips/NssdbPin.java +new file mode 100644 +index 00000000000..ce01c655eb8 +--- /dev/null ++++ b/test/jdk/sun/security/pkcs11/fips/NssdbPin.java +@@ -0,0 +1,349 @@ ++/* ++ * Copyright (c) 2022, Red Hat, Inc. ++ * ++ * 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. ++ * ++ * 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. ++ */ ++ ++import java.lang.reflect.Method; ++import java.nio.charset.StandardCharsets; ++import java.nio.file.Files; ++import java.nio.file.Path; ++import java.security.KeyStore; ++import java.security.Provider; ++import java.security.Security; ++import java.util.Arrays; ++import java.util.function.Consumer; ++import java.util.List; ++import javax.crypto.Cipher; ++import javax.crypto.spec.SecretKeySpec; ++ ++import jdk.test.lib.process.Proc; ++import jdk.test.lib.util.FileUtils; ++ ++/* ++ * @test ++ * @bug 9999999 ++ * @summary ++ * Test that the fips.nssdb.path and fips.nssdb.pin properties can be used ++ * for a successful login into an NSS DB. Some additional unitary testing ++ * is then performed. This test depends on NSS modutil and must be run in ++ * FIPS mode (the SunPKCS11-NSS-FIPS security provider has to be available). ++ * @modules jdk.crypto.cryptoki/sun.security.pkcs11:+open ++ * @library /test/lib ++ * @requires (jdk.version.major >= 8) ++ * @run main/othervm/timeout=600 NssdbPin ++ * @author Martin Balao (mbalao@redhat.com) ++ */ ++ ++public final class NssdbPin { ++ ++ // Public properties and names ++ private static final String FIPS_NSSDB_PATH_PROP = "fips.nssdb.path"; ++ private static final String FIPS_NSSDB_PIN_PROP = "fips.nssdb.pin"; ++ private static final String FIPS_PROVIDER_NAME = "SunPKCS11-NSS-FIPS"; ++ private static final String NSSDB_TOKEN_NAME = ++ "NSS FIPS 140-2 Certificate DB"; ++ ++ // Data to be tested ++ private static final String[] PINS_TO_TEST = ++ new String[] { ++ "", ++ "1234567890abcdef1234567890ABCDEF\uA4F7" ++ }; ++ private static enum PropType { SYSTEM, SECURITY } ++ private static enum LoginType { IMPLICIT, EXPLICIT } ++ ++ // Internal test fields ++ private static final boolean DEBUG = true; ++ private static class TestContext { ++ String pin; ++ PropType propType; ++ Path workspace; ++ String nssdbPath; ++ Path nssdbPinFile; ++ LoginType loginType; ++ TestContext(String pin, Path workspace) { ++ this.pin = pin; ++ this.workspace = workspace; ++ this.nssdbPath = "sql:" + workspace; ++ this.loginType = LoginType.IMPLICIT; ++ } ++ } ++ ++ public static void main(String[] args) throws Throwable { ++ if (args.length == 3) { ++ // Executed by a child process. ++ mainChild(args[0], args[1], LoginType.valueOf(args[2])); ++ } else if (args.length == 0) { ++ // Executed by the parent process. ++ mainLauncher(); ++ // Test defaults ++ mainChild("sql:/etc/pki/nssdb", "", LoginType.IMPLICIT); ++ System.out.println("TEST PASS - OK"); ++ } else { ++ throw new Exception("Unexpected number of arguments."); ++ } ++ } ++ ++ private static void mainChild(String expectedPath, String expectedPin, ++ LoginType loginType) throws Throwable { ++ if (DEBUG) { ++ for (String prop : Arrays.asList(FIPS_NSSDB_PATH_PROP, ++ FIPS_NSSDB_PIN_PROP)) { ++ System.out.println(prop + " (System): " + ++ System.getProperty(prop)); ++ System.out.println(prop + " (Security): " + ++ Security.getProperty(prop)); ++ } ++ } ++ ++ /* ++ * Functional cross-test against an NSS DB generated by modutil ++ * with the same PIN. Check that we can perform a crypto operation ++ * that requires a login. The login might be explicit or implicit. ++ */ ++ Provider p = Security.getProvider(FIPS_PROVIDER_NAME); ++ if (DEBUG) { ++ System.out.println(FIPS_PROVIDER_NAME + ": " + p); ++ } ++ if (p == null) { ++ throw new Exception(FIPS_PROVIDER_NAME + " initialization failed."); ++ } ++ if (DEBUG) { ++ System.out.println("Login type: " + loginType); ++ } ++ if (loginType == LoginType.EXPLICIT) { ++ // Do the expansion to account for truncation, so C_Login in ++ // the NSS Software Token gets a UTF-8 encoded PIN. ++ byte[] pinUtf8 = expectedPin.getBytes(StandardCharsets.UTF_8); ++ char[] pinChar = new char[pinUtf8.length]; ++ for (int i = 0; i < pinChar.length; i++) { ++ pinChar[i] = (char)(pinUtf8[i] & 0xFF); ++ } ++ KeyStore.getInstance("PKCS11", p).load(null, pinChar); ++ if (DEBUG) { ++ System.out.println("Explicit login succeeded."); ++ } ++ } ++ if (DEBUG) { ++ System.out.println("Trying a crypto operation..."); ++ } ++ final int blockSize = 16; ++ Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding", p); ++ cipher.init(Cipher.ENCRYPT_MODE, ++ new SecretKeySpec(new byte[blockSize], "AES")); ++ if (cipher.doFinal(new byte[blockSize]).length != blockSize) { ++ throw new Exception("Could not perform a crypto operation."); ++ } ++ if (DEBUG) { ++ if (loginType == LoginType.IMPLICIT) { ++ System.out.println("Implicit login succeeded."); ++ } ++ System.out.println("Crypto operation after login succeeded."); ++ } ++ ++ if (loginType == LoginType.IMPLICIT) { ++ /* ++ * Additional unitary testing. Expected to succeed at this point. ++ */ ++ if (DEBUG) { ++ System.out.println("Trying unitary test..."); ++ } ++ String sysPathProp = System.getProperty(FIPS_NSSDB_PATH_PROP); ++ if (DEBUG) { ++ System.out.println("Path value (as a System property): " + ++ sysPathProp); ++ } ++ if (!expectedPath.equals(sysPathProp)) { ++ throw new Exception("Path is different than expected: " + ++ sysPathProp + " (actual) vs " + expectedPath + ++ " (expected)."); ++ } ++ Class c = Class ++ .forName("sun.security.pkcs11.FIPSTokenLoginHandler"); ++ Method m = c.getDeclaredMethod("getFipsNssdbPin"); ++ m.setAccessible(true); ++ String pin = null; ++ char[] pinChar = (char[]) m.invoke(c); ++ if (pinChar != null) { ++ byte[] pinUtf8 = new byte[pinChar.length]; ++ for (int i = 0; i < pinUtf8.length; i++) { ++ pinUtf8[i] = (byte) pinChar[i]; ++ } ++ pin = new String(pinUtf8, StandardCharsets.UTF_8); ++ } ++ if (!expectedPin.isEmpty() && !expectedPin.equals(pin) || ++ expectedPin.isEmpty() && pin != null) { ++ throw new Exception("PIN is different than expected: '" + pin + ++ "' (actual) vs '" + expectedPin + "' (expected)."); ++ } ++ if (DEBUG) { ++ System.out.println("PIN value: " + pin); ++ System.out.println("Unitary test succeeded."); ++ } ++ } ++ } ++ ++ private static void mainLauncher() throws Throwable { ++ for (String pin : PINS_TO_TEST) { ++ Path workspace = Files.createTempDirectory(null); ++ try { ++ TestContext ctx = new TestContext(pin, workspace); ++ createNSSDB(ctx); ++ { ++ ctx.loginType = LoginType.IMPLICIT; ++ for (PropType propType : PropType.values()) { ++ ctx.propType = propType; ++ pinLauncher(ctx); ++ envLauncher(ctx); ++ fileLauncher(ctx); ++ } ++ } ++ explicitLoginLauncher(ctx); ++ } finally { ++ FileUtils.deleteFileTreeWithRetry(workspace); ++ } ++ } ++ } ++ ++ private static void pinLauncher(TestContext ctx) throws Throwable { ++ launchTest(p -> {}, "pin:" + ctx.pin, ctx); ++ } ++ ++ private static void envLauncher(TestContext ctx) throws Throwable { ++ final String NSSDB_PIN_ENV_VAR = "NSSDB_PIN_ENV_VAR"; ++ launchTest(p -> p.env(NSSDB_PIN_ENV_VAR, ctx.pin), ++ "env:" + NSSDB_PIN_ENV_VAR, ctx); ++ } ++ ++ private static void fileLauncher(TestContext ctx) throws Throwable { ++ // The file containing the PIN (ctx.nssdbPinFile) was created by the ++ // generatePinFile method, called from createNSSDB. ++ launchTest(p -> {}, "file:" + ctx.nssdbPinFile, ctx); ++ } ++ ++ private static void explicitLoginLauncher(TestContext ctx) ++ throws Throwable { ++ ctx.loginType = LoginType.EXPLICIT; ++ ctx.propType = PropType.SYSTEM; ++ launchTest(p -> {}, "Invalid PIN, must be ignored", ctx); ++ } ++ ++ private static void launchTest(Consumer procCb, String pinPropVal, ++ TestContext ctx) throws Throwable { ++ if (DEBUG) { ++ System.out.println("Launching JVM with " + FIPS_NSSDB_PATH_PROP + ++ "=" + ctx.nssdbPath + " and " + FIPS_NSSDB_PIN_PROP + ++ "=" + pinPropVal); ++ } ++ Proc p = Proc.create(NssdbPin.class.getName()) ++ .args(ctx.nssdbPath, ctx.pin, ctx.loginType.name()); ++ if (ctx.propType == PropType.SYSTEM) { ++ p.prop(FIPS_NSSDB_PATH_PROP, ctx.nssdbPath); ++ p.prop(FIPS_NSSDB_PIN_PROP, pinPropVal); ++ // Make sure that Security properties defaults are not used. ++ p.secprop(FIPS_NSSDB_PATH_PROP, ""); ++ p.secprop(FIPS_NSSDB_PIN_PROP, ""); ++ } else if (ctx.propType == PropType.SECURITY) { ++ p.secprop(FIPS_NSSDB_PATH_PROP, ctx.nssdbPath); ++ pinPropVal = escapeForPropsFile(pinPropVal); ++ p.secprop(FIPS_NSSDB_PIN_PROP, pinPropVal); ++ } else { ++ throw new Exception("Unsupported property type."); ++ } ++ if (DEBUG) { ++ p.inheritIO(); ++ p.prop("java.security.debug", "sunpkcs11"); ++ p.debug(NssdbPin.class.getName()); ++ ++ // Need the launched process to connect to a debugger? ++ //System.setProperty("test.vm.opts", "-Xdebug -Xrunjdwp:" + ++ // "transport=dt_socket,address=localhost:8000,suspend=y"); ++ } else { ++ p.nodump(); ++ } ++ procCb.accept(p); ++ p.start().waitFor(0); ++ } ++ ++ private static String escapeForPropsFile(String str) throws Throwable { ++ StringBuffer sb = new StringBuffer(); ++ for (int i = 0; i < str.length(); i++) { ++ int cp = str.codePointAt(i); ++ if (Character.UnicodeBlock.of(cp) ++ == Character.UnicodeBlock.BASIC_LATIN) { ++ sb.append(Character.toChars(cp)); ++ } else { ++ sb.append("\\u").append(String.format("%04X", cp)); ++ } ++ } ++ return sb.toString(); ++ } ++ ++ private static void createNSSDB(TestContext ctx) throws Throwable { ++ ProcessBuilder pb = getModutilPB(ctx, "-create"); ++ if (DEBUG) { ++ System.out.println("Creating an NSS DB in " + ctx.workspace + ++ "..."); ++ System.out.println("cmd: " + String.join(" ", pb.command())); ++ } ++ if (pb.start().waitFor() != 0) { ++ throw new Exception("NSS DB creation failed."); ++ } ++ generatePinFile(ctx); ++ pb = getModutilPB(ctx, "-changepw", NSSDB_TOKEN_NAME, ++ "-newpwfile", ctx.nssdbPinFile.toString()); ++ if (DEBUG) { ++ System.out.println("NSS DB created."); ++ System.out.println("Changing NSS DB PIN..."); ++ System.out.println("cmd: " + String.join(" ", pb.command())); ++ } ++ if (pb.start().waitFor() != 0) { ++ throw new Exception("NSS DB PIN change failed."); ++ } ++ if (DEBUG) { ++ System.out.println("NSS DB PIN changed."); ++ } ++ } ++ ++ private static ProcessBuilder getModutilPB(TestContext ctx, String... args) ++ throws Throwable { ++ ProcessBuilder pb = new ProcessBuilder("modutil", "-force"); ++ List pbCommand = pb.command(); ++ if (args != null) { ++ pbCommand.addAll(Arrays.asList(args)); ++ } ++ pbCommand.add("-dbdir"); ++ pbCommand.add(ctx.nssdbPath); ++ if (DEBUG) { ++ pb.inheritIO(); ++ } else { ++ pb.redirectError(ProcessBuilder.Redirect.INHERIT); ++ } ++ return pb; ++ } ++ ++ private static void generatePinFile(TestContext ctx) throws Throwable { ++ ctx.nssdbPinFile = Files.createTempFile(ctx.workspace, null, null); ++ Files.writeString(ctx.nssdbPinFile, ctx.pin + System.lineSeparator() + ++ "2nd line with garbage"); ++ } ++} +diff --git a/test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java b/test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java +new file mode 100644 +index 00000000000..87f1ad04505 +--- /dev/null ++++ b/test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java +@@ -0,0 +1,77 @@ ++/* ++ * Copyright (c) 2022, Red Hat, Inc. ++ * ++ * 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. ++ * ++ * 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. ++ */ ++ ++import java.security.Provider; ++import java.security.Security; ++ ++/* ++ * @test ++ * @bug 9999999 ++ * @requires (jdk.version.major >= 8) ++ * @run main/othervm/timeout=30 VerifyMissingAttributes ++ * @author Martin Balao (mbalao@redhat.com) ++ */ ++ ++public final class VerifyMissingAttributes { ++ ++ private static final String[] svcAlgImplementedIn = { ++ "AlgorithmParameterGenerator.DSA", ++ "AlgorithmParameters.DSA", ++ "CertificateFactory.X.509", ++ "KeyStore.JKS", ++ "KeyStore.CaseExactJKS", ++ "KeyStore.DKS", ++ "CertStore.Collection", ++ "CertStore.com.sun.security.IndexedCollection" ++ }; ++ ++ public static void main(String[] args) throws Throwable { ++ Provider sunProvider = Security.getProvider("SUN"); ++ for (String svcAlg : svcAlgImplementedIn) { ++ String filter = svcAlg + " ImplementedIn:Software"; ++ doQuery(sunProvider, filter); ++ } ++ if (Double.parseDouble( ++ System.getProperty("java.specification.version")) >= 17) { ++ String filter = "KeyFactory.RSASSA-PSS SupportedKeyClasses:" + ++ "java.security.interfaces.RSAPublicKey" + ++ "|java.security.interfaces.RSAPrivateKey"; ++ doQuery(Security.getProvider("SunRsaSign"), filter); ++ } ++ System.out.println("TEST PASS - OK"); ++ } ++ ++ private static void doQuery(Provider expectedProvider, String filter) ++ throws Exception { ++ if (expectedProvider == null) { ++ throw new Exception("Provider not found."); ++ } ++ Provider[] providers = Security.getProviders(filter); ++ if (providers == null || providers.length != 1 || ++ providers[0] != expectedProvider) { ++ throw new Exception("Failure retrieving the provider with this" + ++ " query: " + filter); ++ } ++ } ++} + diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 0d8400d..518de1f 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -383,7 +383,7 @@ # Define IcedTea version used for SystemTap tapsets and desktop file %global icedteaver 6.0.0pre00-c848b93a8598 # Define current Git revision for the FIPS support patches -%global fipsver fd3de3d95b5 +%global fipsver 75ffdc48eda # Standard JPackage naming and versioning defines %global origin openjdk @@ -632,9 +632,6 @@ Source15: TestSecurityProperties.java # Ensure vendor settings are correct Source16: CheckVendor.java -# nss fips configuration file -Source17: nss.fips.cfg.in - # Ensure translations are available for new timezones Source18: TestTranslations.java @@ -667,8 +664,8 @@ Patch3: rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk1 Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch # Crypto policy and FIPS support patches -# Patch is generated from the fips-20u tree at https://github.com/rh-openjdk/jdk/tree/fips-20u -# as follows: git diff %%{vcstag} src make > fips-20u-$(git show -s --format=%h HEAD).patch +# Patch is generated from the fips-21u tree at https://github.com/rh-openjdk/jdk/tree/fips-21u +# as follows: git diff %%{vcstag} src make test > fips-21u-$(git show -s --format=%h HEAD).patch # Diff is limited to src and make subdirectories to exclude .github changes # Fixes currently included: # PR3183, RH1340845: Follow system wide crypto policy @@ -691,8 +688,18 @@ Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-d # RH2090378: Revert to disabling system security properties and FIPS mode support together # RH2104724: Avoid import/export of DH private keys # RH2092507: P11Key.getEncoded does not work for DH keys in FIPS mode +# RH2048582: Support PKCS#12 keystores +# RH2020290: Support TLS 1.3 in FIPS mode +# Add nss.fips.cfg support to OpenJDK tree +# RH2117972: Extend the support for NSS DBs (PKCS11) in FIPS mode +# Remove forgotten dead code from RH2020290 and RH2104724 +# OJ1357: Fix issue on FIPS with a SecurityManager in place +# RH2134669: Add missing attributes when registering services in FIPS mode. +# test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java: fixed jtreg main class +# RH1940064: Enable XML Signature provider in FIPS mode # Build the systemconf library on all platforms -# Patch1001: fips-20u-%{fipsver}.patch +# Remove GCC minor versioning (JDK-8284772) to unbreak testing +Patch1001: fips-21u-%{fipsver}.patch ############################################# # @@ -761,8 +768,8 @@ BuildRequires: java-latest-openjdk-devel %ifarch %{zero_arches} BuildRequires: libffi-devel %endif -# 2022g required as of JDK-8297804 -BuildRequires: tzdata-java >= 2022g +# 2023c required as of JDK-8305113 +BuildRequires: tzdata-java >= 2023c # cacerts build requirement in portable mode BuildRequires: ca-certificates @@ -977,7 +984,7 @@ pushd %{top_level_dir_name} %patch3 -p1 %patch6 -p1 # Add crypto policy and FIPS support -# %patch1001 -p1 +%patch1001 -p1 # nss.cfg PKCS11 support; must come last as it also alters java.security %patch1000 -p1 popd # openjdk @@ -1039,9 +1046,6 @@ done # Setup nss.cfg sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg -# Setup nss.fips.cfg -sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE17} > nss.fips.cfg - %build %if (0%{?rhel} > 0 && 0%{?rhel} < 8) mkdir bootjdk @@ -1151,6 +1155,7 @@ function buildjdk() { --with-boot-jdk=${buildjdk} \ --with-debug-level=${debuglevel} \ --with-native-debug-symbols="%{debug_symbols}" \ + --disable-sysconf-nss \ --enable-unlimited-crypto \ --with-zlib=%{link_type} \ --with-freetype=%{link_type} \ @@ -1202,9 +1207,6 @@ function installjdk() { # Install nss.cfg right away as we will be using the JRE above install -m 644 nss.cfg ${imagepath}/conf/security/ - # Install nss.fips.cfg: NSS configuration for global FIPS mode (crypto-policies) - install -m 644 nss.fips.cfg ${imagepath}/conf/security/ - # Create fake alt-java as a placeholder for future alt-java if [ -d man/man1 ] ; then pushd ${imagepath} @@ -1632,6 +1634,19 @@ done - updated to jdk21 ea - updated patch 1001 - rh1648249-add_commented_out_nss_cfg_provider_to_java_security - replace smoketests in staticlibs test, as the previous files used were removed by a patch in JDK +- require tzdata 2023c +- Update FIPS support to bring in latest changes +- * RH2048582: Support PKCS#12 keystores +- * RH2020290: Support TLS 1.3 in FIPS mode +- * Add nss.fips.cfg support to OpenJDK tree +- * RH2117972: Extend the support for NSS DBs (PKCS11) in FIPS mode +- * Remove forgotten dead code from RH2020290 and RH2104724 +- * OJ1357: Fix issue on FIPS with a SecurityManager in place +- * RH2134669: Add missing attributes when registering services in FIPS mode. +- * test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java: fixed jtreg main class +- * RH1940064: Enable XML Signature provider in FIPS mode +- * Remove GCC minor versioning (JDK-8284772) to unbreak testing +- Drop local nss.fips.cfg.in handling now this is handled in the patched OpenJDK build * Thu Aug 03 2023 Jiri Vanek - 1:20.0.2.0.9-1.rolling - Update to jdk-20.0.2+9 diff --git a/nss.fips.cfg.in b/nss.fips.cfg.in deleted file mode 100644 index 2d9ec35..0000000 --- a/nss.fips.cfg.in +++ /dev/null @@ -1,8 +0,0 @@ -name = NSS-FIPS -nssLibraryDirectory = @NSS_LIBDIR@ -nssSecmodDirectory = sql:/etc/pki/nssdb -nssDbMode = readOnly -nssModule = fips - -attributes(*,CKO_SECRET_KEY,CKK_GENERIC_SECRET)={ CKA_SIGN=true } - diff --git a/rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch b/rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch index ff3a79b..b357edf 100644 --- a/rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch +++ b/rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch @@ -1,13 +1,13 @@ -diff --git a/src/java.base/share/conf/security/java.security b/src/java.base/share/conf/security/java.security -index 5149edba0e5..7676c695b36 100644 ---- a/src/java.base/share/conf/security/java.security -+++ b/src/java.base/share/conf/security/java.security -@@ -84,6 +84,8 @@ security.provider.tbd=SunMSCAPI +diff --git openjdk.orig/src/java.base/share/conf/security/java.security openjdk/src/java.base/share/conf/security/java.security +index 68a9c1a2d08..7aa25eb2cb7 100644 +--- openjdk.orig/src/java.base/share/conf/security/java.security ++++ openjdk/src/java.base/share/conf/security/java.security +@@ -78,6 +78,7 @@ security.provider.tbd=SunMSCAPI security.provider.tbd=Apple #endif security.provider.tbd=SunPKCS11 +#security.provider.tbd=SunPKCS11 ${java.home}/lib/security/nss.cfg -+ # - # A list of preferred providers for specific algorithms. These providers will + # Security providers used when FIPS mode support is active + From fd0dca9babe5e2a239d82d7c5570583d8138b8d3 Mon Sep 17 00:00:00 2001 From: Petra Alice Mikova Date: Fri, 25 Aug 2023 10:06:40 +0200 Subject: [PATCH 10/86] Update NEWS file with some missed JEPs --- NEWS | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 06591a2..066d951 100644 --- a/NEWS +++ b/NEWS @@ -6,8 +6,10 @@ CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY New in release OpenJDK 21.0.0 (2023-09-XX): =========================================== Major changes are listed below. Some changes may have been backported -to earlier releases following their first appearance in OpenJDK 18 -through to 21. +to earlier releases following their first appearance in OpenJDK 21. + +The full list of changes in 21u can be found at: +- * https://builds.shipilev.net/backports-monitor/release-notes-21.txt NEW FEATURES ============ @@ -122,6 +124,19 @@ java-17-openjdk). OpenJDK 18 saw a second round of incubation (JEP second in OpenJDK 20 (JEP 434). It reaches a third preview in OpenJDK 21 (JEP 442). +Virtual Threads +=============== +https://openjdk.org/jeps/425 +https://openjdk.org/jeps/436 + +Introduce virtual threads to the Java Platform. Virtual threads are +lightweight threads that dramatically reduce the effort of writing, +maintaining, and observing high-throughput concurrent applications. + +This is a preview feature (http://openjdk.java.net/jeps/12) introduced +in OpenJDK 19 (JEP 425) and reaching its second preview in OpenJDK 20 +(JEP 436). + Structured Concurrency ====================== https://openjdk.org/jeps/428 @@ -139,6 +154,18 @@ OpenJDK 21 (JEP 453). It was first introduced in incubation (https://openjdk.java.net/jeps/11) in OpenJDK 19 (JEP 428) and had a second round of incubation in OpenJDK 20 (JEP 437). +Scoped Values +============= +https://openjdk.org/jeps/429 + +Introduce scoped values, which enable the sharing of immutable data +within and across threads. They are preferred to thread-local +variables, especially when using large numbers of virtual threads. + +This API is now a preview feature (http://openjdk.java.net/jeps/12) +in OpenJDK 21 (JEP 429). It was first introduced in incubation +(https://openjdk.java.net/jeps/11) in OpenJDK 20 (JEP 429). + Sequenced Collections ===================== https://openjdk.org/jeps/431 From f6cdd00fdee89fb1aa62dc5ec5b95c067e84dc57 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 28 Aug 2023 16:04:28 +0200 Subject: [PATCH 11/86] updated to jdk-21+35, which is no longer EA --- .gitignore | 1 + generate_source_tarball.sh | 5 +++-- java-latest-openjdk-portable.spec | 7 +++++-- sources | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f411948..cf8d957 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ /openjdk-jdk20u-jdk-20.0.1+9.tar.xz /openjdk-jdk20u-jdk-20.0.2+9.tar.xz /openjdk-jdk21u-jdk-21+34.tar.xz +/openjdk-jdk21u-jdk-21+35.tar.xz diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index c5bb0e8..b1e2009 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -6,9 +6,10 @@ # If your local repo follows upstream forests conventions, it may be enough to set OPENJDK_URL # # In any case you have to set PROJECT_NAME REPO_NAME and VERSION. eg: +# BOOT_JDK=/usr/lib/jvm/java-20-openjdk # PROJECT_NAME=openjdk -# REPO_NAME=jdk18u -# VERSION=jdk-18.0.1+10 +# REPO_NAME=jdk21u +# VERSION=jdk-21+35 # or to eg prepare systemtap: # icedtea7's jstack and other tapsets # VERSION=6327cf1cea9e diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 518de1f..80d4854 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -390,7 +390,7 @@ %global origin_nice OpenJDK %global top_level_dir_name %{origin} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 34 +%global buildver 35 %global rpmrelease 1 # 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 @@ -417,7 +417,7 @@ # Release will be (where N is usually a number starting at 1): # - 0.N%%{?extraver}%%{?dist} for EA releases, # - N%%{?extraver}{?dist} for GA releases -%global is_ga 0 +%global is_ga 1 %if %{is_ga} %global build_type GA %global ea_designator "" @@ -1628,6 +1628,9 @@ done %license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %changelog +* Tue Aug 08 2023 Petra Alice Mikova 1:21.0.0.0.35-0.1.rolling +- updated to jdk-21+35, which is no longer EA + * Tue Aug 08 2023 Petra Alice Mikova 1:21.0.0.0.34-0.1.ea.rolling - initial update to jdk21 - commented out fips patches diff --git a/sources b/sources index c74d310..443c08d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-jdk21u-jdk-21+34.tar.xz) = 18254fa72851666d9e80a56dc85052d8711794b9c7f81c3f7a80e3c585b13eab783060b04fc3b3bbddbebbb8c4148109a9e822aba2f54aa3b614fd16149017b2 +SHA512 (openjdk-jdk21u-jdk-21+35.tar.xz) = 5961f12ff9828856e5ce7847a06177a6761088dbefbcac05512a7c3433d45154f6d59872cd00268fecd987128e623bb343d9879b26f6c6c811e6d6713d1b17a2 From fff7874101a13073dc48d63657881324f7c9d39e Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Thu, 14 Sep 2023 16:14:32 +0100 Subject: [PATCH 12/86] Bump buildjdkver now that java-21-openjdk is available in the buildroot --- java-latest-openjdk-portable.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 80d4854..65c2533 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -338,7 +338,7 @@ # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, # and this it is better to change it here, on single place -%global buildjdkver 20 +%global buildjdkver 21 # We don't add any LTS designator for STS packages (Fedora and EPEL). # We need to explicitly exclude EPEL as it would have the %%{rhel} macro defined. %if 0%{?rhel} && !0%{?epel} @@ -391,7 +391,7 @@ %global top_level_dir_name %{origin} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 35 -%global rpmrelease 1 +%global rpmrelease 2 # 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 # Using 10 digits may overflow the int used for priority, so we combine the patch and build versions @@ -1628,7 +1628,10 @@ done %license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} %changelog -* Tue Aug 08 2023 Petra Alice Mikova 1:21.0.0.0.35-0.1.rolling +* Thu Sep 14 2023 Andrew Hughes - 1:21.0.0.0.35-2.rolling +- Bump buildjdkver now that java-21-openjdk is available in the buildroot + +* Tue Aug 08 2023 Petra Alice Mikova 1:21.0.0.0.35-1.rolling - updated to jdk-21+35, which is no longer EA * Tue Aug 08 2023 Petra Alice Mikova 1:21.0.0.0.34-0.1.ea.rolling From 4ec83bb3a6d6f8530433036f7f73567b34326f0e Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Fri, 15 Sep 2023 18:23:53 +0100 Subject: [PATCH 13/86] Sync with upcoming java-21-openjdk package in RHEL - Update documentation (README.md, add missing JEP to release notes) - Replace alt-java patch with a binary separate from the JDK - Drop stale patches that are of little use any more: - * nss.cfg has been disabled since early PKCS11 work and long superseded by FIPS work - * No accessibility subpackage to warrant RH1648242 patch any more - * No use of system libjpeg turbo to warrant RH649512 patch any more - Replace RH1684077 pcsc-lite-libs patch with better JDK-8009550 fix being upstreamed - Update generate_tarball.sh to sync with upstream vanilla script - Change top_level_dir_name to use the VCS tag, matching new upstream release style tarball - Use upstream release URL for OpenJDK source - Port misc tarball from RHEL to house alt-java outside the JDK tree - Port improved tarball creation and checking from RHEL so tarballs are verified --- .gitignore | 1 + NEWS | 21 ++- README.md | 24 ++- alt-java.c | 100 +++++++++++ generate_source_tarball.sh | 48 ++--- java-latest-openjdk-portable.spec | 166 +++++++++++------- ...0-rh910107-fail_to_load_pcsc_library.patch | 125 +++++++++++++ nss.cfg.in | 5 - ...sible_toolkit_crash_do_not_break_jvm.patch | 16 -- ...ut_nss_cfg_provider_to_java_security.patch | 13 -- ...lite-libs_instead_of_pcsc-lite-devel.patch | 15 -- rh1750419-redhat_alt_java.patch | 117 ------------ ...eg_turbo_1_4_compat_for_jdk10_and_up.patch | 19 -- sources | 2 +- 14 files changed, 383 insertions(+), 289 deletions(-) create mode 100644 alt-java.c create mode 100644 jdk8009550-rh910107-fail_to_load_pcsc_library.patch delete mode 100644 nss.cfg.in delete mode 100644 rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch delete mode 100644 rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch delete mode 100644 rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch delete mode 100644 rh1750419-redhat_alt_java.patch delete mode 100644 rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch diff --git a/.gitignore b/.gitignore index cf8d957..79f3174 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ /openjdk-jdk20u-jdk-20.0.2+9.tar.xz /openjdk-jdk21u-jdk-21+34.tar.xz /openjdk-jdk21u-jdk-21+35.tar.xz +/openjdk-21+35.tar.xz diff --git a/NEWS b/NEWS index 066d951..73322e7 100644 --- a/NEWS +++ b/NEWS @@ -76,6 +76,20 @@ an underscore character, _. This is a preview feature (http://openjdk.java.net/jeps/12) introduced in OpenJDK 21 (JEP 443). +Unnamed Classes and Instance Main Methods +========================================= +https://openjdk.org/jeps/445 + +Evolve the Java language so that students can write their first +programs without needing to understand language features designed for +large programs. Far from using a separate dialect of Java, students +can write streamlined declarations for single-class programs and then +seamlessly expand their programs to use more advanced features as +their skills grow. + +This is a preview feature (http://openjdk.java.net/jeps/12) introduced +in OpenJDK 21 (JEP 445). + Library Features ================ @@ -128,14 +142,15 @@ Virtual Threads =============== https://openjdk.org/jeps/425 https://openjdk.org/jeps/436 +https://openjdk.org/jeps/444 Introduce virtual threads to the Java Platform. Virtual threads are lightweight threads that dramatically reduce the effort of writing, maintaining, and observing high-throughput concurrent applications. -This is a preview feature (http://openjdk.java.net/jeps/12) introduced -in OpenJDK 19 (JEP 425) and reaching its second preview in OpenJDK 20 -(JEP 436). +This was a preview feature (http://openjdk.java.net/jeps/12) +introduced in OpenJDK 19 (JEP 425) and reaching its second preview in +OpenJDK 20 (JEP 436). It became final with OpenJDK 21 (JEP 444). Structured Concurrency ====================== diff --git a/README.md b/README.md index d139d7d..55536ce 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,14 @@ -# java-latest-openjdk-portable +This package contains the latest rolling release of OpenJDK. OpenJDK +has a release cadence of six months, with a new release in March and +September each year. -The java-latest-openjdk-portable package -======= -Rolling release of (usually) STSs OpenJDK -OpenJDK has release cadence of 6 months, but 3/4 of them are Short Term Supported for 6 months only. This package is designed to harbor them. Currently it is build of OpenJDK 12. LTSs will go also as separate packages. +The current release is OpenJDK 21. For a list of major changes from +OpenJDK 20, see the NEWS file included in this package and the +upstream release page: -JDK21 is current release of Java platform. It is bringing many cool improvements - https://openjdk.org/projects/jdk/21/ and is landing to your Fedora. Where it will be maintained for f28 and newer. Unluckily, this package is STS (short term support) version. Between individual LTS there will be always several STS. Again, please see announcement: http://mail.openjdk.java.net/pipermail/discuss/2017-September/004281.html and See java SIG plans: https://jvanek.fedorapeople.org/devconf/2018/changesInjavaReleaseProcess.pdf . So this is rolling release of all STSs to come. Its fate during the release of fresh LTS is yet to be decided. You will always be allowed to install LTS in fedora build root, alongside with latest STS via alternatives. +https://openjdk.java.net/projects/jdk/21/ - -See announcement: http://mail.openjdk.java.net/pipermail/discuss/2017-September/004281.html -See java SIG plans: https://jvanek.fedorapeople.org/devconf/2018/changesInjavaReleaseProcess.pdf - -https://bugzilla.redhat.com/show_bug.cgi?id=1557371#c0 -https://fedoraproject.org/wiki/Changes/java-openjdk-10 -https://fedoraproject.org/wiki/Changes/java-11-openjdk-TechPreview +This package is intended for those who want to follow the latest +OpenJDK releases. Long term support versions of OpenJDK are available +in the java-1.8.0-openjdk, java-11-openjdk and java-17-openjdk +packages. diff --git a/alt-java.c b/alt-java.c new file mode 100644 index 0000000..644d002 --- /dev/null +++ b/alt-java.c @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2023 Red Hat, Inc. + * 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. Red Hat designates this + * particular file as subject to the "Classpath" exception as provided + * by Red Hat 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. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* Per task speculation control */ +#ifndef PR_GET_SPECULATION_CTRL +# define PR_GET_SPECULATION_CTRL 52 +#endif +#ifndef PR_SET_SPECULATION_CTRL +# define PR_SET_SPECULATION_CTRL 53 +#endif +/* Speculation control variants */ +#ifndef PR_SPEC_STORE_BYPASS +# define PR_SPEC_STORE_BYPASS 0 +#endif +/* Return and control values for PR_SET/GET_SPECULATION_CTRL */ + +#ifndef PR_SPEC_NOT_AFFECTED +# define PR_SPEC_NOT_AFFECTED 0 +#endif +#ifndef PR_SPEC_PRCTL +# define PR_SPEC_PRCTL (1UL << 0) +#endif +#ifndef PR_SPEC_ENABLE +# define PR_SPEC_ENABLE (1UL << 1) +#endif +#ifndef PR_SPEC_DISABLE +# define PR_SPEC_DISABLE (1UL << 2) +#endif +#ifndef PR_SPEC_FORCE_DISABLE +# define PR_SPEC_FORCE_DISABLE (1UL << 3) +#endif +#ifndef PR_SPEC_DISABLE_NOEXEC +# define PR_SPEC_DISABLE_NOEXEC (1UL << 4) +#endif + +static void set_speculation() { +#if defined(__linux__) && defined(__x86_64__) + // PR_SPEC_DISABLE_NOEXEC doesn't survive execve, so we can't use it + // if ( prctl(PR_SET_SPECULATION_CTRL, + // PR_SPEC_STORE_BYPASS, + // PR_SPEC_DISABLE_NOEXEC, 0, 0) == 0 ) { + // return; + // } + prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_STORE_BYPASS, PR_SPEC_DISABLE, 0, 0); +#else +#warning alt-java requested but SSB mitigation not available on this platform. +#endif +} + +int main(int argc, char **argv) { + set_speculation(); + + char our_name[PATH_MAX], java_name[PATH_MAX]; + ssize_t len = readlink("/proc/self/exe", our_name, PATH_MAX - 1); + if (len < 0) { + perror("I can't find myself"); + exit(2); + } + + our_name[len] = '\0'; // readlink(2) doesn't append a null byte + char *path = dirname(our_name); + strncpy(java_name, path, PATH_MAX - 1); + + size_t remaining_bytes = PATH_MAX - strlen(path) - 1; + strncat(java_name, "/java", remaining_bytes); + + execv(java_name, argv); + fprintf(stderr, "%s failed to launch: %s\n", java_name, strerror(errno)); + + exit(1); +} + diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index b1e2009..f27158d 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -30,19 +30,20 @@ set -e OPENJDK_URL_DEFAULT=https://github.com COMPRESSION_DEFAULT=xz -# Corresponding IcedTea version -ICEDTEA_VERSION=15.0 if [ "x$1" = "xhelp" ] ; then + if [ "x$VERSION" = "x" ] ; then + VERSION=""; + fi echo -e "Behaviour may be specified by setting the following variables:\n" - echo "VERSION - the version of the specified OpenJDK project" + echo "VERSION - the version of the specified OpenJDK project (current value: ${VERSION})" echo "PROJECT_NAME -- the name of the OpenJDK project being archived (optional; only needed by defaults)" echo "REPO_NAME - the name of the OpenJDK repository (optional; only needed by defaults)" echo "OPENJDK_URL - the URL to retrieve code from (optional; defaults to ${OPENJDK_URL_DEFAULT})" echo "COMPRESSION - the compression type to use (optional; defaults to ${COMPRESSION_DEFAULT})" - echo "FILE_NAME_ROOT - name of the archive, minus extensions (optional; defaults to PROJECT_NAME-REPO_NAME-VERSION)" + echo "FILE_NAME_ROOT - name of the archive, minus extensions (optional; defaults to open${VERSION})" echo "REPO_ROOT - the location of the Git repository to archive (optional; defaults to OPENJDK_URL/PROJECT_NAME/REPO_NAME)" - echo "TO_COMPRESS - what part of clone to pack (default is openjdk)" + echo "TO_COMPRESS - what part of clone to pack (default is ${VERSION})" echo "BOOT_JDK - the bootstrap JDK to satisfy the configure run" exit 1; fi @@ -53,6 +54,7 @@ if [ "x$VERSION" = "x" ] ; then exit 2 fi echo "Version: ${VERSION}" + NUM_VER=${VERSION##jdk-} RELEASE_VER=${NUM_VER%%+*} BUILD_VER=${NUM_VER##*+} @@ -109,7 +111,7 @@ fi echo "Creating a tar.${COMPRESSION} archive" if [ "x$FILE_NAME_ROOT" = "x" ] ; then - FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION} + FILE_NAME_ROOT=open${VERSION} echo "No file name root specified; default to ${FILE_NAME_ROOT}" fi if [ "x$REPO_ROOT" = "x" ] ; then @@ -118,7 +120,7 @@ if [ "x$REPO_ROOT" = "x" ] ; then fi; if [ "x$TO_COMPRESS" = "x" ] ; then - TO_COMPRESS="openjdk" + TO_COMPRESS="${VERSION}" echo "No targets to be compressed specified, ; default to ${TO_COMPRESS}" fi; @@ -141,35 +143,35 @@ else mkdir "${FILE_NAME_ROOT}" pushd "${FILE_NAME_ROOT}" echo "Cloning ${VERSION} root repository from ${REPO_ROOT}" - git clone -b ${VERSION} ${REPO_ROOT} openjdk + git clone -b ${VERSION} ${REPO_ROOT} ${VERSION} popd fi pushd "${FILE_NAME_ROOT}" # Generate .src-rev so build has knowledge of the revision the tarball was created from mkdir build pushd build - sh ${PWD}/../openjdk/configure --with-boot-jdk=${BOOT_JDK} + sh ${PWD}/../${VERSION}/configure --with-boot-jdk=${BOOT_JDK} make store-source-revision popd rm -rf build # Remove commit checks - echo "Removing $(find openjdk -name '.jcheck' -print)" - find openjdk -name '.jcheck' -print0 | xargs -0 rm -rf + echo "Removing $(find ${VERSION} -name '.jcheck' -print)" + find ${VERSION} -name '.jcheck' -print0 | xargs -0 rm -r # Remove history and GHA - echo "find openjdk -name '.hgtags'" - find openjdk -name '.hgtags' -exec rm -fv '{}' '+' - echo "find openjdk -name '.hgignore'" - find openjdk -name '.hgignore' -exec rm -fv '{}' '+' - echo "find openjdk -name '.gitattributes'" - find openjdk -name '.gitattributes' -exec rm -fv '{}' '+' - echo "find openjdk -name '.gitignore'" - find openjdk -name '.gitignore' -exec rm -fv '{}' '+' - echo "find openjdk -name '.git'" - find openjdk -name '.git' -exec rm -rfv '{}' '+' - echo "find openjdk -name '.github'" - find openjdk -name '.github' -exec rm -rfv '{}' '+' + echo "find ${VERSION} -name '.hgtags'" + find ${VERSION} -name '.hgtags' -exec rm -v '{}' '+' + echo "find ${VERSION} -name '.hgignore'" + find ${VERSION} -name '.hgignore' -exec rm -v '{}' '+' + echo "find ${VERSION} -name '.gitattributes'" + find ${VERSION} -name '.gitattributes' -exec rm -v '{}' '+' + echo "find ${VERSION} -name '.gitignore'" + find ${VERSION} -name '.gitignore' -exec rm -v '{}' '+' + echo "find ${VERSION} -name '.git'" + find ${VERSION} -name '.git' -exec rm -rv '{}' '+' + echo "find ${VERSION} -name '.github'" + find ${VERSION} -name '.github' -exec rm -rv '{}' '+' echo "Compressing remaining forest" if [ "X$COMPRESSION" = "Xxz" ] ; then diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 65c2533..4710c10 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -257,12 +257,6 @@ %global ourcppflags %(echo %ourflags | sed -e 's|-fexceptions||') %global ourldflags %{__global_ldflags} -# With disabled nss is NSS deactivated, so NSS_LIBDIR can contain the wrong path -# the initialization must be here. Later the pkg-config have buggy behavior -# looks like openjdk RPM specific bug -# Always set this so the nss.cfg file is not broken -%global NSS_LIBDIR %(pkg-config --variable=libdir nss) - # In some cases, the arch used by the JDK does # not match _arch. # Also, in some cases, the machine name used by SystemTap @@ -388,10 +382,10 @@ # Standard JPackage naming and versioning defines %global origin openjdk %global origin_nice OpenJDK -%global top_level_dir_name %{origin} +%global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 35 -%global rpmrelease 2 +%global rpmrelease 3 # 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 # Using 10 digits may overflow the int used for priority, so we combine the patch and build versions @@ -444,6 +438,7 @@ %global static_libs_install_dir %{static_libs_arch_dir}/glibc # output dir stub %define buildoutputdir() %{expand:build/jdk%{featurever}.build%{?1}} +%global altjavaoutputdir install/altjava.install # we can copy the javadoc to not arched dir, or make it not noarch %define uniquejavadocdir() %{expand:%{fullversion}.%{_arch}%{?1}} # main id and dir of this jdk @@ -464,6 +459,8 @@ # Intentionally use jdkportablenameimpl here since we want to have static-libs files overlayed on # top of the JDK archive %define staticlibsportablename() %{expand:%{jdkportablenameimpl -- %%{1}}} +%define miscportablename() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.misc;g" | sed "s;openjdkportable;el;g") +%define miscportablearchive() %{miscportablename}.tar.xz # RPM 4.19 no longer accept our double percentaged %%{nil} passed to %%{1} # so we have to pass in "" but evaluate it, otherwise files record will include it @@ -548,6 +545,8 @@ ExcludeArch: %{ix86} %define java_static_libs_rpo() %{expand: } +%define java_misc_rpo() %{expand: +} # Prevent brp-java-repack-jars from being run %global __jar_repack 0 @@ -598,7 +597,7 @@ URL: http://openjdk.java.net/ # The source tarball, generated using generate_source_tarball.sh -Source0: openjdk-jdk%{featurever}u-%{vcstag}.tar.xz +Source0: https://openjdk-sources.osci.io/openjdk%{featurever}/open%{vcstag}.tar.xz # Use 'icedtea_sync.sh' to update the following # They are based on code contained in the IcedTea project (6.x). @@ -613,8 +612,8 @@ Source0: openjdk-jdk%{featurever}u-%{vcstag}.tar.xz # Release notes Source10: NEWS -# nss configuration file -Source11: nss.cfg.in +# Source code for alt-java +Source11: alt-java.c # Removed libraries that we link instead # Disabled in portables @@ -649,20 +648,6 @@ Source1004: ojdk17-s390x-17.35.tar.gz # ############################################ -# NSS via SunPKCS11 Provider (disabled comment -# due to memory leak). -Patch1000: rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch -# RH1750419: enable build of speculative store bypass hardened alt-java (CVE-2018-3639) -Patch600: rh1750419-redhat_alt_java.patch - -# Ignore AWTError when assistive technologies are loaded -Patch1: rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch -# Restrict access to java-atk-wrapper classes -Patch2: rh1648644-java_access_bridge_privileged_security.patch -Patch3: rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch -# Depend on pcsc-lite-libs instead of pcsc-lite-devel as this is only in optional repo -Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch - # Crypto policy and FIPS support patches # Patch is generated from the fips-21u tree at https://github.com/rh-openjdk/jdk/tree/fips-21u # as follows: git diff %%{vcstag} src make test > fips-21u-$(git show -s --format=%h HEAD).patch @@ -688,7 +673,8 @@ Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-d # RH2090378: Revert to disabling system security properties and FIPS mode support together # RH2104724: Avoid import/export of DH private keys # RH2092507: P11Key.getEncoded does not work for DH keys in FIPS mode -# RH2048582: Support PKCS#12 keystores +# Build the systemconf library on all platforms +# RH2048582: Support PKCS#12 keystores [now part of JDK-8301553 upstream] # RH2020290: Support TLS 1.3 in FIPS mode # Add nss.fips.cfg support to OpenJDK tree # RH2117972: Extend the support for NSS DBs (PKCS11) in FIPS mode @@ -697,15 +683,17 @@ Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-d # RH2134669: Add missing attributes when registering services in FIPS mode. # test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java: fixed jtreg main class # RH1940064: Enable XML Signature provider in FIPS mode -# Build the systemconf library on all platforms -# Remove GCC minor versioning (JDK-8284772) to unbreak testing -Patch1001: fips-21u-%{fipsver}.patch +# RH2173781: Avoid calling C_GetInfo() too early, before cryptoki is initialized [now part of JDK-8301553 upstream] +Patch1001: fips-%{featurever}u-%{fipsver}.patch ############################################# # # OpenJDK patches in need of upstreaming # ############################################# +# JDK-8009550, RH910107: Depend on pcsc-lite-libs instead of pcsc-lite-devel as this is only in optional repo +# PR: https://github.com/openjdk/jdk/pull/15409 +Patch6: jdk8009550-rh910107-fail_to_load_pcsc_library.patch ############################################# # @@ -746,7 +734,7 @@ BuildRequires: libXrandr-devel BuildRequires: libXrender-devel BuildRequires: libXt-devel BuildRequires: libXtst-devel -# Requirement for setting up nss.cfg and nss.fips.cfg +# Requirement for setting up nss.fips.cfg BuildRequires: nss-devel # Requirement for system security property test %if (0%{?rhel} > 0 && 0%{?rhel} < 8) @@ -916,6 +904,14 @@ The %{origin_nice} %{featurever} libraries for static linking - portable edition # staticlibs %endif +%package misc +Summary: %{origin_nice} %{featurever} miscellany + +%{java_misc_rpo %{nil}} + +%description misc +The %{origin_nice} %{featurever} miscellany. + %package sources Summary: %{origin_nice} %{featurever} full patched sources of portable JDK @@ -979,18 +975,12 @@ sh %{SOURCE12} %{top_level_dir_name} # Patch the JDK pushd %{top_level_dir_name} -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch6 -p1 # Add crypto policy and FIPS support %patch1001 -p1 -# nss.cfg PKCS11 support; must come last as it also alters java.security -%patch1000 -p1 +# Patches in need of upstreaming +%patch6 -p1 popd # openjdk -%patch600 - # The OpenJDK version file includes the current # upstream version information. For some reason, # configure does not automatically use the @@ -1043,9 +1033,6 @@ done # Prepare desktop files # Portables do not have desktop integration -# Setup nss.cfg -sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg - %build %if (0%{?rhel} > 0 && 0%{?rhel} < 8) mkdir bootjdk @@ -1100,6 +1087,10 @@ EXTRA_CPP_FLAGS="$(echo ${EXTRA_CPP_FLAGS} | sed -e 's|-mstackrealign|-mincoming %endif export EXTRA_CFLAGS EXTRA_CPP_FLAGS +echo "Building %{SOURCE11}" +mkdir -p %{altjavaoutputdir} +gcc ${EXTRA_CFLAGS} -o %{altjavaoutputdir}/%{alt_java_name} %{SOURCE11} + function buildjdk() { local outputdir=${1} local buildjdk=${2} @@ -1204,9 +1195,6 @@ function installjdk() { find ${imagepath} -iname '*.so' -exec chmod +x {} \; find ${imagepath}/bin/ -exec chmod +x {} \; - # Install nss.cfg right away as we will be using the JRE above - install -m 644 nss.cfg ${imagepath}/conf/security/ - # Create fake alt-java as a placeholder for future alt-java if [ -d man/man1 ] ; then pushd ${imagepath} @@ -1294,10 +1282,25 @@ EOF fi } +function genchecksum() { + local checkedfile=${1} + + checkdir=$(dirname ${1}) + checkfile=$(basename ${1}) + + echo "Generating checksum for ${checkfile} in ${checkdir}..." + pushd ${checkdir} + sha256sum ${checkfile} > ${checkfile}.sha256sum + sha256sum --check ${checkfile}.sha256sum + popd +} + +packagesdir=$(pwd)/.. + pwd ls -l -tar -cJf ../%{jdkportablesourcesarchive -- ""} --transform "s|^|%{jdkportablesourcesname -- ""}/|" openjdk nss* -sha256sum ../%{jdkportablesourcesarchive -- ""} > ../%{jdkportablesourcesarchive -- ""}.sha256sum +tar -cJf ${packagesdir}/%{jdkportablesourcesarchive -- ""} --transform "s|^|%{jdkportablesourcesname -- ""}/|" %{top_level_dir_name} +genchecksum ${packagesdir}/%{jdkportablesourcesarchive -- ""} %if %{build_hotspot_first} # Build a fresh libjvm.so first and use it to bootstrap @@ -1410,12 +1413,12 @@ for suffix in %{build_loop} ; do mv %{jdkimage} %{jdkportablename -- "$nameSuffix"} mv %{jreimage} %{jreportablename -- "$nameSuffix"} - tar -cJf ../../../../%{jdkportablearchive -- "$nameSuffix"} --exclude='**.debuginfo' %{jdkportablename -- "$nameSuffix"} - sha256sum ../../../../%{jdkportablearchive -- "$nameSuffix"} > ../../../../%{jdkportablearchive -- "$nameSuffix"}.sha256sum - tar -cJf ../../../../%{jreportablearchive -- "$nameSuffix"} --exclude='**.debuginfo' %{jreportablename -- "$nameSuffix"} - sha256sum ../../../../%{jreportablearchive -- "$nameSuffix"} > ../../../../%{jreportablearchive -- "$nameSuffix"}.sha256sum + tar -cJf ${packagesdir}/%{jdkportablearchive -- "$nameSuffix"} --exclude='**.debuginfo' %{jdkportablename -- "$nameSuffix"} + genchecksum ${packagesdir}/%{jdkportablearchive -- "$nameSuffix"} + tar -cJf ${packagesdir}/%{jreportablearchive -- "$nameSuffix"} --exclude='**.debuginfo' %{jreportablename -- "$nameSuffix"} + genchecksum ${packagesdir}/%{jreportablearchive -- "$nameSuffix"} # copy licenses so they are avialable out of tarball - cp -rf %{jdkportablename -- "$nameSuffix"}/legal ../../../../%{jdkportablearchive -- "%{normal_suffix}"}-legal + cp -rf %{jdkportablename -- "$nameSuffix"}/legal ${packagesdir}/%{jdkportablearchive -- "%{normal_suffix}"}-legal mv %{jdkportablename -- "$nameSuffix"} %{jdkimage} mv %{jreportablename -- "$nameSuffix"} %{jreimage} popd #images @@ -1426,8 +1429,8 @@ for suffix in %{build_loop} ; do # Tar as overlay. Transform to the JDK name, since we just want to "add" # static libraries to that folder portableJDKname=%{staticlibsportablename -- "$nameSuffix"} - tar -cJf ../../../../%{staticlibsportablearchive -- "$nameSuffix"} --transform "s|^%{static_libs_image}/lib/*|$portableJDKname/lib/static/linux-%{archinstall}/glibc/|" "%{static_libs_image}/lib" - sha256sum ../../../../%{staticlibsportablearchive -- "$nameSuffix"} > ../../../../%{staticlibsportablearchive -- "$nameSuffix"}.sha256sum + tar -cJf ${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"} --transform "s|^%{static_libs_image}/lib/*|$portableJDKname/lib/static/linux-%{archinstall}/glibc/|" "%{static_libs_image}/lib" + genchecksum ${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"} popd #staticlibs-images %endif ################################################################################ @@ -1437,10 +1440,26 @@ for suffix in %{build_loop} ; do # build cycles done # end of release / debug cycle loop +# These are from the source tree so no debug variants +miscname=%{miscportablename} +miscarchive=${packagesdir}/%{miscportablearchive} + +mkdir ${miscname} +cp -av %{altjavaoutputdir}/%{alt_java_name} ${miscname} +tar -cJf ${miscarchive} ${miscname} +genchecksum ${miscarchive} + %install + +packagesdir=$(pwd)/.. + mkdir -p $RPM_BUILD_ROOT%{_jvmdir} -mv ../%{jdkportablesourcesarchive -- ""} $RPM_BUILD_ROOT%{_jvmdir}/ -mv ../%{jdkportablesourcesarchive -- ""}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ +# Install outside the loop as there are no debug variants +miscarchive=${packagesdir}/%{miscportablearchive} +mv ${packagesdir}/%{jdkportablesourcesarchive -- ""} $RPM_BUILD_ROOT%{_jvmdir}/ +mv ${packagesdir}/%{jdkportablesourcesarchive -- ""}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ +mv ${miscarchive} $RPM_BUILD_ROOT%{_jvmdir}/ +mv ${miscarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ for suffix in %{build_loop} ; do top_dir_abs_main_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{main_suffix}} @@ -1451,13 +1470,13 @@ top_dir_abs_main_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{main_suffix}} else nameSuffix=`echo "$suffix"| sed s/-/./` fi - mv ../%{jdkportablearchive -- "$nameSuffix"} $RPM_BUILD_ROOT%{_jvmdir}/ - mv ../%{jdkportablearchive -- "$nameSuffix"}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ - mv ../%{jreportablearchive -- "$nameSuffix"} $RPM_BUILD_ROOT%{_jvmdir}/ - mv ../%{jreportablearchive -- "$nameSuffix"}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ + mv ${packagesdir}/%{jdkportablearchive -- "$nameSuffix"} $RPM_BUILD_ROOT%{_jvmdir}/ + mv ${packagesdir}/%{jdkportablearchive -- "$nameSuffix"}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ + mv ${packagesdir}/%{jreportablearchive -- "$nameSuffix"} $RPM_BUILD_ROOT%{_jvmdir}/ + mv ${packagesdir}/%{jreportablearchive -- "$nameSuffix"}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ %if %{include_staticlibs} - mv ../%{staticlibsportablearchive -- "$nameSuffix"} $RPM_BUILD_ROOT%{_jvmdir}/ - mv ../%{staticlibsportablearchive -- "$nameSuffix"}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ + mv ${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"} $RPM_BUILD_ROOT%{_jvmdir}/ + mv ${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ %endif if [ "x$suffix" == "x" ] ; then dnameSuffix="$nameSuffix".debuginfo @@ -1471,7 +1490,7 @@ done ################################################################################ # the licenses are packed onloy once and shared mkdir -p $RPM_BUILD_ROOT%{unpacked_licenses} -mv ../%{jdkportablearchive -- "%{normal_suffix}"}-legal $RPM_BUILD_ROOT%{unpacked_licenses}/%{jdkportablesourcesarchive -- "%{normal_suffix}"} +mv ${packagesdir}/%{jdkportablearchive -- "%{normal_suffix}"}-legal $RPM_BUILD_ROOT%{unpacked_licenses}/%{jdkportablesourcesarchive -- "%{normal_suffix}"} # To show sha in the build log for file in `ls $RPM_BUILD_ROOT%{_jvmdir}/*.sha256sum` ; do ls -l $file ; cat $file ; done ################################################################################ @@ -1513,10 +1532,11 @@ $JAVA_HOME/bin/java ${SEC_DEBUG} -Djava.security.disableSystemPropertiesFile=fal if ! nm $JAVA_HOME/bin/java | grep set_speculation ; then true ; else false; fi # Check alt-java launcher has SSB mitigation on supported architectures +# set_speculation function exists in both cases, so check for prctl call %ifarch %{ssbd_arches} -nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation +nm %{altjavaoutputdir}/%{alt_java_name} | grep prctl %else -if ! nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation ; then true ; else false; fi +if ! nm %{altjavaoutputdir}/%{alt_java_name} | grep prctl ; then true ; else false; fi %endif # Check correct vendor values have been set @@ -1627,7 +1647,25 @@ done %{_jvmdir}/%{jdkportablesourcesarchiveForFiles}.sha256sum %license %{unpacked_licenses}/%{jdkportablesourcesarchiveForFiles} +%files misc +%{_jvmdir}/%{miscportablearchive} +%{_jvmdir}/%{miscportablearchive}.sha256sum + %changelog +* Fri Sep 15 2023 Andrew Hughes - 1:21.0.0.0.35-3.rolling +- Update documentation (README.md, add missing JEP to release notes) +- Replace alt-java patch with a binary separate from the JDK +- Drop stale patches that are of little use any more: +- * nss.cfg has been disabled since early PKCS11 work and long superseded by FIPS work +- * No accessibility subpackage to warrant RH1648242 patch any more +- * No use of system libjpeg turbo to warrant RH649512 patch any more +- Replace RH1684077 pcsc-lite-libs patch with better JDK-8009550 fix being upstreamed +- Update generate_tarball.sh to sync with upstream vanilla script +- Change top_level_dir_name to use the VCS tag, matching new upstream release style tarball +- Use upstream release URL for OpenJDK source +- Port misc tarball from RHEL to house alt-java outside the JDK tree +- Port improved tarball creation and checking from RHEL so tarballs are verified + * Thu Sep 14 2023 Andrew Hughes - 1:21.0.0.0.35-2.rolling - Bump buildjdkver now that java-21-openjdk is available in the buildroot diff --git a/jdk8009550-rh910107-fail_to_load_pcsc_library.patch b/jdk8009550-rh910107-fail_to_load_pcsc_library.patch new file mode 100644 index 0000000..9213937 --- /dev/null +++ b/jdk8009550-rh910107-fail_to_load_pcsc_library.patch @@ -0,0 +1,125 @@ +commit d0523302416bc6507696f20d1068f16427bcf6b8 +Author: Andrew Hughes +Date: Thu Aug 24 01:23:49 2023 +0100 + + 8009550: PlatformPCSC should load versioned so + +diff --git a/src/java.base/share/classes/sun/security/util/Debug.java b/src/java.base/share/classes/sun/security/util/Debug.java +index bff273c6548..e5a6b288ff8 100644 +--- a/src/java.base/share/classes/sun/security/util/Debug.java ++++ b/src/java.base/share/classes/sun/security/util/Debug.java +@@ -81,6 +81,7 @@ public static void Help() + System.err.println("logincontext login context results"); + System.err.println("jca JCA engine class debugging"); + System.err.println("keystore KeyStore debugging"); ++ System.err.println("pcsc Smartcard library debugging"); + System.err.println("policy loading and granting"); + System.err.println("provider security provider debugging"); + System.err.println("pkcs11 PKCS11 session manager debugging"); +diff --git a/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java b/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java +index bacff32efbc..d9f605ada1e 100644 +--- a/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java ++++ b/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java +@@ -1,5 +1,6 @@ + /* + * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2023, Red Hat Inc. 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 +@@ -46,8 +47,13 @@ class PlatformPCSC { + + private static final String PROP_NAME = "sun.security.smartcardio.library"; + +- private static final String LIB1 = "/usr/$LIBISA/libpcsclite.so"; +- private static final String LIB2 = "/usr/local/$LIBISA/libpcsclite.so"; ++ private static final String[] LIB_TEMPLATES = { "/usr/$LIBISA/libpcsclite.so", ++ "/usr/local/$LIBISA/libpcsclite.so", ++ "/usr/lib/$ARCH-linux-gnu/libpcsclite.so", ++ "/usr/lib/arm-linux-gnueabi/libpcsclite.so", ++ "/usr/lib/arm-linux-gnueabihf/libpcsclite.so", ++ "/usr/lib/$ARCH-kfreebsd-gnu/libpcsclite.so" }; ++ private static final String[] LIB_SUFFIXES = { ".1", ".0", "" }; + private static final String PCSC_FRAMEWORK = "/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC"; + + PlatformPCSC() { +@@ -73,23 +79,38 @@ public Throwable run() { + }); + + // expand $LIBISA to the system specific directory name for libraries ++ // expand $ARCH to the Debian system architecture in use + private static String expand(String lib) { + int k = lib.indexOf("$LIBISA"); +- if (k == -1) { +- return lib; ++ if (k != -1) { ++ String libDir; ++ if ("64".equals(System.getProperty("sun.arch.data.model"))) { ++ // assume Linux convention ++ libDir = "lib64"; ++ } else { ++ // must be 32-bit ++ libDir = "lib"; ++ } ++ lib = lib.replace("$LIBISA", libDir); + } +- String s1 = lib.substring(0, k); +- String s2 = lib.substring(k + 7); +- String libDir; +- if ("64".equals(System.getProperty("sun.arch.data.model"))) { +- // assume Linux convention +- libDir = "lib64"; +- } else { +- // must be 32-bit +- libDir = "lib"; ++ ++ k = lib.indexOf("$ARCH"); ++ if (k != -1) { ++ String arch = System.getProperty("os.arch"); ++ lib = lib.replace("$ARCH", getDebianArchitecture(arch)); + } +- String s = s1 + libDir + s2; +- return s; ++ ++ return lib; ++ } ++ ++ private static String getDebianArchitecture(String jdkArch) { ++ return switch (jdkArch) { ++ case "amd64" -> "x86_64"; ++ case "ppc" -> "powerpc"; ++ case "ppc64" -> "powerpc64"; ++ case "ppc64le" -> "powerpc64le"; ++ default -> jdkArch; ++ }; + } + + private static String getLibraryName() throws IOException { +@@ -98,15 +119,18 @@ private static String getLibraryName() throws IOException { + if (lib.length() != 0) { + return lib; + } +- lib = expand(LIB1); +- if (new File(lib).isFile()) { +- // if LIB1 exists, use that +- return lib; +- } +- lib = expand(LIB2); +- if (new File(lib).isFile()) { +- // if LIB2 exists, use that +- return lib; ++ ++ for (String template : LIB_TEMPLATES) { ++ for (String suffix : LIB_SUFFIXES) { ++ lib = expand(template) + suffix; ++ if (debug != null) { ++ debug.println("Looking for " + lib); ++ } ++ if (new File(lib).isFile()) { ++ // if library exists, use that ++ return lib; ++ } ++ } + } + + // As of macos 11, framework libraries have been removed from the file diff --git a/nss.cfg.in b/nss.cfg.in deleted file mode 100644 index 377a39c..0000000 --- a/nss.cfg.in +++ /dev/null @@ -1,5 +0,0 @@ -name = NSS -nssLibraryDirectory = @NSS_LIBDIR@ -nssDbMode = noDb -attributes = compatibility -handleStartupErrors = ignoreMultipleInitialisation diff --git a/rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch b/rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch deleted file mode 100644 index 3042186..0000000 --- a/rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -r 618ad1237e73 src/java.desktop/share/classes/java/awt/Toolkit.java ---- a/src/java.desktop/share/classes/java/awt/Toolkit.java Thu Jun 13 19:37:49 2019 +0200 -+++ b/src/java.desktop/share/classes/java/awt/Toolkit.java Thu Jul 04 10:35:42 2019 +0200 -@@ -595,7 +595,11 @@ - toolkit = new HeadlessToolkit(toolkit); - } - if (!GraphicsEnvironment.isHeadless()) { -- loadAssistiveTechnologies(); -+ try { -+ loadAssistiveTechnologies(); -+ } catch (AWTError error) { -+ // ignore silently -+ } - } - } - return toolkit; diff --git a/rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch b/rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch deleted file mode 100644 index b357edf..0000000 --- a/rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git openjdk.orig/src/java.base/share/conf/security/java.security openjdk/src/java.base/share/conf/security/java.security -index 68a9c1a2d08..7aa25eb2cb7 100644 ---- openjdk.orig/src/java.base/share/conf/security/java.security -+++ openjdk/src/java.base/share/conf/security/java.security -@@ -78,6 +78,7 @@ security.provider.tbd=SunMSCAPI - security.provider.tbd=Apple - #endif - security.provider.tbd=SunPKCS11 -+#security.provider.tbd=SunPKCS11 ${java.home}/lib/security/nss.cfg - - # - # Security providers used when FIPS mode support is active - diff --git a/rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch b/rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch deleted file mode 100644 index 4c1476f..0000000 --- a/rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/openjdk/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java b/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java -index bacff32efbc..ff7b3dcc81c 100644 ---- openjdk/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java -+++ openjdk/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java -@@ -46,8 +46,8 @@ class PlatformPCSC { - - private static final String PROP_NAME = "sun.security.smartcardio.library"; - -- private static final String LIB1 = "/usr/$LIBISA/libpcsclite.so"; -- private static final String LIB2 = "/usr/local/$LIBISA/libpcsclite.so"; -+ private static final String LIB1 = "/usr/$LIBISA/libpcsclite.so.1"; -+ private static final String LIB2 = "/usr/local/$LIBISA/libpcsclite.so.1"; - private static final String PCSC_FRAMEWORK = "/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC"; - - PlatformPCSC() { diff --git a/rh1750419-redhat_alt_java.patch b/rh1750419-redhat_alt_java.patch deleted file mode 100644 index d877ca8..0000000 --- a/rh1750419-redhat_alt_java.patch +++ /dev/null @@ -1,117 +0,0 @@ -diff --git openjdk.orig/make/modules/java.base/Launcher.gmk openjdk/make/modules/java.base/Launcher.gmk -index 700ddefda49..2882de68eb2 100644 ---- openjdk.orig/make/modules/java.base/Launcher.gmk -+++ openjdk/make/modules/java.base/Launcher.gmk -@@ -41,6 +41,14 @@ $(eval $(call SetupBuildLauncher, java, \ - OPTIMIZATION := HIGH, \ - )) - -+#Wno-error=cpp is present to allow commented warning in ifdef part of main.c -+$(eval $(call SetupBuildLauncher, alt-java, \ -+ CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS -DENABLE_ARG_FILES -DREDHAT_ALT_JAVA -Wno-error=cpp, \ -+ EXTRA_RCFLAGS := $(JAVA_RCFLAGS), \ -+ VERSION_INFO_RESOURCE := $(JAVA_VERSION_INFO_RESOURCE), \ -+ OPTIMIZATION := HIGH, \ -+)) -+ - ifeq ($(call isTargetOs, windows), true) - $(eval $(call SetupBuildLauncher, javaw, \ - CFLAGS := -DJAVAW -DEXPAND_CLASSPATH_WILDCARDS -DENABLE_ARG_FILES, \ -diff --git openjdk.orig/src/java.base/share/native/launcher/alt_main.h openjdk/src/java.base/share/native/launcher/alt_main.h -new file mode 100644 -index 00000000000..697df2898ac ---- /dev/null -+++ openjdk/src/java.base/share/native/launcher/alt_main.h -@@ -0,0 +1,73 @@ -+/* -+ * Copyright (c) 2019, Red Hat, Inc. 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. -+ */ -+ -+#ifdef REDHAT_ALT_JAVA -+ -+#include -+ -+ -+/* Per task speculation control */ -+#ifndef PR_GET_SPECULATION_CTRL -+# define PR_GET_SPECULATION_CTRL 52 -+#endif -+#ifndef PR_SET_SPECULATION_CTRL -+# define PR_SET_SPECULATION_CTRL 53 -+#endif -+/* Speculation control variants */ -+#ifndef PR_SPEC_STORE_BYPASS -+# define PR_SPEC_STORE_BYPASS 0 -+#endif -+/* Return and control values for PR_SET/GET_SPECULATION_CTRL */ -+ -+#ifndef PR_SPEC_NOT_AFFECTED -+# define PR_SPEC_NOT_AFFECTED 0 -+#endif -+#ifndef PR_SPEC_PRCTL -+# define PR_SPEC_PRCTL (1UL << 0) -+#endif -+#ifndef PR_SPEC_ENABLE -+# define PR_SPEC_ENABLE (1UL << 1) -+#endif -+#ifndef PR_SPEC_DISABLE -+# define PR_SPEC_DISABLE (1UL << 2) -+#endif -+#ifndef PR_SPEC_FORCE_DISABLE -+# define PR_SPEC_FORCE_DISABLE (1UL << 3) -+#endif -+#ifndef PR_SPEC_DISABLE_NOEXEC -+# define PR_SPEC_DISABLE_NOEXEC (1UL << 4) -+#endif -+ -+static void set_speculation() __attribute__((constructor)); -+static void set_speculation() { -+ if ( prctl(PR_SET_SPECULATION_CTRL, -+ PR_SPEC_STORE_BYPASS, -+ PR_SPEC_DISABLE_NOEXEC, 0, 0) == 0 ) { -+ return; -+ } -+ prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_STORE_BYPASS, PR_SPEC_DISABLE, 0, 0); -+} -+ -+#endif // REDHAT_ALT_JAVA -diff --git openjdk.orig/src/java.base/share/native/launcher/main.c openjdk/src/java.base/share/native/launcher/main.c -index b734fe2ba78..79dc8307650 100644 ---- openjdk.orig/src/java.base/share/native/launcher/main.c -+++ openjdk/src/java.base/share/native/launcher/main.c -@@ -34,6 +34,14 @@ - #include "jli_util.h" - #include "jni.h" - -+#ifdef REDHAT_ALT_JAVA -+#if defined(__linux__) && defined(__x86_64__) -+#include "alt_main.h" -+#else -+#warning alt-java requested but SSB mitigation not available on this platform. -+#endif -+#endif -+ - /* - * Entry point. - */ diff --git a/rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch b/rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch deleted file mode 100644 index 1b706a1..0000000 --- a/rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch +++ /dev/null @@ -1,19 +0,0 @@ -Remove uses of FAR in jpeg code - -Upstream libjpeg-trubo removed the (empty) FAR macro: -http://sourceforge.net/p/libjpeg-turbo/code/1312/ - -Adjust our code to not use the undefined FAR macro anymore. - -diff --git a/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c b/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c ---- openjdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c -+++ openjdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c -@@ -1385,7 +1385,7 @@ - /* and fill it in */ - dst_ptr = icc_data; - for (seq_no = first; seq_no < last; seq_no++) { -- JOCTET FAR *src_ptr = icc_markers[seq_no]->data + ICC_OVERHEAD_LEN; -+ JOCTET *src_ptr = icc_markers[seq_no]->data + ICC_OVERHEAD_LEN; - unsigned int length = - icc_markers[seq_no]->data_length - ICC_OVERHEAD_LEN; - diff --git a/sources b/sources index 443c08d..a5817fd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-jdk21u-jdk-21+35.tar.xz) = 5961f12ff9828856e5ce7847a06177a6761088dbefbcac05512a7c3433d45154f6d59872cd00268fecd987128e623bb343d9879b26f6c6c811e6d6713d1b17a2 +SHA512 (openjdk-21+35.tar.xz) = 311e954cc8d28a336b85efc05baade8945fe5292ae2d91cc7ff71c6b3a1830b1a4b9fc641f87e68a4b3db175eb5c21a18664457715da9b37720c5d4b3eb67195 From 9e5764b72d8f3ac8141370dea8e739ee676e914f Mon Sep 17 00:00:00 2001 From: Jiri Date: Wed, 20 Sep 2023 21:36:50 +0200 Subject: [PATCH 14/86] removed %{1} from misc --- java-latest-openjdk-portable.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 4710c10..ffb74a8 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1,4 +1,3 @@ -%if (0%{?rhel} > 0 && 0%{?rhel} < 8) # portable jdk 17 specific bug, _jvmdir being missing %define _jvmdir /usr/lib/jvm %endif @@ -385,7 +384,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 35 -%global rpmrelease 3 +%global rpmrelease 4 # 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 # Using 10 digits may overflow the int used for priority, so we combine the patch and build versions @@ -459,7 +458,7 @@ # Intentionally use jdkportablenameimpl here since we want to have static-libs files overlayed on # top of the JDK archive %define staticlibsportablename() %{expand:%{jdkportablenameimpl -- %%{1}}} -%define miscportablename() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.misc;g" | sed "s;openjdkportable;el;g") +%define miscportablename() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable.misc;g" | sed "s;openjdkportable;el;g") %define miscportablearchive() %{miscportablename}.tar.xz # RPM 4.19 no longer accept our double percentaged %%{nil} passed to %%{1} @@ -1652,6 +1651,9 @@ done %{_jvmdir}/%{miscportablearchive}.sha256sum %changelog +* Wed Sep 20 2023 Jiri Vanek - 1:21.0.0.0.35-4.rolling +- removed %{1} from miscportablename + * Fri Sep 15 2023 Andrew Hughes - 1:21.0.0.0.35-3.rolling - Update documentation (README.md, add missing JEP to release notes) - Replace alt-java patch with a binary separate from the JDK From 898c425bb61bb936be3117e39564691ac56b901f Mon Sep 17 00:00:00 2001 From: Jiri Date: Wed, 20 Sep 2023 21:39:53 +0200 Subject: [PATCH 15/86] Returned misteriously disapeared line --- java-latest-openjdk-portable.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index ffb74a8..8a3b968 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1,3 +1,4 @@ +%if (0%{?rhel} > 0 && 0%{?rhel} < 8) # portable jdk 17 specific bug, _jvmdir being missing %define _jvmdir /usr/lib/jvm %endif From 1eb10e704bfd129924882085b3519c94f50b9454 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 21 Nov 2023 15:48:20 +0100 Subject: [PATCH 16/86] updated to OpenJDK 21.0.1 (2023-10-17) - adjsuted generate_source_tarball - removed icedtea_sync - dropped standalone licenses - added usntripped subpkg - added docs subpkg - adjsuted versions of bundled libraries - build refactored to several solid methods following gnu_andrew - removed no longer needed jdk8296108-tzdata2022f.patch, jdk8296715-cldr2022f.patch, rh1648644-java_access_bridge_privileged_security.patch - added jdk8311630-s390_ffmapi.patch to support virtual threads on s390x - aligned fips-21u-75ffdc48eda.patch (gnu_andrew) --- .gitignore | 1 + NEWS | 282 ++- discover_trees.sh | 54 + fips-21u-75ffdc48eda.patch | 1 - generate_source_tarball.sh | 26 +- icedtea_sync.sh | 193 +- java-latest-openjdk-portable.spec | 993 +++++---- jconsole.desktop.in | 11 +- jdk8296108-tzdata2022f.patch | 1 - jdk8296715-cldr2022f.patch | 1 - jdk8311630-s390_ffmapi.patch | 1906 +++++++++++++++++ openjdk_news.sh | 4 +- ...va_access_bridge_privileged_security.patch | 20 - sources | 2 +- 14 files changed, 2804 insertions(+), 691 deletions(-) create mode 100755 discover_trees.sh delete mode 100644 jdk8296108-tzdata2022f.patch delete mode 100644 jdk8296715-cldr2022f.patch create mode 100644 jdk8311630-s390_ffmapi.patch delete mode 100644 rh1648644-java_access_bridge_privileged_security.patch diff --git a/.gitignore b/.gitignore index 79f3174..3f711a8 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ /openjdk-jdk21u-jdk-21+34.tar.xz /openjdk-jdk21u-jdk-21+35.tar.xz /openjdk-21+35.tar.xz +/openjdk-21.0.1+12.tar.xz diff --git a/NEWS b/NEWS index 73322e7..09d1dfe 100644 --- a/NEWS +++ b/NEWS @@ -3,13 +3,210 @@ Key: JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY +New in release OpenJDK 21.0.1 (2023-10-17): +=========================================== + +* CVEs + - CVE-2023-22081 + - CVE-2023-22025 +* Security fixes + - JDK-8286503, JDK-8312367: Enhance security classes + - JDK-8296581: Better system proxy support + - JDK-8297856: Improve handling of Bidi characters + - JDK-8309966: Enhanced TLS connections + - JDK-8312248: Enhanced archival support redux + - JDK-8314649: Enhanced archival support redux + - JDK-8317121: vector_masked_load instruction is moved too early after JDK-8286941 +* Other changes + - JDK-8240567: MethodTooLargeException thrown while creating a jlink image + - JDK-8284772: GHA: Use GCC Major Version Dependencies Only + - JDK-8293114: JVM should trim the native heap + - JDK-8299658: C1 compilation crashes in LinearScan::resolve_exception_edge + - JDK-8302017: Allocate BadPaddingException only if it will be thrown + - JDK-8303815: Improve Metaspace test speed + - JDK-8304954: SegmentedCodeCache fails when using large pages + - JDK-8307766: Linux: Provide the option to override the timer slack + - JDK-8308042: [macos] Developer ID Application Certificate not picked up by jpackage if it contains UNICODE characters + - JDK-8308047: java/util/concurrent/ScheduledThreadPoolExecutor/BasicCancelTest.java timed out and also had jcmd pipe errors + - JDK-8308184: Launching java with large number of jars in classpath with java.protocol.handler.pkgs system property set can lead to StackOverflowError + - JDK-8308474: DSA does not reset SecureRandom when initSign is called again + - JDK-8308609: java/lang/ScopedValue/StressStackOverflow.java fails with "-XX:-VMContinuations" + - JDK-8309032: jpackage does not work for module projects unless --module-path is specified + - JDK-8309088: security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java fails + - JDK-8309214: sun/security/pkcs11/KeyStore/CertChainRemoval.java fails after 8301154 + - JDK-8309475: Test java/foreign/TestByteBuffer.java fails: a problem with msync (aix) + - JDK-8309502: RISC-V: String.indexOf intrinsic may produce misaligned memory loads + - JDK-8309591: Socket.setOption(TCP_QUICKACK) uses wrong level + - JDK-8309746: Reconfigure check should include make/conf/version-numbers.conf + - JDK-8309889: [s390] Missing return statement after calling jump_to_native_invoker method in generate_method_handle_dispatch. + - JDK-8310106: sun.security.ssl.SSLHandshake.getHandshakeProducer() incorrectly checks handshakeConsumers + - JDK-8310171: Bump version numbers for 21.0.1 + - JDK-8310211: serviceability/jvmti/thread/GetStackTrace/getstacktr03/getstacktr03.java failing + - JDK-8310233: Fix THP detection on Linux + - JDK-8310268: RISC-V: misaligned memory access in String.Compare intrinsic + - JDK-8310321: make JDKOPT_CHECK_CODESIGN_PARAMS more verbose + - JDK-8310586: ProblemList java/lang/ScopedValue/StressStackOverflow.java#default with virtual threads on linux-all + - JDK-8310687: JDK-8303215 is incomplete + - JDK-8310873: Re-enable locked_create_entry symbol check in runtime/NMT/CheckForProperDetailStackTrace.java for RISC-V + - JDK-8311026: Some G1 specific tests do not set -XX:+UseG1GC + - JDK-8311033: [macos] PrinterJob does not take into account Sides attribute + - JDK-8311160: [macOS, Accessibility] VoiceOver: No announcements on JRadioButtonMenuItem and JCheckBoxMenuItem + - JDK-8311249: Remove unused MemAllocator::obj_memory_range + - JDK-8311285: report some fontconfig related environment variables in hs_err file + - JDK-8311511: Improve description of NativeLibrary JFR event + - JDK-8311592: ECKeySizeParameterSpec causes too many exceptions on third party providers + - JDK-8311682: Change milestone to fcs for all releases + - JDK-8311862: RISC-V: small improvements to shift immediate instructions + - JDK-8311917: MAP_FAILED definition seems to be obsolete in src/java.desktop/unix/native/common/awt/fontpath.c + - JDK-8311921: Inform about MaxExpectedDataSegmentSize in case of pthread_create failures on AIX + - JDK-8311923: TestIRMatching.java fails on RISC-V + - JDK-8311926: java/lang/ScopedValue/StressStackOverflow.java takes 9mins in tier1 + - JDK-8311955: c++filt is now ibm-llvm-cxxfilt when using xlc17 / clang on AIX + - JDK-8311981: Test gc/stringdedup/TestStringDeduplicationAgeThreshold.java#ZGenerational timed out + - JDK-8312127: FileDescriptor.sync should temporarily increase parallelism + - JDK-8312180: (bf) MappedMemoryUtils passes incorrect arguments to msync (aix) + - JDK-8312182: THPs cause huge RSS due to thread start timing issue + - JDK-8312394: [linux] SIGSEGV if kernel was built without hugepage support + - JDK-8312395: Improve assertions in growableArray + - JDK-8312401: SymbolTable::do_add_if_needed hangs when called in InstanceKlass::add_initialization_error path with requesting length exceeds max_symbol_length + - JDK-8312489: Increase jdk.jar.maxSignatureFileSize default which is too low for JARs such as WhiteSource/Mend unified agent jar + - JDK-8312525: New test runtime/os/TestTrimNative.java#trimNative is failing: did not see the expected RSS reduction + - JDK-8312535: MidiSystem.getSoundbank() throws unexpected SecurityException + - JDK-8312555: Ideographic characters aren't stretched by AffineTransform.scale(2, 1) + - JDK-8312573: Failure during CompileOnly parsing leads to ShouldNotReachHere + - JDK-8312585: Rename DisableTHPStackMitigation flag to THPStackMitigation + - JDK-8312591: GCC 6 build failure after JDK-8280982 + - JDK-8312619: Strange error message when switching over long + - JDK-8312620: WSL Linux build crashes after JDK-8310233 + - JDK-8312625: Test serviceability/dcmd/vm/TrimLibcHeapTest.java failed: RSS use increased + - JDK-8312909: C1 should not inline through interface calls with non-subtype receiver + - JDK-8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match + - JDK-8312984: javac may crash on a record pattern with too few components + - JDK-8313081: MonitoringSupport_lock should be unconditionally initialized after 8304074 + - JDK-8313248: C2: setScopedValueCache intrinsic exposes nullptr pre-values to store barriers + - JDK-8313262: C2: Sinking node may cause required cast to be dropped + - JDK-8313307: java/util/Formatter/Padding.java fails on some Locales + - JDK-8313312: Add missing classpath exception copyright header + - JDK-8313323: javac -g on a java file which uses unnamed variable leads to ClassFormatError when launching that class + - JDK-8313402: C1: Incorrect LoadIndexed value numbering + - JDK-8313428: GHA: Bump GCC versions for July 2023 updates + - JDK-8313576: GCC 7 reports compiler warning in bundled freetype 2.13.0 + - JDK-8313602: increase timeout for jdk/classfile/CorpusTest.java + - JDK-8313626: C2 crash due to unexpected exception control flow + - JDK-8313657: com.sun.jndi.ldap.Connection.cleanup does not close connections on SocketTimeoutErrors + - JDK-8313676: Amend TestLoadIndexedMismatch test to target intrinsic directly + - JDK-8313678: SymbolTable can leak Symbols during cleanup + - JDK-8313691: use close after failing os::fdopen in vmError and ciEnv + - JDK-8313701: GHA: RISC-V should use the official repository for bootstrap + - JDK-8313707: GHA: Bootstrap sysroots with --variant=minbase + - JDK-8313752: InstanceKlassFlags::print_on doesn't print the flag names + - JDK-8313765: Invalid CEN header (invalid zip64 extra data field size) + - JDK-8313796: AsyncGetCallTrace crash on unreadable interpreter method pointer + - JDK-8313874: JNI NewWeakGlobalRef throws exception for null arg + - JDK-8313901: [TESTBUG] test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java fails with java.lang.VirtualMachineError + - JDK-8313904: [macos] All signing tests which verifies unsigned app images are failing + - JDK-8314020: Print instruction blocks in byte units + - JDK-8314024: SIGSEGV in PhaseIdealLoop::build_loop_late_post_work due to bad immediate dominator info + - JDK-8314063: The socket is not closed in Connection::createSocket when the handshake failed for LDAP connection + - JDK-8314117: RISC-V: Incorrect VMReg encoding in RISCV64Frame.java + - JDK-8314118: Update JMH devkit to 1.37 + - JDK-8314139: TEST_BUG: runtime/os/THPsInThreadStackPreventionTest.java could fail on machine with large number of cores + - JDK-8314144: gc/g1/ihop/TestIHOPStatic.java fails due to extra concurrent mark with -Xcomp + - JDK-8314216: Case enumConstant, pattern compilation fails + - JDK-8314262: GHA: Cut down cross-compilation sysroots deeper + - JDK-8314423: Multiple patterns without unnamed variables + - JDK-8314426: runtime/os/TestTrimNative.java is failing on slow machines + - JDK-8314501: Shenandoah: sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java fails + - JDK-8314517: some tests fail in case ipv6 is disabled on the machine + - JDK-8314618: RISC-V: -XX:MaxVectorSize does not work as expected + - JDK-8314656: GHA: No need for Debian ports keyring installation after JDK-8313701 + - JDK-8314679: SA fails to properly attach to JVM after having just detached from a different JVM + - JDK-8314730: GHA: Drop libfreetype6-dev transitional package in favor of libfreetype-dev + - JDK-8314850: SharedRuntime::handle_wrong_method() gets called too often when resolving Continuation.enter + - JDK-8314960: Add Certigna Root CA - 2 + - JDK-8315020: The macro definition for LoongArch64 zero build is not accurate. + - JDK-8315051: jdk/jfr/jvm/TestGetEventWriter.java fails with non-JVMCI GCs + - JDK-8315534: Incorrect warnings about implicit annotation processing + +Notes on individual issues: +=========================== + +core-libs/java.util.jar: + +JDK-8313765: Invalid CEN header (invalid zip64 extra data field size) +===================================================================== +Additional validity checks in the handling of Zip64 files, +JDK-8302483, introduced in 21.0.0, caused the use of some valid zip +files to now fail with the error, `Invalid CEN header (invalid zip64 +extra data field size)` + +This release, 21.0.1, allows for zero length headers and additional +padding produced by some Zip64 creation tools. + +The following third party tools have also released patches to better +adhere to the ZIP File Format Specification: + +* Apache Commons Compress fix for Empty CEN Zip64 Extra Headers fixed in Commons Compress release 1.11 +* Apache Ant fix for Empty CEN Zip64 Extra Headers fixed in Ant 1.10.14 +* BND issue with writing invalid Extra Headers fixed in BND 5.3 + +The maven-bundle-plugin 5.1.5 includes the BND 5.3 patch. + +If these improved validation checks cause issues for deployed zip or +jar files, check how the file was created and whether patches are +available from the generating software to resolve the issue. With +both JDK releases, the checks can be disabled by setting the new +system property, `jdk.util.zip.disableZip64ExtraFieldValidation` to +`true`. + +hotspot/runtime: + +JDK-8311981: JVM May Hang When Using Generational ZGC if a VM Handshake Stalls on Memory +======================================================================================== +The JVM can hang under an uncommon condition that involves the JVM +running out of heap memory, the GC just starting a relocation phase to +reclaim memory, and a JVM thread-local Handshake asking to relocate an +object. This potential deadlock should now be avoided in this +release. + +core-libs/java.util.regex: + +JDK-8312976: `java.util.regex.MatchResult` Might Throw `StringIndexOutOfBoundsException` on Regex Patterns Containing Lookaheads and Lookbehinds +================================================================================================================================================ +JDK-8132995 introduced an unintended regression when using instances +returned by `java.util.regex.Matcher.toMatchResult()`. + +This regression happens with a `java.util.regex.Pattern`s containing +lookaheads and lookbehinds that, in turn, contain groups. If these are +located outside the match, a `StringIndexOutOfBoundsException` is +thrown when accessing these groups. See JDK-8312976 for an example. + +The issue is resolved in this release by calculating a minimum start +location as part of the match result and using this in constructing +String objects, rather than the location of the first match. + +JDK-8314960: Added Certigna Root CA Certificate +=============================================== +The following root certificate has been added to the cacerts +truststore: + +Name: Certigna (Dhimyotis) +Alias Name: certignarootca +Distinguished Name: CN=Certigna Root CA, OU=0002 48146308100036, O=Dhimyotis, C=FR + +JDK-8312489: Increase Default Value of the System Property `jdk.jar.maxSignatureFileSize` +========================================================================================= +A maximum signature file size property, jdk.jar.maxSignatureFileSize, +was introduced in the 21.0.0 release of OpenJDK by JDK-8300596 to +control the maximum size of signature files in a signed JAR. The +default value of 8MB proved to be too small for some JAR files. This +release, 21.0.1, increases it to 16MB. + New in release OpenJDK 21.0.0 (2023-09-XX): =========================================== Major changes are listed below. Some changes may have been backported -to earlier releases following their first appearance in OpenJDK 21. - -The full list of changes in 21u can be found at: -- * https://builds.shipilev.net/backports-monitor/release-notes-21.txt +to earlier releases following their first appearance in OpenJDK 18 +through to 21. NEW FEATURES ============ @@ -76,8 +273,8 @@ an underscore character, _. This is a preview feature (http://openjdk.java.net/jeps/12) introduced in OpenJDK 21 (JEP 443). -Unnamed Classes and Instance Main Methods -========================================= +Unnamed Classes and Instance Main Methods (Preview) +=================================================== https://openjdk.org/jeps/445 Evolve the Java language so that students can write their first @@ -93,6 +290,24 @@ in OpenJDK 21 (JEP 445). Library Features ================ +UTF-8 by Default +================ +https://openjdk.org/jeps/400 + +Specify UTF-8 as the default charset of the standard Java APIs. With +this change, APIs that depend upon the default charset will behave +consistently across all implementations, operating systems, locales, +and configurations. + +Reimplement Core Reflection with Method Handles +=============================================== +https://openjdk.org/jeps/416 + +Reimplement java.lang.reflect.Method, Constructor, and Field on top of +java.lang.invoke method handles. Making method handles the underlying +mechanism for reflection will reduce the maintenance and development +cost of both the java.lang.reflect and java.lang.invoke APIs. + Vector API ========== https://openjdk.org/jeps/338 @@ -113,6 +328,14 @@ place in OpenJDK 17 (JEP 414), OpenJDK 18 (JEP 417) saw a third, OpenJDK 19 a fourth (JEP 426), OpenJDK 20 (JEP 438) a fifth and OpenJDK 21 a sixth (JEP 448). +Internet-Address Resolution SPI +=============================== +https://openjdk.org/jeps/418 + +Define a service-provider interface (SPI) for host name and address +resolution, so that java.net.InetAddress can make use of resolvers +other than the platform's built-in resolver. + Foreign Function & Memory API ============================= https://openjdk.org/jeps/412 @@ -211,9 +434,55 @@ Improve application performance by extending the Z Garbage Collector will allow ZGC to collect young objects — which tend to die young — more frequently. +Tools +===== + +Simple Web Server +================= +https://openjdk.org/jeps/408 + +Provide a command-line tool, `jwebserver`, to start a minimal web +server that serves static files only. No CGI or servlet-like +functionality is available. This tool will be useful for prototyping, +ad-hoc coding, and testing purposes, particularly in educational +contexts. + +Code Snippets in Java API Documentation +======================================= +https://openjdk.org/jeps/413 + +Introduce an @snippet tag for JavaDoc's Standard Doclet, to simplify +the inclusion of example source code in API documentation. + +Ports +===== + +Linux/RISC-V Port +================= +https://openjdk.org/jeps/422 + +RISC-V is a free and open-source RISC instruction set architecture +(ISA) designed originally at the University of California, Berkeley, +and now developed collaboratively under the sponsorship of RISC-V +International. It is already supported by a wide range of language +toolchains. With the increasing availability of RISC-V hardware, a +port of the JDK would be valuable. + DEPRECATIONS ============ +Deprecate Finalization for Removal +================================== +https://openjdk.org/jeps/421 + +Deprecate finalization for removal in a future release. Finalization +remains enabled by default for now, but can be disabled to facilitate +early testing. In a future release it will be disabled by default, and +in a later release it will be removed. Maintainers of libraries and +applications that rely upon finalization should consider migrating to +other resource management techniques such as the try-with-resources +statement and cleaners. + Deprecate the Windows 32-bit x86 Port for Removal ================================================= https://openjdk.org/jeps/449 @@ -230,4 +499,3 @@ JVM. These warnings aim to prepare users for a future release which disallows the dynamic loading of agents by default in order to improve integrity by default. Serviceability tools that load agents at startup will not cause warnings to be issued in any release. - diff --git a/discover_trees.sh b/discover_trees.sh new file mode 100755 index 0000000..8c31278 --- /dev/null +++ b/discover_trees.sh @@ -0,0 +1,54 @@ +#!/bin/sh + +# Copyright (C) 2020 Red Hat, Inc. +# Written by Andrew John Hughes . +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +TREE=${1} + +if test "x${TREE}" = "x"; then + TREE=${PWD} +fi + +if [ -e ${TREE}/nashorn/.hg -o -e ${TREE}/nashorn/merge.changeset ] ; then + NASHORN="nashorn" ; +fi + +if [ -e ${TREE}/corba/.hg -o -e ${TREE}/corba/merge.changeset ] ; then + CORBA="corba"; +fi + +if [ -e ${TREE}/jaxp/.hg -o -e ${TREE}/jaxp/merge.changeset ] ; then + JAXP="jaxp"; +fi + +if [ -e ${TREE}/jaxws/.hg -o -e ${TREE}/jaxws/merge.changeset ] ; then + JAXWS="jaxws"; +fi + +if [ -e ${TREE}/langtools/.hg -o -e ${TREE}/langtools/merge.changeset ] ; then + LANGTOOLS="langtools"; +fi + +if [ -e ${TREE}/jdk/.hg -o -e ${TREE}/jdk/merge.changeset ] ; then + JDK="jdk"; +fi + +if [ -e ${TREE}/hotspot/.hg -o -e ${TREE}/hotspot/merge.changeset ] ; then + HOTSPOT="hotspot"; +fi + +SUBTREES="${CORBA} ${JAXP} ${JAXWS} ${LANGTOOLS} ${NASHORN} ${JDK} ${HOTSPOT}"; +echo ${SUBTREES} diff --git a/fips-21u-75ffdc48eda.patch b/fips-21u-75ffdc48eda.patch index 7ffbe3a..8413fe1 100644 --- a/fips-21u-75ffdc48eda.patch +++ b/fips-21u-75ffdc48eda.patch @@ -4231,4 +4231,3 @@ index 00000000000..87f1ad04505 + } + } +} - diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index f27158d..5d6efd9 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -6,10 +6,9 @@ # If your local repo follows upstream forests conventions, it may be enough to set OPENJDK_URL # # In any case you have to set PROJECT_NAME REPO_NAME and VERSION. eg: -# BOOT_JDK=/usr/lib/jvm/java-20-openjdk # PROJECT_NAME=openjdk # REPO_NAME=jdk21u -# VERSION=jdk-21+35 +# VERSION=jdk-21.0.1+12 # or to eg prepare systemtap: # icedtea7's jstack and other tapsets # VERSION=6327cf1cea9e @@ -36,13 +35,13 @@ if [ "x$1" = "xhelp" ] ; then VERSION=""; fi echo -e "Behaviour may be specified by setting the following variables:\n" - echo "VERSION - the version of the specified OpenJDK project (current value: ${VERSION})" + echo "VERSION - the version of the specified OpenJDK project" echo "PROJECT_NAME -- the name of the OpenJDK project being archived (optional; only needed by defaults)" echo "REPO_NAME - the name of the OpenJDK repository (optional; only needed by defaults)" echo "OPENJDK_URL - the URL to retrieve code from (optional; defaults to ${OPENJDK_URL_DEFAULT})" echo "COMPRESSION - the compression type to use (optional; defaults to ${COMPRESSION_DEFAULT})" - echo "FILE_NAME_ROOT - name of the archive, minus extensions (optional; defaults to open${VERSION})" - echo "REPO_ROOT - the location of the Git repository to archive (optional; defaults to OPENJDK_URL/PROJECT_NAME/REPO_NAME)" + echo "FILE_NAME_ROOT - name of the archive, minus extensions (optional; defaults to PROJECT_NAME-REPO_NAME-VERSION)" + echo "REPO_ROOT - the location of the Git repository to archive (optional; defaults to OPENJDK_URL/PROJECT_NAME/REPO_NAME.git)" echo "TO_COMPRESS - what part of clone to pack (default is ${VERSION})" echo "BOOT_JDK - the bootstrap JDK to satisfy the configure run" exit 1; @@ -111,7 +110,7 @@ fi echo "Creating a tar.${COMPRESSION} archive" if [ "x$FILE_NAME_ROOT" = "x" ] ; then - FILE_NAME_ROOT=open${VERSION} + FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION} echo "No file name root specified; default to ${FILE_NAME_ROOT}" fi if [ "x$REPO_ROOT" = "x" ] ; then @@ -121,7 +120,7 @@ fi; if [ "x$TO_COMPRESS" = "x" ] ; then TO_COMPRESS="${VERSION}" - echo "No targets to be compressed specified, ; default to ${TO_COMPRESS}" + echo "No targets to be compressed specified ; default to ${TO_COMPRESS}" fi; echo -e "Settings:" @@ -147,6 +146,7 @@ else popd fi pushd "${FILE_NAME_ROOT}" + # Generate .src-rev so build has knowledge of the revision the tarball was created from mkdir build pushd build @@ -161,17 +161,17 @@ pushd "${FILE_NAME_ROOT}" # Remove history and GHA echo "find ${VERSION} -name '.hgtags'" - find ${VERSION} -name '.hgtags' -exec rm -v '{}' '+' + find ${VERSION} -name '.hgtags' -exec rm -fv '{}' '+' echo "find ${VERSION} -name '.hgignore'" - find ${VERSION} -name '.hgignore' -exec rm -v '{}' '+' + find ${VERSION} -name '.hgignore' -exec rm -fv '{}' '+' echo "find ${VERSION} -name '.gitattributes'" - find ${VERSION} -name '.gitattributes' -exec rm -v '{}' '+' + find ${VERSION} -name '.gitattributes' -exec rm -fv '{}' '+' echo "find ${VERSION} -name '.gitignore'" - find ${VERSION} -name '.gitignore' -exec rm -v '{}' '+' + find ${VERSION} -name '.gitignore' -exec rm -fv '{}' '+' echo "find ${VERSION} -name '.git'" - find ${VERSION} -name '.git' -exec rm -rv '{}' '+' + find ${VERSION} -name '.git' -exec rm -rfv '{}' '+' echo "find ${VERSION} -name '.github'" - find ${VERSION} -name '.github' -exec rm -rv '{}' '+' + find ${VERSION} -name '.github' -exec rm -rfv '{}' '+' echo "Compressing remaining forest" if [ "X$COMPRESSION" = "Xxz" ] ; then diff --git a/icedtea_sync.sh b/icedtea_sync.sh index e5c54f3..c1b8f6a 100755 --- a/icedtea_sync.sh +++ b/icedtea_sync.sh @@ -1,192 +1 @@ -#!/bin/bash - -# Copyright (C) 2019 Red Hat, Inc. -# Written by Andrew John Hughes . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - -ICEDTEA_USE_VCS=true - -ICEDTEA_VERSION=3.15.0 -ICEDTEA_URL=https://icedtea.classpath.org/download/source -ICEDTEA_SIGNING_KEY=CFDA0F9B35964222 - -ICEDTEA_HG_URL=https://icedtea.classpath.org/hg/icedtea11 - -set -e - -RPM_DIR=${PWD} -if [ ! -f ${RPM_DIR}/jconsole.desktop.in ] ; then - echo "Not in RPM source tree."; - exit 1; -fi - -if test "x${TMPDIR}" = "x"; then - TMPDIR=/tmp; -fi -WORKDIR=${TMPDIR}/it.sync - -echo "Using working directory ${WORKDIR}" -mkdir ${WORKDIR} -pushd ${WORKDIR} - -if test "x${WGET}" = "x"; then - WGET=$(which wget); - if test "x${WGET}" = "x"; then - echo "wget not found"; - exit 1; - fi -fi - -if test "x${TAR}" = "x"; then - TAR=$(which tar) - if test "x${TAR}" = "x"; then - echo "tar not found"; - exit 2; - fi -fi - -echo "Dependencies:"; -echo -e "\tWGET: ${WGET}"; -echo -e "\tTAR: ${TAR}\n"; - -if test "x${ICEDTEA_USE_VCS}" = "xtrue"; then - echo "Mode: Using VCS"; - - if test "x${GREP}" = "x"; then - GREP=$(which grep); - if test "x${GREP}" = "x"; then - echo "grep not found"; - exit 3; - fi - fi - - if test "x${CUT}" = "x"; then - CUT=$(which cut); - if test "x${CUT}" = "x"; then - echo "cut not found"; - exit 4; - fi - fi - - if test "x${TR}" = "x"; then - TR=$(which tr); - if test "x${TR}" = "x"; then - echo "tr not found"; - exit 5; - fi - fi - - if test "x${HG}" = "x"; then - HG=$(which hg); - if test "x${HG}" = "x"; then - echo "hg not found"; - exit 6; - fi - fi - - echo "Dependencies:"; - echo -e "\tGREP: ${GREP}"; - echo -e "\tCUT: ${CUT}"; - echo -e "\tTR: ${TR}"; - echo -e "\tHG: ${HG}"; - - echo "Checking out repository from VCS..."; - ${HG} clone ${ICEDTEA_HG_URL} icedtea - - echo "Obtaining version from configure.ac..."; - ROOT_VER=$(${GREP} '^AC_INIT' icedtea/configure.ac|${CUT} -d ',' -f 2|${TR} -d '[][:space:]') - echo "Root version from configure: ${ROOT_VER}"; - - VCS_REV=$(${HG} log -R icedtea --template '{node|short}' -r tip) - echo "VCS revision: ${VCS_REV}"; - - ICEDTEA_VERSION="${ROOT_VER}-${VCS_REV}" - echo "Creating icedtea-${ICEDTEA_VERSION}"; - mkdir icedtea-${ICEDTEA_VERSION} - echo "Copying required files from checkout to icedtea-${ICEDTEA_VERSION}"; - # Commented out for now as IcedTea 6's jconsole.desktop.in is outdated - #cp -a icedtea/jconsole.desktop.in ../icedtea-${ICEDTEA_VERSION} - cp -a ${RPM_DIR}/jconsole.desktop.in icedtea-${ICEDTEA_VERSION} - cp -a icedtea/tapset icedtea-${ICEDTEA_VERSION} - - rm -rf icedtea -else - echo "Mode: Using tarball"; - - if test "x${ICEDTEA_VERSION}" = "x"; then - echo "No IcedTea version specified for tarball download."; - exit 3; - fi - - if test "x${CHECKSUM}" = "x"; then - CHECKSUM=$(which sha256sum) - if test "x${CHECKSUM}" = "x"; then - echo "sha256sum not found"; - exit 4; - fi - fi - - if test "x${PGP}" = "x"; then - PGP=$(which gpg) - if test "x${PGP}" = "x"; then - echo "gpg not found"; - exit 5; - fi - fi - - echo "Dependencies:"; - echo -e "\tCHECKSUM: ${CHECKSUM}"; - echo -e "\tPGP: ${PGP}\n"; - - echo "Checking for IcedTea signing key ${ICEDTEA_SIGNING_KEY}..."; - if ! gpg --list-keys ${ICEDTEA_SIGNING_KEY}; then - echo "IcedTea signing key ${ICEDTEA_SIGNING_KEY} not installed."; - exit 6; - fi - - echo "Downloading IcedTea release tarball..."; - ${WGET} -v ${ICEDTEA_URL}/icedtea-${ICEDTEA_VERSION}.tar.xz - echo "Downloading IcedTea tarball signature..."; - ${WGET} -v ${ICEDTEA_URL}/icedtea-${ICEDTEA_VERSION}.tar.xz.sig - echo "Downloading IcedTea tarball checksums..."; - ${WGET} -v ${ICEDTEA_URL}/icedtea-${ICEDTEA_VERSION}.sha256 - - echo "Verifying checksums..."; - ${CHECKSUM} --check --ignore-missing icedtea-${ICEDTEA_VERSION}.sha256 - - echo "Checking signature..."; - ${PGP} --verify icedtea-${ICEDTEA_VERSION}.tar.xz.sig - - echo "Extracting files..."; - ${TAR} xJf icedtea-${ICEDTEA_VERSION}.tar.xz \ - icedtea-${ICEDTEA_VERSION}/tapset \ - icedtea-${ICEDTEA_VERSION}/jconsole.desktop.in - - rm -vf icedtea-${ICEDTEA_VERSION}.tar.xz - rm -vf icedtea-${ICEDTEA_VERSION}.tar.xz.sig - rm -vf icedtea-${ICEDTEA_VERSION}.sha256 -fi - -echo "Replacing desktop files..."; -mv -v icedtea-${ICEDTEA_VERSION}/jconsole.desktop.in ${RPM_DIR} - -echo "Creating new tapset tarball..."; -mv -v icedtea-${ICEDTEA_VERSION} openjdk -${TAR} cJf ${RPM_DIR}/tapsets-icedtea-${ICEDTEA_VERSION}.tar.xz openjdk - -rm -rvf openjdk - -popd -rm -rf ${WORKDIR} +# this file is intentionally not here, as portable builds do not have desktop integration diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 8a3b968..f487843 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1,8 +1,3 @@ -%if (0%{?rhel} > 0 && 0%{?rhel} < 8) -# portable jdk 17 specific bug, _jvmdir being missing -%define _jvmdir /usr/lib/jvm -%endif - # debug_package %%{nil} is portable-jdks specific %define debug_package %{nil} @@ -41,8 +36,6 @@ %define __os_install_post %{nil} %endif -%global unpacked_licenses %{_datarootdir}/licenses - # Workaround for stripping of debug symbols from static libraries %if %{with staticlibs} %define __brp_strip_static_archive %{nil} @@ -66,10 +59,6 @@ # See: https://bugzilla.redhat.com/show_bug.cgi?id=1520879 %global _find_debuginfo_opts -g -# With LTO flags enabled, debuginfo checks fail for some reason. Disable -# LTO for a passing build. This really needs to be looked at. -%define _lto_cflags %{nil} - # note: parametrized macros are order-sensitive (unlike not-parametrized) even with normal macros # also necessary when passing it as parameter to other macros. If not macro, then it is considered a switch # see the difference between global and define: @@ -147,9 +136,9 @@ # Set of architectures which support the serviceability agent %global sa_arches %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} %{arm} # Set of architectures which support class data sharing -# See https://bugzilla.redhat.com/show_bug.cgi?id=513605 -# MetaspaceShared::generate_vtable_methods is not implemented for the PPC JIT -%global share_arches %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{arm} s390x +# As of JDK-8005165 in OpenJDK 10, class sharing is not arch-specific +# However, it does segfault on the Zero assembler port, so currently JIT only +%global share_arches %{jit_arches} # Set of architectures for which we build the Shenandoah garbage collector %global shenandoah_arches x86_64 %{aarch64} # Set of architectures for which we build the Z garbage collector @@ -166,7 +155,7 @@ %global gdb_arches %{jit_arches} %{zero_arches} %endif -# By default, we build a debug build during main build on JIT architectures +# By default, we build a slowdebug build during main build on JIT architectures %if %{with slowdebug} %ifarch %{debug_arches} %global include_debug_build 1 @@ -237,17 +226,24 @@ %global static_libs_target %{nil} %endif -# RPM JDK builds keep the debug symbols internal, to be later stripped by RPM -%global debug_symbols internal - -# unlike portables,the rpms have to use static_libs_target very dynamically -%global bootstrap_targets images legacy-jre-image -%global release_targets images docs-zip legacy-jre-image +# The static libraries are produced under the same configuration as the main +# build for portables, as we expect in-tree libraries to be used throughout. +# If system libraries are enabled, the static libraries will also use them +# which may cause issues. +%global bootstrap_targets images %{static_libs_target} legacy-jre-image +%global release_targets images docs-zip %{static_libs_target} legacy-jre-image # No docs nor bootcycle for debug builds -%global debug_targets images legacy-jre-image +%global debug_targets images %{static_libs_target} legacy-jre-image # Target to use to just build HotSpot %global hotspot_target hotspot +# DTS toolset to use to provide gcc & binutils +%global dtsversion 10 + +# Disable LTO as this causes build failures at the moment. +# See RHBZ#1861401 +%define _lto_cflags %{nil} + # Filter out flags from the optflags macro that cause problems with the OpenJDK build # We filter out -O flags so that the optimization of HotSpot is not lowered from O3 to O2 # We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs) @@ -327,20 +323,20 @@ # New Version-String scheme-style defines %global featurever 21 %global interimver 0 -%global updatever 0 +%global updatever 1 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, # and this it is better to change it here, on single place -%global buildjdkver 21 +%global buildjdkver %{featurever} # We don't add any LTS designator for STS packages (Fedora and EPEL). # We need to explicitly exclude EPEL as it would have the %%{rhel} macro defined. %if 0%{?rhel} && !0%{?epel} %global lts_designator "LTS" %global lts_designator_zip -%{lts_designator} %else - %global lts_designator "" - %global lts_designator_zip "" + %global lts_designator "" + %global lts_designator_zip "" %endif # JDK to use for bootstrapping %global bootjdk /usr/lib/jvm/java-%{buildjdkver}-openjdk @@ -366,26 +362,34 @@ %global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%{name}&version=%{fedora} %else %if 0%{?rhel} -%global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%20%{rhel}&component=%{name} +%global oj_vendor_bug_url https://access.redhat.com/support/cases/ %else %global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi %endif %endif %endif -%global oj_vendor_version (Red_Hat-%{version}-%{release}) +%global oj_vendor_version (Red_Hat-%{version}-%{rpmrelease}) # Define IcedTea version used for SystemTap tapsets and desktop file %global icedteaver 6.0.0pre00-c848b93a8598 # Define current Git revision for the FIPS support patches %global fipsver 75ffdc48eda +# Define JDK versions +%global newjavaver %{featurever}.%{interimver}.%{updatever}.%{patchver} +%global javaver %{featurever} +# Strip up to 6 trailing zeros in newjavaver, as the JDK does, to get the correct version used in filenames +%global filever %(svn=%{newjavaver}; for i in 1 2 3 4 5 6 ; do svn=${svn%%.0} ; done; echo ${svn}) +# The tag used to create the OpenJDK tarball +%global vcstag jdk-%{filever}+%{buildver}%{?tagsuffix:-%{tagsuffix}} # Standard JPackage naming and versioning defines %global origin openjdk %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 35 -%global rpmrelease 4 +%global buildver 12 +%global rpmrelease 2 +#%%global tagsuffix %%{nil} # 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 # Using 10 digits may overflow the int used for priority, so we combine the patch and build versions @@ -398,14 +402,6 @@ # for techpreview, using 1, so slowdebugs can have 0 %global priority %( printf '%08d' 1 ) %endif -%global newjavaver %{featurever}.%{interimver}.%{updatever}.%{patchver} -%global javaver %{featurever} - -# Strip up to 6 trailing zeros in newjavaver, as the JDK does, to get the correct version used in filenames -%global filever %(svn=%{newjavaver}; for i in 1 2 3 4 5 6 ; do svn=${svn%%.0} ; done; echo ${svn}) - -# The tag used to create the OpenJDK tarball -%global vcstag jdk-%{filever}+%{buildver}%{?tagsuffix:-%{tagsuffix}} # Define milestone (EA for pre-releases, GA for releases) # Release will be (where N is usually a number starting at 1): @@ -415,7 +411,7 @@ %if %{is_ga} %global build_type GA %global ea_designator "" -%global ea_designator_zip "" +%global ea_designator_zip %{nil} %global extraver %{nil} %global eaprefix %{nil} %else @@ -438,7 +434,9 @@ %global static_libs_install_dir %{static_libs_arch_dir}/glibc # output dir stub %define buildoutputdir() %{expand:build/jdk%{featurever}.build%{?1}} +%define installoutputdir() %{expand:install/jdk%{featurever}.install%{?1}} %global altjavaoutputdir install/altjava.install +%define packageoutputdir() %{expand:packages/jdk%{featurever}.packages%{?1}} # we can copy the javadoc to not arched dir, or make it not noarch %define uniquejavadocdir() %{expand:%{fullversion}.%{_arch}%{?1}} # main id and dir of this jdk @@ -459,6 +457,8 @@ # Intentionally use jdkportablenameimpl here since we want to have static-libs files overlayed on # top of the JDK archive %define staticlibsportablename() %{expand:%{jdkportablenameimpl -- %%{1}}} +%define docportablename() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable.docs;g" | sed "s;openjdkportable;el;g") +%define docportablearchive() %{docportablename}.tar.xz %define miscportablename() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable.misc;g" | sed "s;openjdkportable;el;g") %define miscportablearchive() %{miscportablename}.tar.xz @@ -490,6 +490,12 @@ %global __requires_exclude ^(%{_privatelibs}|%{_publiclibs})$ %endif +# VM variant being built +%ifarch %{zero_arches} +%global vm_variant zero +%else +%global vm_variant server +%endif %global etcjavasubdir %{_sysconfdir}/java/java-%{javaver}-%{origin} %define etcjavadir() %{expand:%{etcjavasubdir}/%{uniquesuffix -- %{?1}}} @@ -512,29 +518,8 @@ %global alternatives_requires %{_sbindir}/alternatives %endif -%if %{with_systemtap} -# Where to install systemtap tapset (links) -# We would like these to be in a package specific sub-dir, -# but currently systemtap doesn't support that, so we have to -# use the root tapset dir for now. To distinguish between 64 -# and 32 bit architectures we place the tapsets under the arch -# specific dir (note that systemtap will only pickup the tapset -# for the primary arch for now). Systemtap uses the machine name -# aka target_cpu as architecture specific directory name. -%global tapsetroot /usr/share/systemtap -%global tapsetdirttapset %{tapsetroot}/tapset/ -%global tapsetdir %{tapsetdirttapset}/%{stapinstall} -%endif - -# x86 is no longer supported -%if 0%{?java_arches:1} -ExclusiveArch: %{java_arches} -%else -ExcludeArch: %{ix86} -%endif - -# Portables have no rpo (requires/provides), but thsoe are awesome for orientation in spec -# also scriptlets are hapily missing and files are handled old fashion +# Portables have no repo (requires/provides), but these are awesome for orientation in spec +# Also scriptlets are happily missing and files are handled old fashion # not-duplicated requires/provides/obsoletes for normal/debug packages %define java_rpo() %{expand: } @@ -545,16 +530,18 @@ ExcludeArch: %{ix86} %define java_static_libs_rpo() %{expand: } +%define java_unstripped_rpo() %{expand: +} + +%define java_docs_rpo() %{expand: +} + %define java_misc_rpo() %{expand: } # Prevent brp-java-repack-jars from being run %global __jar_repack 0 -# portables have grown out of its component, moving back to java-x-vendor -# this expression, when declared as global, filled component with java-x-vendor portable -%define component %(echo %{name} | sed "s;-portable;;g") - Name: java-latest-%{origin}-portable Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with @@ -572,6 +559,11 @@ Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist} # provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0". Epoch: 1 + +# portables have grown out of its component, moving back to java-x-vendor +# this expression, when declared as global, filled component with java-x-vendor portable +%define component %(echo %{name} | sed "s;-portable;;g") + Summary: %{origin_nice} %{featurever} Runtime Environment portable edition # Groups are only used up to RHEL 8 and on Fedora versions prior to F30 %if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30) @@ -595,9 +587,8 @@ Group: Development/Languages License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA URL: http://openjdk.java.net/ - # The source tarball, generated using generate_source_tarball.sh -Source0: https://openjdk-sources.osci.io/openjdk%{featurever}/open%{vcstag}.tar.xz +Source0: https://openjdk-sources.osci.io/openjdk%{featurever}/open%{vcstag}%{ea_designator_zip}.tar.xz # Use 'icedtea_sync.sh' to update the following # They are based on code contained in the IcedTea project (6.x). @@ -616,8 +607,7 @@ Source10: NEWS Source11: alt-java.c # Removed libraries that we link instead -# Disabled in portables -#Source12: remove-intree-libraries.sh +Source12: remove-intree-libraries.sh # Ensure we aren't using the limited crypto policy Source13: TestCryptoLevel.java @@ -634,14 +624,6 @@ Source16: CheckVendor.java # Ensure translations are available for new timezones Source18: TestTranslations.java -%if (0%{?rhel} > 0 && 0%{?rhel} < 8) -# boot jdk for portable build root on -Source1001: ojdk17-aarch64-17.35.tar.gz -Source1002: ojdk17-ppc64le-17.35.tar.gz -Source1003: ojdk17-x86_64-17.35.tar.gz -Source1004: ojdk17-s390x-17.35.tar.gz -%endif - ############################################ # # RPM/distribution specific patches @@ -691,16 +673,29 @@ Patch1001: fips-%{featurever}u-%{fipsver}.patch # OpenJDK patches in need of upstreaming # ############################################# + # JDK-8009550, RH910107: Depend on pcsc-lite-libs instead of pcsc-lite-devel as this is only in optional repo # PR: https://github.com/openjdk/jdk/pull/15409 Patch6: jdk8009550-rh910107-fail_to_load_pcsc_library.patch +# Currently empty + ############################################# # # OpenJDK patches which missed last update # ############################################# -#empty now + +# JDK-8311630: [s390] Implementation of Foreign Function & Memory API (Preview) +Patch100: jdk8311630-s390_ffmapi.patch + +############################################# +# +# Portable build specific patches +# +############################################# + +# Currently empty BuildRequires: autoconf BuildRequires: automake @@ -710,11 +705,11 @@ BuildRequires: cups-devel BuildRequires: desktop-file-utils # elfutils only are OK for build without AOT BuildRequires: elfutils-devel +BuildRequires: file BuildRequires: fontconfig-devel -BuildRequires: freetype-devel %if (0%{?rhel} > 0 && 0%{?rhel} < 8) -BuildRequires: devtoolset-8-gcc -BuildRequires: devtoolset-8-gcc-c++ +BuildRequires: devtoolset-%{dtsversion}-gcc +BuildRequires: devtoolset-%{dtsversion}-gcc-c++ %else BuildRequires: gcc # gcc-c++ is already needed @@ -737,9 +732,8 @@ BuildRequires: libXtst-devel # Requirement for setting up nss.fips.cfg BuildRequires: nss-devel # Requirement for system security property test -%if (0%{?rhel} > 0 && 0%{?rhel} < 8) -BuildRequires: crypto-policies -%endif +#N/A +#BuildRequires: crypto-policies BuildRequires: pkgconfig BuildRequires: xorg-x11-proto-devel BuildRequires: zip @@ -758,7 +752,6 @@ BuildRequires: libffi-devel %endif # 2023c required as of JDK-8305113 BuildRequires: tzdata-java >= 2023c - # cacerts build requirement in portable mode BuildRequires: ca-certificates # Earlier versions have a bug in tree vectorization on PPC @@ -777,18 +770,18 @@ BuildRequires: lcms2-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel %else -# Version in src/java.desktop/share/native/libfreetype/include/freetype/freetype.h -Provides: bundled(freetype) = 2.12.1 +# Version in src/java.desktop/share/legal/freetype.md +Provides: bundled(freetype) = 2.13.0 # Version in src/java.desktop/share/native/libsplashscreen/giflib/gif_lib.h Provides: bundled(giflib) = 5.2.1 # Version in src/java.desktop/share/native/libharfbuzz/hb-version.h -Provides: bundled(harfbuzz) = 4.4.1 +Provides: bundled(harfbuzz) = 7.2.0 # Version in src/java.desktop/share/native/liblcms/lcms2.h -Provides: bundled(lcms2) = 2.12.0 +Provides: bundled(lcms2) = 2.15.0 # Version in src/java.desktop/share/native/libjavajpeg/jpeglib.h Provides: bundled(libjpeg) = 6b # Version in src/java.desktop/share/native/libsplashscreen/libpng/png.h -Provides: bundled(libpng) = 1.6.37 +Provides: bundled(libpng) = 1.6.39 # We link statically against libstdc++ to increase portability BuildRequires: libstdc++-static %endif @@ -863,7 +856,7 @@ Group: Development/Tools %{java_devel_rpo -- %{fastdebug_suffix_unquoted}} %description devel-fastdebug -The %{origin_nice} %{featurever} development tools - portable edition. +The %{origin_nice} %{featurever} runtime environment and development tools - portable edition %{fastdebug_warning} %endif @@ -871,7 +864,7 @@ The %{origin_nice} %{featurever} development tools - portable edition. %if %{include_normal_build} %package static-libs -Summary: %{origin_nice} %{featurever} libraries for static linking - portable edition. +Summary: %{origin_nice} %{featurever} libraries for static linking - portable edition %{java_static_libs_rpo %{nil}} @@ -886,7 +879,7 @@ Summary: %{origin_nice} %{featurever} libraries for static linking - portable ed %{java_static_libs_rpo -- %{debug_suffix_unquoted}} %description static-libs-slowdebug -The %{origin_nice} %{featurever} libraries for static linking - portable edition. +The %{origin_nice} %{featurever} libraries for static linking - portable edition %{debug_warning} %endif @@ -897,13 +890,32 @@ Summary: %{origin_nice} %{featurever} libraries for static linking - portable ed %{java_static_libs_rpo -- %{fastdebug_suffix_unquoted}} %description static-libs-fastdebug -The %{origin_nice} %{featurever} libraries for static linking - portable edition. +The %{origin_nice} %{featurever} libraries for static linking - portable edition %{fastdebug_warning} %endif # staticlibs %endif +%if %{include_normal_build} +%package unstripped +Summary: The %{origin_nice} %{featurever} runtime environment. + +%{java_unstripped_rpo %{nil}} + +%description unstripped +The %{origin_nice} %{featurever} runtime environment. + +%endif + +%package docs +Summary: %{origin_nice} %{featurever} API documentation + +%{java_docs_rpo %{nil}} + +%description docs +The %{origin_nice} %{featurever} API documentation. + %package misc Summary: %{origin_nice} %{featurever} miscellany @@ -923,10 +935,10 @@ The %{origin_nice} %{featurever} full patched sources of portable JDK to build, echo "Preparing %{oj_vendor_version}" # Using the echo macro breaks rpmdev-bumpspec, as it parses the first line of stdout :-( -%if 0%{?stapinstall:1} - echo "CPU: %{_target_cpu}, arch install directory: %{archinstall}, SystemTap install directory: %{stapinstall}" +%if 0%{?_build_cpu:1} + echo "CPU: %{_target_cpu}, arch install directory: %{archinstall}, SystemTap install directory: %{_build_cpu}" %else - %{error:Unrecognised architecture %{_target_cpu}} + %{error:Unrecognised architecture %{_build_cpu}} %endif if [ %{include_normal_build} -eq 0 -o %{include_normal_build} -eq 1 ] ; then @@ -947,7 +959,6 @@ else echo "include_fastdebug_build is %{include_fastdebug_build}, that is invalid. Use 1 for yes or 0 for no" exit 13 fi - if [ %{include_debug_build} -eq 0 -a %{include_normal_build} -eq 0 -a %{include_fastdebug_build} -eq 0 ] ; then echo "You have disabled all builds (normal,fastdebug,slowdebug). That is a no go." exit 14 @@ -979,8 +990,11 @@ pushd %{top_level_dir_name} %patch1001 -p1 # Patches in need of upstreaming %patch6 -p1 +# Patches in next release +%patch100 -p1 popd # openjdk + # The OpenJDK version file includes the current # upstream version information. For some reason, # configure does not automatically use the @@ -1001,59 +1015,12 @@ if [ "x${UPSTREAM_EA_DESIGNATOR}" != "x%{ea_designator}" ] ; then exit 17 fi -# Extract systemtap tapsets -%if %{with_systemtap} -tar --strip-components=1 -x -I xz -f %{SOURCE8} -%if %{include_debug_build} -cp -r tapset tapset%{debug_suffix} -%endif -%if %{include_fastdebug_build} -cp -r tapset tapset%{fastdebug_suffix} -%endif - -for suffix in %{build_loop} ; do - for file in "tapset"$suffix/*.in; do - OUTPUT_FILE=`echo $file | sed -e "s:\.stp\.in$:-%{version}-%{release}.%{_arch}.stp:g"` - sed -e "s:@ABS_SERVER_LIBJVM_SO@:%{_jvmdir}/%{sdkdir -- $suffix}/lib/server/libjvm.so:g" $file > $file.1 - sed -e "s:@JAVA_SPEC_VER@:%{javaver}:g" $file.1 > $file.2 -# TODO find out which architectures other than i686 have a client vm -%ifarch %{ix86} - sed -e "s:@ABS_CLIENT_LIBJVM_SO@:%{_jvmdir}/%{sdkdir -- $suffix}/lib/client/libjvm.so:g" $file.2 > $OUTPUT_FILE -%else - sed -e "/@ABS_CLIENT_LIBJVM_SO@/d" $file.2 > $OUTPUT_FILE -%endif - sed -i -e "s:@ABS_JAVA_HOME_DIR@:%{_jvmdir}/%{sdkdir -- $suffix}:g" $OUTPUT_FILE - sed -i -e "s:@INSTALL_ARCH_DIR@:%{archinstall}:g" $OUTPUT_FILE - sed -i -e "s:@prefix@:%{_jvmdir}/%{sdkdir -- $suffix}/:g" $OUTPUT_FILE - done -done -# systemtap tapsets ends -%endif +# Systemtap is processed in rpms # Prepare desktop files # Portables do not have desktop integration %build -%if (0%{?rhel} > 0 && 0%{?rhel} < 8) -mkdir bootjdk -pushd bootjdk -%ifarch %{aarch64} -tar --strip-components=1 -xf %{SOURCE1001} -%endif -%ifarch %{ppc64le} -tar --strip-components=1 -xf %{SOURCE1002} -%endif -%ifarch x86_64 -tar --strip-components=1 -xf %{SOURCE1003} -%endif -%ifarch s390x -tar --strip-components=1 -xf %{SOURCE1004} -%endif -BOOT_JDK=$PWD -popd -%else -BOOT_JDK=%{bootjdk} -%endif # How many CPU's do we have? export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) @@ -1091,12 +1058,15 @@ echo "Building %{SOURCE11}" mkdir -p %{altjavaoutputdir} gcc ${EXTRA_CFLAGS} -o %{altjavaoutputdir}/%{alt_java_name} %{SOURCE11} +echo "Building %{newjavaver}-%{buildver}, pre=%{ea_designator}, opt=%{lts_designator}" + function buildjdk() { local outputdir=${1} local buildjdk=${2} local maketargets="${3}" local debuglevel=${4} local link_opt=${5} + local debug_symbols=${6} local top_dir_abs_src_path=$(pwd)/%{top_level_dir_name} local top_dir_abs_build_path=$(pwd)/${outputdir} @@ -1115,6 +1085,7 @@ function buildjdk() { echo "Using make targets: ${maketargets}" echo "Using debuglevel: ${debuglevel}" echo "Using link_opt: ${link_opt}" + echo "Using debug_symbols: ${debug_symbols}" echo "Building %{newjavaver}-%{buildver}, pre=%{ea_designator}, opt=%{lts_designator}" mkdir -p ${outputdir} @@ -1125,7 +1096,7 @@ function buildjdk() { # are always used in a system_libs build, even # for the static library build %if (0%{?rhel} > 0 && 0%{?rhel} < 8) - scl enable devtoolset-8 -- bash ${top_dir_abs_src_path}/configure \ + scl enable devtoolset-%{dtsversion} -- bash ${top_dir_abs_src_path}/configure \ %else bash ${top_dir_abs_src_path}/configure \ %endif @@ -1145,7 +1116,7 @@ function buildjdk() { --with-vendor-vm-bug-url="%{oj_vendor_bug_url}" \ --with-boot-jdk=${buildjdk} \ --with-debug-level=${debuglevel} \ - --with-native-debug-symbols="%{debug_symbols}" \ + --with-native-debug-symbols="${debug_symbols}" \ --disable-sysconf-nss \ --enable-unlimited-crypto \ --with-zlib=%{link_type} \ @@ -1169,7 +1140,7 @@ function buildjdk() { cat spec.gmk %if (0%{?rhel} > 0 && 0%{?rhel} < 8) - scl enable devtoolset-8 -- make \ + scl enable devtoolset-%{dtsversion} -- make \ %else make \ %endif @@ -1177,109 +1148,117 @@ function buildjdk() { WARNINGS_ARE_ERRORS="-Wno-error" \ CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" \ $maketargets || ( pwd; find ${top_dir_abs_src_path} ${top_dir_abs_build_path} -name "hs_err_pid*.log" | xargs cat && false ) - popd } -function installjdk() { - local imagepath=${1} +function stripjdk() { + local outputdir=${1} + local jdkimagepath=${outputdir}/images/%{jdkimage} + local jreimagepath=${outputdir}/images/%{jreimage} + local jmodimagepath=${outputdir}/images/jmods + local supportdir=${outputdir}/support - if [ -d ${imagepath} ] ; then - # the build (erroneously) removes read permissions from some jars - # this is a regression in OpenJDK 7 (our compiler): - # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437 - find ${imagepath} -iname '*.jar' -exec chmod ugo+r {} \; + if [ "x$suffix" = "x" ] ; then + # Keep the unstripped version for consumption by RHEL RPMs + cp -a ${jdkimagepath}{,.unstripped} - # Build screws up permissions on binaries - # https://bugs.openjdk.java.net/browse/JDK-8173610 - find ${imagepath} -iname '*.so' -exec chmod +x {} \; - find ${imagepath}/bin/ -exec chmod +x {} \; - - # Create fake alt-java as a placeholder for future alt-java - if [ -d man/man1 ] ; then - pushd ${imagepath} - # add alt-java man page - echo "Hardened java binary recommended for launching untrusted code from the Web e.g. javaws" > man/man1/%{alt_java_name}.1 - cat man/man1/java.1 >> man/man1/%{alt_java_name}.1 - popd - fi - fi -} - -# Checks on debuginfo must be performed before the files are stripped -# by the RPM installation stage -function debugcheckjdk() { - local imagepath=${1} - - if [ -d ${imagepath} ] ; then - - so_suffix="so" - # Check debug symbols are present and can identify code - find "${imagepath}" -iname "*.$so_suffix" -print0 | while read -d $'\0' lib - do - if [ -f "$lib" ] ; then - echo "Testing $lib for debug symbols" - # All these tests rely on RPM failing the build if the exit code of any set - # of piped commands is non-zero. - - # Test for .debug_* sections in the shared object. This is the main test - # Stripped objects will not contain these - eu-readelf -S "$lib" | grep "] .debug_" - test $(eu-readelf -S "$lib" | grep -E "\]\ .debug_(info|abbrev)" | wc --lines) == 2 - - # Test FILE symbols. These will most likely be removed by anything that - # manipulates symbol tables because it's generally useless. So a nice test - # that nothing has messed with symbols - old_IFS="$IFS" - IFS=$'\n' - for line in $(eu-readelf -s "$lib" | grep "00000000 0 FILE LOCAL DEFAULT") - do - # We expect to see .cpp and .S files, except for architectures like aarch64 and - # s390 where we expect .o and .oS files - echo "$line" | grep -E "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|S|oS))?$" - done - IFS="$old_IFS" - - # If this is the JVM, look for javaCalls.(cpp|o) in FILEs, for extra sanity checking - if [ "`basename $lib`" = "libjvm.so" ]; then - eu-readelf -s "$lib" | \ - grep -E "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" - fi - - # Test that there are no .gnu_debuglink sections pointing to another - # debuginfo file. There shouldn't be any debuginfo files, so the link makes - # no sense either - eu-readelf -S "$lib" | grep 'gnu' - if eu-readelf -S "$lib" | grep "\] .gnu_debuglink" | grep PROGBITS; then - echo "bad .gnu_debuglink section." - eu-readelf -x .gnu_debuglink "$lib" - false - fi + # Strip the files + for file in $(find ${jdkimagepath} ${jreimagepath} ${supportdir} -type f) ; do + if file ${file} | grep -q 'ELF'; then + noextfile=${file/.so/}; + objcopy --only-keep-debug ${file} ${noextfile}.debuginfo; + objcopy --add-gnu-debuglink=${noextfile}.debuginfo ${file}; + strip -g ${file}; fi done - # Make sure gdb can do a backtrace based on line numbers on libjvm.so - # javaCalls.cpp:58 should map to: - # http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/ff3b27e6bcc2/src/share/vm/runtime/javaCalls.cpp#l58 - # Using line number 1 might cause build problems. See: - # https://bugzilla.redhat.com/show_bug.cgi?id=1539664 - # https://bugzilla.redhat.com/show_bug.cgi?id=1538767 - gdb -q "${imagepath}/bin/java" < man/man1/%{alt_java_name}.1 + cat man/man1/java.1 >> man/man1/%{alt_java_name}.1 + popd + + # Print release information + cat ${imagepath}/release + fi + done } function genchecksum() { @@ -1295,218 +1274,202 @@ function genchecksum() { popd } -packagesdir=$(pwd)/.. +function packFullPatchedSources() { + srcpackagesdir=`pwd` + tar -cJf ${srcpackagesdir}/%{jdkportablesourcesarchive -- ""} --transform "s|^|%{jdkportablesourcesname -- ""}/|" %{top_level_dir_name} + genchecksum ${srcpackagesdir}/%{jdkportablesourcesarchive -- ""} +} -pwd -ls -l -tar -cJf ${packagesdir}/%{jdkportablesourcesarchive -- ""} --transform "s|^|%{jdkportablesourcesname -- ""}/|" %{top_level_dir_name} -genchecksum ${packagesdir}/%{jdkportablesourcesarchive -- ""} +function packagejdk() { + local imagesdir=$(pwd)/${1}/images + local docdir=$(pwd)/${1}/images/docs + local bundledir=$(pwd)/${1}/bundles + local packagesdir=$(pwd)/${2} + local srcdir=$(pwd)/%{top_level_dir_name} + local tapsetdir=$(pwd)/tapset + local altjavadir=$(pwd)/${3} + + echo "Packaging build from ${imagesdir} to ${packagesdir}..." + mkdir -p ${packagesdir} + pushd ${imagesdir} + + echo "Packaging build from ${imagesdir} to ${packagesdir}..." + mkdir -p ${packagesdir} + pushd ${imagesdir} + + if [ "x$suffix" = "x" ] ; then + nameSuffix="" + else + nameSuffix=`echo "$suffix"| sed s/-/./` + fi + + jdkname=%{jdkportablename -- "$nameSuffix"} + jdkarchive=${packagesdir}/%{jdkportablearchive -- "$nameSuffix"} + jrename=%{jreportablename -- "$nameSuffix"} + jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"} + staticname=%{staticlibsportablename -- "$nameSuffix"} + staticarchive=${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"} + debugarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.debuginfo"} + unstrippedarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.unstripped"} + # We only use docs for the release build + docname=%{docportablename} + docarchive=${packagesdir}/%{docportablearchive} + built_doc_archive=jdk-%{filever}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip + # These are from the source tree so no debug variants + miscname=%{miscportablename} + miscarchive=${packagesdir}/%{miscportablearchive} + + if [ "x$suffix" = "x" ] ; then + # Keep the unstripped version for consumption by RHEL RPMs + mv %{jdkimage}.unstripped ${jdkname} + tar -cJf ${unstrippedarchive} ${jdkname} + genchecksum ${unstrippedarchive} + mv ${jdkname} %{jdkimage}.unstripped + fi + + # Rename directories for packaging + mv %{jdkimage} ${jdkname} + mv %{jreimage} ${jrename} + + # Release images have external debug symbols + if [ "x$suffix" = "x" ] ; then + tar -cJf ${debugarchive} $(find ${jdkname} -name \*.debuginfo) + genchecksum ${debugarchive} + + mkdir ${docname} + mv ${docdir} ${docname} + mv ${bundledir}/${built_doc_archive} ${docname} + tar -cJf ${docarchive} ${docname} + genchecksum ${docarchive} + + mkdir ${miscname} + for s in 16 24 32 48 ; do + cp -av ${srcdir}/src/java.desktop/unix/classes/sun/awt/X11/java-icon${s}.png ${miscname} + done +%if %{with_systemtap} + cp -a ${tapsetdir}* ${miscname} +%endif + cp -av ${altjavadir}/%{alt_java_name} ${miscname} + tar -cJf ${miscarchive} ${miscname} + genchecksum ${miscarchive} + fi + + tar -cJf ${jdkarchive} --exclude='**.debuginfo' ${jdkname} + genchecksum ${jdkarchive} + + tar -cJf ${jrearchive} --exclude='**.debuginfo' ${jrename} + genchecksum ${jrearchive} + +%if %{include_staticlibs} + # Static libraries (needed for building graal vm with native image) + # Tar as overlay. Transform to the JDK name, since we just want to "add" + # static libraries to that folder + tar -cJf ${staticarchive} \ + --transform "s|^%{static_libs_image}/lib/*|${staticname}/lib/static/linux-%{archinstall}/glibc/|" "%{static_libs_image}/lib" + genchecksum ${staticarchive} +%endif + + # Revert directory renaming so testing will run + # TODO: testing should run on the packaged JDK + mv ${jdkname} %{jdkimage} + mv ${jrename} %{jreimage} + + popd #images + +} + +packFullPatchedSources %if %{build_hotspot_first} # Build a fresh libjvm.so first and use it to bootstrap cp -LR --preserve=mode,timestamps %{bootjdk} newboot systemjdk=$(pwd)/newboot - buildjdk build/newboot ${systemjdk} %{hotspot_target} "release" "bundled" - mv build/newboot/jdk/lib/server/libjvm.so newboot/lib/server + buildjdk build/newboot ${systemjdk} %{hotspot_target} "release" "bundled" "internal" + mv build/newboot/jdk/lib/%{vm_variant}/libjvm.so newboot/lib/%{vm_variant} %else systemjdk=%{bootjdk} %endif for suffix in %{build_loop} ; do + if [ "x$suffix" = "x" ] ; then debugbuild=release else # change --something to something debugbuild=`echo $suffix | sed "s/-//g"` fi - for loop in %{main_suffix} %{staticlibs_loop} ; do - builddir=%{buildoutputdir -- ${suffix}${loop}} - bootbuilddir=boot${builddir} - if test "x${loop}" = "x%{main_suffix}" ; then - link_opt="%{link_type}" + # We build with internal debug symbols and do + # our own stripping for one version of the + # release build + debug_symbols=internal + + builddir=%{buildoutputdir -- ${suffix}} + bootbuilddir=boot${builddir} + installdir=%{installoutputdir -- ${suffix}} + bootinstalldir=boot${installdir} + packagesdir=%{packageoutputdir -- ${suffix}} + + link_opt="%{link_type}" %if %{system_libs} - # Copy the source tree so we can remove all in-tree libraries - cp -a %{top_level_dir_name} %{top_level_dir_name_backup} - # Remove all libraries that are linked - sh %{SOURCE12} %{top_level_dir_name} full + # Copy the source tree so we can remove all in-tree libraries + cp -a %{top_level_dir_name} %{top_level_dir_name_backup} + # Remove all libraries that are linked + sh %{SOURCE12} %{top_level_dir_name} full %endif - # Debug builds don't need same targets as release for - # build speed-up. We also avoid bootstrapping these - # slower builds. - if echo $debugbuild | grep -q "debug" ; then - maketargets="%{debug_targets}" - run_bootstrap=false - else - maketargets="%{release_targets}" - run_bootstrap=%{bootstrap_build} - fi - if ${run_bootstrap} ; then - buildjdk ${bootbuilddir} ${systemjdk} "%{bootstrap_targets}" ${debugbuild} ${link_opt} - buildjdk ${builddir} $(pwd)/${bootbuilddir}/images/%{jdkimage} "${maketargets}" ${debugbuild} ${link_opt} - rm -rf ${bootbuilddir} - else - buildjdk ${builddir} ${systemjdk} "${maketargets}" ${debugbuild} ${link_opt} - fi + # Debug builds don't need same targets as release for + # build speed-up. We also avoid bootstrapping these + # slower builds. + if echo $debugbuild | grep -q "debug" ; then + maketargets="%{debug_targets}" + run_bootstrap=false + else + maketargets="%{release_targets}" + run_bootstrap=%{bootstrap_build} + fi + if ${run_bootstrap} ; then + buildjdk ${bootbuilddir} ${systemjdk} "%{bootstrap_targets}" ${debugbuild} ${link_opt} ${debug_symbols} + installjdk ${bootbuilddir} ${bootinstalldir} + buildjdk ${builddir} $(pwd)/${bootinstalldir}/images/%{jdkimage} "${maketargets}" ${debugbuild} ${link_opt} ${debug_symbols} + stripjdk ${builddir} + installjdk ${builddir} ${installdir} + %{!?with_artifacts:rm -rf ${bootinstalldir}} + else + buildjdk ${builddir} ${systemjdk} "${maketargets}" ${debugbuild} ${link_opt} ${debug_symbols} + stripjdk ${builddir} + installjdk ${builddir} ${installdir} + fi + packagejdk ${installdir} ${packagesdir} %{altjavaoutputdir} + %if %{system_libs} - # Restore original source tree we modified by removing full in-tree sources - rm -rf %{top_level_dir_name} - mv %{top_level_dir_name_backup} %{top_level_dir_name} + # Restore original source tree we modified by removing full in-tree sources + rm -rf %{top_level_dir_name} + mv %{top_level_dir_name_backup} %{top_level_dir_name} %endif - else - # Use bundled libraries for building statically - link_opt="bundled" - # Static library cycle only builds the static libraries - maketargets="%{static_libs_target}" - # Always just do the one build for the static libraries - buildjdk ${builddir} ${systemjdk} "${maketargets}" ${debugbuild} ${link_opt} - fi - - done # end of main / staticlibs loop - - # Final setup on the main image - top_dir_abs_main_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{main_suffix}} - for image in %{jdkimage} %{jreimage} ; do - imagePath=${top_dir_abs_main_build_path}/images/${image} - installjdk ${imagePath} - done - # Check debug symbols were built into the dynamic libraries; todo, why it passes in JDK only? - debugcheckjdk ${top_dir_abs_main_build_path}/images/%{jdkimage} - - # Print release information - cat ${top_dir_abs_main_build_path}/images/%{jdkimage}/release - -################################################################################ - pushd ${top_dir_abs_main_build_path}/images - if [ "x$suffix" == "x" ] ; then - nameSuffix="" - else - nameSuffix=`echo "$suffix"| sed s/-/./` - fi - # additional steps needed for fluent repack; most of them done twice, as images are already populated - # maybe most of them should be done in upstream build? - for imagedir in %{jdkimage} %{jreimage} ; do - pushd $imagedir - # Convert man pages to UTF8 encoding - if [ -d man/man1 ] ; then # jre do not have man pages... - for manpage in man/man1/* ; do - iconv -f ISO_8859-1 -t UTF8 $manpage -o $manpage.tmp - mv -f $manpage.tmp $manpage - done - fi - # Install release notes - cp -a %{SOURCE10} `pwd` - cp -a %{SOURCE10} `pwd`/legal - # stabilize permissions; aprtially duplicated in instalojdk - find `pwd` -name "*.so" -exec chmod 755 {} \; -exec echo "set 755 to so {}" \; ; - find `pwd` -type d -exec chmod 755 {} \; -exec echo "set 755 to dir {}" \; ; - find `pwd`/legal -type f -exec chmod 644 {} \; -exec echo "set 644 to licences {}" \; ; - popd # jdkimage/jreimage - done # jre/sdk work in loop - # javadoc is done only for release sdkimage - if ! echo $suffix | grep -q "debug" ; then - # Install Javadoc documentation - #cp -a docs %{jdkimage} # not sure if the plaintext javadoc is for some use - built_doc_archive=jdk-%{filever}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip - cp -a `pwd`/../bundles/${built_doc_archive} `pwd`/%{jdkimage}/javadocs.zip || ls -l `pwd`/../bundles - fi - # end of additional steps - - mv %{jdkimage} %{jdkportablename -- "$nameSuffix"} - mv %{jreimage} %{jreportablename -- "$nameSuffix"} - tar -cJf ${packagesdir}/%{jdkportablearchive -- "$nameSuffix"} --exclude='**.debuginfo' %{jdkportablename -- "$nameSuffix"} - genchecksum ${packagesdir}/%{jdkportablearchive -- "$nameSuffix"} - tar -cJf ${packagesdir}/%{jreportablearchive -- "$nameSuffix"} --exclude='**.debuginfo' %{jreportablename -- "$nameSuffix"} - genchecksum ${packagesdir}/%{jreportablearchive -- "$nameSuffix"} - # copy licenses so they are avialable out of tarball - cp -rf %{jdkportablename -- "$nameSuffix"}/legal ${packagesdir}/%{jdkportablearchive -- "%{normal_suffix}"}-legal - mv %{jdkportablename -- "$nameSuffix"} %{jdkimage} - mv %{jreportablename -- "$nameSuffix"} %{jreimage} - popd #images -%if %{include_staticlibs} - top_dir_abs_staticlibs_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{staticlibs_suffix}} - pushd ${top_dir_abs_staticlibs_build_path}/images - # Static libraries (needed for building graal vm with native image) - # Tar as overlay. Transform to the JDK name, since we just want to "add" - # static libraries to that folder - portableJDKname=%{staticlibsportablename -- "$nameSuffix"} - tar -cJf ${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"} --transform "s|^%{static_libs_image}/lib/*|$portableJDKname/lib/static/linux-%{archinstall}/glibc/|" "%{static_libs_image}/lib" - genchecksum ${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"} - popd #staticlibs-images -%endif -################################################################################ -# note, currently no debuginfo, consult portbale spec for external (zipped) debuginfo, being tarred alone -################################################################################ # build cycles done # end of release / debug cycle loop -# These are from the source tree so no debug variants -miscname=%{miscportablename} -miscarchive=${packagesdir}/%{miscportablearchive} - -mkdir ${miscname} -cp -av %{altjavaoutputdir}/%{alt_java_name} ${miscname} -tar -cJf ${miscarchive} ${miscname} -genchecksum ${miscarchive} - -%install - -packagesdir=$(pwd)/.. - -mkdir -p $RPM_BUILD_ROOT%{_jvmdir} -# Install outside the loop as there are no debug variants -miscarchive=${packagesdir}/%{miscportablearchive} -mv ${packagesdir}/%{jdkportablesourcesarchive -- ""} $RPM_BUILD_ROOT%{_jvmdir}/ -mv ${packagesdir}/%{jdkportablesourcesarchive -- ""}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ -mv ${miscarchive} $RPM_BUILD_ROOT%{_jvmdir}/ -mv ${miscarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ - -for suffix in %{build_loop} ; do -top_dir_abs_main_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{main_suffix}} - -################################################################################ - if [ "x$suffix" == "x" ] ; then - nameSuffix="" - else - nameSuffix=`echo "$suffix"| sed s/-/./` - fi - mv ${packagesdir}/%{jdkportablearchive -- "$nameSuffix"} $RPM_BUILD_ROOT%{_jvmdir}/ - mv ${packagesdir}/%{jdkportablearchive -- "$nameSuffix"}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ - mv ${packagesdir}/%{jreportablearchive -- "$nameSuffix"} $RPM_BUILD_ROOT%{_jvmdir}/ - mv ${packagesdir}/%{jreportablearchive -- "$nameSuffix"}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ -%if %{include_staticlibs} - mv ${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"} $RPM_BUILD_ROOT%{_jvmdir}/ - mv ${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ -%endif - if [ "x$suffix" == "x" ] ; then - dnameSuffix="$nameSuffix".debuginfo -# todo handle debuginfo, see note at build (we will need to pack one stripped and one unstripped release build) -# mv ../%{jdkportablearchive -- "$dnameSuffix"} $RPM_BUILD_ROOT%{_jvmdir}/ -# mv ../%{jdkportablearchive -- "$dnameSuffix"}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ - fi -################################################################################ -# end, dual install -done -################################################################################ -# the licenses are packed onloy once and shared -mkdir -p $RPM_BUILD_ROOT%{unpacked_licenses} -mv ${packagesdir}/%{jdkportablearchive -- "%{normal_suffix}"}-legal $RPM_BUILD_ROOT%{unpacked_licenses}/%{jdkportablesourcesarchive -- "%{normal_suffix}"} -# To show sha in the build log -for file in `ls $RPM_BUILD_ROOT%{_jvmdir}/*.sha256sum` ; do ls -l $file ; cat $file ; done -################################################################################ - %check # We test debug first as it will give better diagnostics on a crash for suffix in %{build_loop} ; do -# Tests in the check stage are performed on the installed image -# rpmbuild operates as follows: build -> install -> test -# however in portbales, we test built image instead of installed one -top_dir_abs_main_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{main_suffix}} +# portable builds have static_libs embedded, thus top_dir_abs_main_build_path is same as top_dir_abs_staticlibs_build_path +top_dir_abs_main_build_path=$(pwd)/%{installoutputdir -- ${suffix}} +%if %{include_staticlibs} +top_dir_abs_staticlibs_build_path=${top_dir_abs_main_build_path} +%endif + export JAVA_HOME=${top_dir_abs_main_build_path}/images/%{jdkimage} -#check Shenandoah is enabled +# Pre-test setup + +# System security properties are disabled by default on portable. +# Turn on system security properties +#sed -i -e "s:^security.useSystemPropertiesFile=.*:security.useSystemPropertiesFile=true:" \ +#${JAVA_HOME}/conf/security/java.security + +# Check Shenandoah is enabled %if %{use_shenandoah_hotspot} $JAVA_HOME/bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -version %endif @@ -1525,9 +1488,14 @@ $JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||") $JAVA_HOME/bin/javac -d . %{SOURCE15} export PROG=$(echo $(basename %{SOURCE15})|sed "s|\.java||") export SEC_DEBUG="-Djava.security.debug=properties" +# Specific to portable:System security properties to be off by default $JAVA_HOME/bin/java ${SEC_DEBUG} ${PROG} false $JAVA_HOME/bin/java ${SEC_DEBUG} -Djava.security.disableSystemPropertiesFile=false ${PROG} false +# Check correct vendor values have been set +$JAVA_HOME/bin/javac -d . %{SOURCE16} +$JAVA_HOME/bin/java $(echo $(basename %{SOURCE16})|sed "s|\.java||") "%{oj_vendor}" "%{oj_vendor_url}" "%{oj_vendor_bug_url}" "%{oj_vendor_version}" + # Check java launcher has no SSB mitigation if ! nm $JAVA_HOME/bin/java | grep set_speculation ; then true ; else false; fi @@ -1539,14 +1507,11 @@ nm %{altjavaoutputdir}/%{alt_java_name} | grep prctl if ! nm %{altjavaoutputdir}/%{alt_java_name} | grep prctl ; then true ; else false; fi %endif -# Check correct vendor values have been set -$JAVA_HOME/bin/javac -d . %{SOURCE16} -$JAVA_HOME/bin/java $(echo $(basename %{SOURCE16})|sed "s|\.java||") "%{oj_vendor}" "%{oj_vendor_url}" "%{oj_vendor_bug_url}" "%{oj_vendor_version}" - %if ! 0%{?flatpak} # Check translations are available for new timezones (during flatpak builds, the # tzdb.dat used by this test is not where the test expects it, so this is -# disabled for flatpak builds) +# disabled for flatpak builds) +# Disable test until we are on the latest JDK $JAVA_HOME/bin/javac -d . %{SOURCE18} $JAVA_HOME/bin/java $(echo $(basename %{SOURCE18})|sed "s|\.java||") JRE $JAVA_HOME/bin/java -Djava.locale.providers=CLDR $(echo $(basename %{SOURCE18})|sed "s|\.java||") CLDR @@ -1554,9 +1519,82 @@ $JAVA_HOME/bin/java -Djava.locale.providers=CLDR $(echo $(basename %{SOURCE18})| %if %{include_staticlibs} # Check debug symbols in static libraries (smoke test) -export STATIC_LIBS_HOME=${top_dir_abs_main_build_path}/../../%{buildoutputdir -- ${suffix}%{staticlibs_suffix}}/images/static-libs/lib/ -readelf --debug-dump $STATIC_LIBS_HOME/libnet.a | grep Inet4AddressImpl.c -readelf --debug-dump $STATIC_LIBS_HOME/libnet.a | grep Inet6AddressImpl.c +export STATIC_LIBS_HOME=${top_dir_abs_staticlibs_build_path}/images/%{static_libs_image} +ls -l $STATIC_LIBS_HOME +ls -l $STATIC_LIBS_HOME/lib +readelf --debug-dump $STATIC_LIBS_HOME/lib/libnet.a | grep Inet4AddressImpl.c +readelf --debug-dump $STATIC_LIBS_HOME/lib/libnet.a | grep Inet6AddressImpl.c +%endif + +# Release builds strip the debug symbols into external .debuginfo files +if [ "x$suffix" = "x" ] ; then + so_suffix="debuginfo" +else + so_suffix="so" +fi +# Check debug symbols are present and can identify code +find "$JAVA_HOME" -iname "*.$so_suffix" -print0 | while read -d $'\0' lib +do + if [ -f "$lib" ] ; then + echo "Testing $lib for debug symbols" + # All these tests rely on RPM failing the build if the exit code of any set + # of piped commands is non-zero. + + # Test for .debug_* sections in the shared object. This is the main test + # Stripped objects will not contain these + eu-readelf -S "$lib" | grep "] .debug_" + test $(eu-readelf -S "$lib" | grep -E "\]\ .debug_(info|abbrev)" | wc --lines) == 2 + + # Test FILE symbols. These will most likely be removed by anything that + # manipulates symbol tables because it's generally useless. So a nice test + # that nothing has messed with symbols + old_IFS="$IFS" + IFS=$'\n' + for line in $(eu-readelf -s "$lib" | grep "00000000 0 FILE LOCAL DEFAULT") + do + # We expect to see .cpp and .S files, except for architectures like aarch64 and + # s390 where we expect .o and .oS files + echo "$line" | grep -E "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|S|oS))?$" + done + IFS="$old_IFS" + + # If this is the JVM, look for javaCalls.(cpp|o) in FILEs, for extra sanity checking + if [ "`basename $lib`" = "libjvm.so" ]; then + eu-readelf -s "$lib" | \ + grep -E "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" + fi + + # Test that there are no .gnu_debuglink sections pointing to another + # debuginfo file. There shouldn't be any debuginfo files, so the link makes + # no sense either + eu-readelf -S "$lib" | grep 'gnu' + if eu-readelf -S "$lib" | grep '] .gnu_debuglink' | grep PROGBITS; then + echo "bad .gnu_debuglink section." + eu-readelf -x .gnu_debuglink "$lib" + false + fi + fi +done + +# Make sure gdb can do a backtrace based on line numbers on libjvm.so +# javaCalls.cpp:58 should map to: +# http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/ff3b27e6bcc2/src/share/vm/runtime/javaCalls.cpp#l58 +# Using line number 1 might cause build problems. See: +# https://bugzilla.redhat.com/show_bug.cgi?id=1539664 +# https://bugzilla.redhat.com/show_bug.cgi?id=1538767 +gdb -q "$JAVA_HOME/bin/java" < - 1:21.0.1.0.12-2.rolling +- updated to OpenJDK 21.0.1 (2023-10-17) +- adjsuted generate_source_tarball +- removed icedtea_sync +- dropped standalone licenses +- added usntripped subpkg +- added docs subpkg +- adjsuted versions of bundled libraries +- build refactored to several solid methods following gnu_andrew +- removed no longer needed jdk8296108-tzdata2022f.patch, jdk8296715-cldr2022f.patch, rh1648644-java_access_bridge_privileged_security.patch +- added jdk8311630-s390_ffmapi.patch to support virtual threads on s390x +- aligned fips-21u-75ffdc48eda.patch (gnu_andrew) + * Wed Sep 20 2023 Jiri Vanek - 1:21.0.0.0.35-4.rolling - removed %{1} from miscportablename diff --git a/jconsole.desktop.in b/jconsole.desktop.in index 8a3b04d..c1b8f6a 100644 --- a/jconsole.desktop.in +++ b/jconsole.desktop.in @@ -1,10 +1 @@ -[Desktop Entry] -Name=OpenJDK @JAVA_VER@ for @target_cpu@ Monitoring & Management Console (@OPENJDK_VER@) -Comment=Monitor and manage OpenJDK applications -Exec=_SDKBINDIR_/jconsole -Icon=java-@JAVA_VER@-@JAVA_VENDOR@ -Terminal=false -Type=Application -StartupWMClass=sun-tools-jconsole-JConsole -Categories=Development;Profiling;Java; -Version=1.0 +# this file is intentionally not here, as portable builds do not have desktop integration diff --git a/jdk8296108-tzdata2022f.patch b/jdk8296108-tzdata2022f.patch deleted file mode 100644 index 8b13789..0000000 --- a/jdk8296108-tzdata2022f.patch +++ /dev/null @@ -1 +0,0 @@ - diff --git a/jdk8296715-cldr2022f.patch b/jdk8296715-cldr2022f.patch deleted file mode 100644 index 8b13789..0000000 --- a/jdk8296715-cldr2022f.patch +++ /dev/null @@ -1 +0,0 @@ - diff --git a/jdk8311630-s390_ffmapi.patch b/jdk8311630-s390_ffmapi.patch new file mode 100644 index 0000000..cd3bc08 --- /dev/null +++ b/jdk8311630-s390_ffmapi.patch @@ -0,0 +1,1906 @@ +commit 27f635fabe7c2933674ad40443906fc35eecf785 +Author: Sidraya Jayagond +Date: Tue Sep 12 09:07:09 2023 +0000 + + 8311630: [s390] Implementation of Foreign Function & Memory API (Preview) + + Backport-of: ec1f7a8480db025a6f405817a106af8e92b69c44 + +diff --git a/src/hotspot/cpu/s390/downcallLinker_s390.cpp b/src/hotspot/cpu/s390/downcallLinker_s390.cpp +index baee7d7a043..f831da90755 100644 +--- a/src/hotspot/cpu/s390/downcallLinker_s390.cpp ++++ b/src/hotspot/cpu/s390/downcallLinker_s390.cpp +@@ -23,8 +23,76 @@ + */ + + #include "precompiled.hpp" ++#include "asm/macroAssembler.inline.hpp" ++#include "code/codeBlob.hpp" ++#include "code/codeCache.hpp" ++#include "code/vmreg.inline.hpp" ++#include "compiler/oopMap.hpp" ++#include "logging/logStream.hpp" ++#include "memory/resourceArea.hpp" + #include "prims/downcallLinker.hpp" +-#include "utilities/debug.hpp" ++#include "runtime/globals.hpp" ++#include "runtime/stubCodeGenerator.hpp" ++ ++#define __ _masm-> ++ ++class DowncallStubGenerator : public StubCodeGenerator { ++ BasicType* _signature; ++ int _num_args; ++ BasicType _ret_bt; ++ const ABIDescriptor& _abi; ++ ++ const GrowableArray& _input_registers; ++ const GrowableArray& _output_registers; ++ ++ bool _needs_return_buffer; ++ int _captured_state_mask; ++ bool _needs_transition; ++ ++ int _frame_complete; ++ int _frame_size_slots; ++ OopMapSet* _oop_maps; ++ public: ++ DowncallStubGenerator(CodeBuffer* buffer, ++ BasicType* signature, ++ int num_args, ++ BasicType ret_bt, ++ const ABIDescriptor& abi, ++ const GrowableArray& input_registers, ++ const GrowableArray& output_registers, ++ bool needs_return_buffer, ++ int captured_state_mask, ++ bool needs_transition) ++ :StubCodeGenerator(buffer, PrintMethodHandleStubs), ++ _signature(signature), ++ _num_args(num_args), ++ _ret_bt(ret_bt), ++ _abi(abi), ++ _input_registers(input_registers), ++ _output_registers(output_registers), ++ _needs_return_buffer(needs_return_buffer), ++ _captured_state_mask(captured_state_mask), ++ _needs_transition(needs_transition), ++ _frame_complete(0), ++ _frame_size_slots(0), ++ _oop_maps(nullptr) { ++ } ++ void generate(); ++ int frame_complete() const { ++ return _frame_complete; ++ } ++ ++ int framesize() const { ++ return (_frame_size_slots >> (LogBytesPerWord - LogBytesPerInt)); ++ } ++ ++ OopMapSet* oop_maps() const { ++ return _oop_maps; ++ } ++}; ++ ++static const int native_invoker_code_base_size = 512; ++static const int native_invoker_size_per_args = 8; + + RuntimeStub* DowncallLinker::make_downcall_stub(BasicType* signature, + int num_args, +@@ -35,6 +103,197 @@ RuntimeStub* DowncallLinker::make_downcall_stub(BasicType* signature, + bool needs_return_buffer, + int captured_state_mask, + bool needs_transition) { +- Unimplemented(); +- return nullptr; ++ ++ int code_size = native_invoker_code_base_size + (num_args * native_invoker_size_per_args); ++ int locs_size = 1; //must be non zero ++ CodeBuffer code("nep_invoker_blob", code_size, locs_size); ++ ++ DowncallStubGenerator g(&code, signature, num_args, ret_bt, abi, ++ input_registers, output_registers, ++ needs_return_buffer, captured_state_mask, ++ needs_transition); ++ g.generate(); ++ code.log_section_sizes("nep_invoker_blob"); ++ ++ RuntimeStub* stub = ++ RuntimeStub::new_runtime_stub("nep_invoker_blob", ++ &code, ++ g.frame_complete(), ++ g.framesize(), ++ g.oop_maps(), false); ++ ++#ifndef PRODUCT ++ LogTarget(Trace, foreign, downcall) lt; ++ if (lt.is_enabled()) { ++ ResourceMark rm; ++ LogStream ls(lt); ++ stub->print_on(&ls); ++ } ++#endif ++ ++ return stub; ++} ++ ++void DowncallStubGenerator::generate() { ++ Register call_target_address = Z_R1_scratch, ++ tmp = Z_R0_scratch; ++ ++ VMStorage shuffle_reg = _abi._scratch1; ++ ++ JavaCallingConvention in_conv; ++ NativeCallingConvention out_conv(_input_registers); ++ ArgumentShuffle arg_shuffle(_signature, _num_args, _signature, _num_args, &in_conv, &out_conv, shuffle_reg); ++ ++#ifndef PRODUCT ++ LogTarget(Trace, foreign, downcall) lt; ++ if (lt.is_enabled()) { ++ ResourceMark rm; ++ LogStream ls(lt); ++ arg_shuffle.print_on(&ls); ++ } ++#endif ++ ++ assert(_abi._shadow_space_bytes == frame::z_abi_160_size, "expected space according to ABI"); ++ int allocated_frame_size = _abi._shadow_space_bytes; ++ allocated_frame_size += arg_shuffle.out_arg_bytes(); ++ ++ assert(!_needs_return_buffer, "unexpected needs_return_buffer"); ++ RegSpiller out_reg_spiller(_output_registers); ++ int spill_offset = allocated_frame_size; ++ allocated_frame_size += BytesPerWord; ++ ++ StubLocations locs; ++ locs.set(StubLocations::TARGET_ADDRESS, _abi._scratch2); ++ ++ if (_captured_state_mask != 0) { ++ __ block_comment("{ _captured_state_mask is set"); ++ locs.set_frame_data(StubLocations::CAPTURED_STATE_BUFFER, allocated_frame_size); ++ allocated_frame_size += BytesPerWord; ++ __ block_comment("} _captured_state_mask is set"); ++ } ++ ++ allocated_frame_size = align_up(allocated_frame_size, StackAlignmentInBytes); ++ _frame_size_slots = allocated_frame_size >> LogBytesPerInt; ++ ++ _oop_maps = _needs_transition ? new OopMapSet() : nullptr; ++ address start = __ pc(); ++ ++ __ save_return_pc(); ++ __ push_frame(allocated_frame_size, Z_R11); // Create a new frame for the wrapper. ++ ++ _frame_complete = __ pc() - start; // frame build complete. ++ ++ if (_needs_transition) { ++ __ block_comment("{ thread java2native"); ++ __ get_PC(Z_R1_scratch); ++ address the_pc = __ pc(); ++ __ set_last_Java_frame(Z_SP, Z_R1_scratch); ++ ++ OopMap* map = new OopMap(_frame_size_slots, 0); ++ _oop_maps->add_gc_map(the_pc - start, map); ++ ++ // State transition ++ __ set_thread_state(_thread_in_native); ++ __ block_comment("} thread java2native"); ++ } ++ __ block_comment("{ argument shuffle"); ++ arg_shuffle.generate(_masm, shuffle_reg, frame::z_jit_out_preserve_size, _abi._shadow_space_bytes, locs); ++ __ block_comment("} argument shuffle"); ++ ++ __ call(as_Register(locs.get(StubLocations::TARGET_ADDRESS))); ++ ++ ////////////////////////////////////////////////////////////////////////////// ++ ++ if (_captured_state_mask != 0) { ++ __ block_comment("{ save thread local"); ++ ++ out_reg_spiller.generate_spill(_masm, spill_offset); ++ ++ __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, DowncallLinker::capture_state)); ++ __ z_lg(Z_ARG1, Address(Z_SP, locs.data_offset(StubLocations::CAPTURED_STATE_BUFFER))); ++ __ load_const_optimized(Z_ARG2, _captured_state_mask); ++ __ call(call_target_address); ++ ++ out_reg_spiller.generate_fill(_masm, spill_offset); ++ ++ __ block_comment("} save thread local"); ++ } ++ ++ ////////////////////////////////////////////////////////////////////////////// ++ ++ Label L_after_safepoint_poll; ++ Label L_safepoint_poll_slow_path; ++ Label L_reguard; ++ Label L_after_reguard; ++ ++ if (_needs_transition) { ++ __ block_comment("{ thread native2java"); ++ __ set_thread_state(_thread_in_native_trans); ++ ++ if (!UseSystemMemoryBarrier) { ++ __ z_fence(); // Order state change wrt. safepoint poll. ++ } ++ ++ __ safepoint_poll(L_safepoint_poll_slow_path, tmp); ++ ++ __ load_and_test_int(tmp, Address(Z_thread, JavaThread::suspend_flags_offset())); ++ __ z_brne(L_safepoint_poll_slow_path); ++ ++ __ bind(L_after_safepoint_poll); ++ ++ // change thread state ++ __ set_thread_state(_thread_in_Java); ++ ++ __ block_comment("reguard stack check"); ++ __ z_cli(Address(Z_thread, JavaThread::stack_guard_state_offset() + in_ByteSize(sizeof(StackOverflow::StackGuardState) - 1)), ++ StackOverflow::stack_guard_yellow_reserved_disabled); ++ __ z_bre(L_reguard); ++ __ bind(L_after_reguard); ++ ++ __ reset_last_Java_frame(); ++ __ block_comment("} thread native2java"); ++ } ++ ++ __ pop_frame(); ++ __ restore_return_pc(); // This is the way back to the caller. ++ __ z_br(Z_R14); ++ ++ ////////////////////////////////////////////////////////////////////////////// ++ ++ if (_needs_transition) { ++ __ block_comment("{ L_safepoint_poll_slow_path"); ++ __ bind(L_safepoint_poll_slow_path); ++ ++ // Need to save the native result registers around any runtime calls. ++ out_reg_spiller.generate_spill(_masm, spill_offset); ++ ++ __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, JavaThread::check_special_condition_for_native_trans)); ++ __ z_lgr(Z_ARG1, Z_thread); ++ __ call(call_target_address); ++ ++ out_reg_spiller.generate_fill(_masm, spill_offset); ++ ++ __ z_bru(L_after_safepoint_poll); ++ __ block_comment("} L_safepoint_poll_slow_path"); ++ ++ ////////////////////////////////////////////////////////////////////////////// ++ __ block_comment("{ L_reguard"); ++ __ bind(L_reguard); ++ ++ // Need to save the native result registers around any runtime calls. ++ out_reg_spiller.generate_spill(_masm, spill_offset); ++ ++ __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, SharedRuntime::reguard_yellow_pages)); ++ __ call(call_target_address); ++ ++ out_reg_spiller.generate_fill(_masm, spill_offset); ++ ++ __ z_bru(L_after_reguard); ++ ++ __ block_comment("} L_reguard"); ++ } ++ ++ ////////////////////////////////////////////////////////////////////////////// ++ ++ __ flush(); + } +diff --git a/src/hotspot/cpu/s390/foreignGlobals_s390.cpp b/src/hotspot/cpu/s390/foreignGlobals_s390.cpp +index d3a318536bd..9796ab4ffe4 100644 +--- a/src/hotspot/cpu/s390/foreignGlobals_s390.cpp ++++ b/src/hotspot/cpu/s390/foreignGlobals_s390.cpp +@@ -23,34 +23,209 @@ + */ + + #include "precompiled.hpp" +-#include "code/vmreg.hpp" ++#include "asm/macroAssembler.inline.hpp" ++#include "code/vmreg.inline.hpp" ++#include "runtime/jniHandles.hpp" ++#include "runtime/jniHandles.inline.hpp" ++#include "oops/typeArrayOop.inline.hpp" ++#include "oops/oopCast.inline.hpp" + #include "prims/foreignGlobals.hpp" +-#include "utilities/debug.hpp" ++#include "prims/foreignGlobals.inline.hpp" ++#include "prims/vmstorage.hpp" ++#include "utilities/formatBuffer.hpp" + +-class MacroAssembler; ++#define __ masm-> ++ ++bool ABIDescriptor::is_volatile_reg(Register reg) const { ++ return _integer_volatile_registers.contains(reg); ++} ++ ++bool ABIDescriptor::is_volatile_reg(FloatRegister reg) const { ++ return _float_argument_registers.contains(reg) ++ || _float_additional_volatile_registers.contains(reg); ++} + + bool ForeignGlobals::is_foreign_linker_supported() { +- return false; ++ return true; + } + + const ABIDescriptor ForeignGlobals::parse_abi_descriptor(jobject jabi) { +- Unimplemented(); +- return {}; ++ oop abi_oop = JNIHandles::resolve_non_null(jabi); ++ ABIDescriptor abi; ++ ++ objArrayOop inputStorage = jdk_internal_foreign_abi_ABIDescriptor::inputStorage(abi_oop); ++ parse_register_array(inputStorage, StorageType::INTEGER, abi._integer_argument_registers, as_Register); ++ parse_register_array(inputStorage, StorageType::FLOAT, abi._float_argument_registers, as_FloatRegister); ++ ++ objArrayOop outputStorage = jdk_internal_foreign_abi_ABIDescriptor::outputStorage(abi_oop); ++ parse_register_array(outputStorage, StorageType::INTEGER, abi._integer_return_registers, as_Register); ++ parse_register_array(outputStorage, StorageType::FLOAT, abi._float_return_registers, as_FloatRegister); ++ ++ objArrayOop volatileStorage = jdk_internal_foreign_abi_ABIDescriptor::volatileStorage(abi_oop); ++ parse_register_array(volatileStorage, StorageType::INTEGER, abi._integer_volatile_registers, as_Register); ++ parse_register_array(volatileStorage, StorageType::FLOAT, abi._float_additional_volatile_registers, as_FloatRegister); ++ ++ abi._stack_alignment_bytes = jdk_internal_foreign_abi_ABIDescriptor::stackAlignment(abi_oop); ++ abi._shadow_space_bytes = jdk_internal_foreign_abi_ABIDescriptor::shadowSpace(abi_oop); ++ ++ abi._scratch1 = parse_vmstorage(jdk_internal_foreign_abi_ABIDescriptor::scratch1(abi_oop)); ++ abi._scratch2 = parse_vmstorage(jdk_internal_foreign_abi_ABIDescriptor::scratch2(abi_oop)); ++ ++ return abi; + } + + int RegSpiller::pd_reg_size(VMStorage reg) { +- Unimplemented(); +- return -1; ++ if (reg.type() == StorageType::INTEGER || reg.type() == StorageType::FLOAT) { ++ return 8; ++ } ++ return 0; // stack and BAD + } + + void RegSpiller::pd_store_reg(MacroAssembler* masm, int offset, VMStorage reg) { +- Unimplemented(); ++ if (reg.type() == StorageType::INTEGER) { ++ __ reg2mem_opt(as_Register(reg), Address(Z_SP, offset), true); ++ } else if (reg.type() == StorageType::FLOAT) { ++ __ freg2mem_opt(as_FloatRegister(reg), Address(Z_SP, offset), true); ++ } else { ++ // stack and BAD ++ } + } + + void RegSpiller::pd_load_reg(MacroAssembler* masm, int offset, VMStorage reg) { +- Unimplemented(); ++ if (reg.type() == StorageType::INTEGER) { ++ __ mem2reg_opt(as_Register(reg), Address(Z_SP, offset), true); ++ } else if (reg.type() == StorageType::FLOAT) { ++ __ mem2freg_opt(as_FloatRegister(reg), Address(Z_SP, offset), true); ++ } else { ++ // stack and BAD ++ } ++} ++ ++static int reg2offset(VMStorage vms, int stk_bias) { ++ assert(!vms.is_reg(), "wrong usage"); ++ return vms.index_or_offset() + stk_bias; ++} ++ ++static void move_reg(MacroAssembler* masm, int out_stk_bias, ++ VMStorage from_reg, VMStorage to_reg) { ++ int out_bias = 0; ++ switch (to_reg.type()) { ++ case StorageType::INTEGER: ++ if (to_reg.segment_mask() == REG64_MASK && from_reg.segment_mask() == REG32_MASK ) { ++ // see CCallingConventionRequiresIntsAsLongs ++ __ z_lgfr(as_Register(to_reg), as_Register(from_reg)); ++ } else { ++ __ lgr_if_needed(as_Register(to_reg), as_Register(from_reg)); ++ } ++ break; ++ case StorageType::STACK: ++ out_bias = out_stk_bias; //fallthrough ++ case StorageType::FRAME_DATA: { ++ // Integer types always get a 64 bit slot in C. ++ if (from_reg.segment_mask() == REG32_MASK) { ++ // see CCallingConventionRequiresIntsAsLongs ++ __ z_lgfr(as_Register(from_reg), as_Register(from_reg)); ++ } ++ switch (to_reg.stack_size()) { ++ case 8: __ reg2mem_opt(as_Register(from_reg), Address(Z_SP, reg2offset(to_reg, out_bias)), true); break; ++ case 4: __ reg2mem_opt(as_Register(from_reg), Address(Z_SP, reg2offset(to_reg, out_bias)), false); break; ++ default: ShouldNotReachHere(); ++ } ++ } break; ++ default: ShouldNotReachHere(); ++ } ++} ++ ++static void move_float(MacroAssembler* masm, int out_stk_bias, ++ VMStorage from_reg, VMStorage to_reg) { ++ switch (to_reg.type()) { ++ case StorageType::FLOAT: ++ if (from_reg.segment_mask() == REG64_MASK) ++ __ move_freg_if_needed(as_FloatRegister(to_reg), T_DOUBLE, as_FloatRegister(from_reg), T_DOUBLE); ++ else ++ __ move_freg_if_needed(as_FloatRegister(to_reg), T_FLOAT, as_FloatRegister(from_reg), T_FLOAT); ++ break; ++ case StorageType::STACK: ++ if (from_reg.segment_mask() == REG64_MASK) { ++ assert(to_reg.stack_size() == 8, "size should match"); ++ __ freg2mem_opt(as_FloatRegister(from_reg), Address(Z_SP, reg2offset(to_reg, out_stk_bias)), true); ++ } else { ++ assert(to_reg.stack_size() == 4, "size should match"); ++ __ freg2mem_opt(as_FloatRegister(from_reg), Address(Z_SP, reg2offset(to_reg, out_stk_bias)), false); ++ } ++ break; ++ default: ShouldNotReachHere(); ++ } ++} ++ ++static void move_stack(MacroAssembler* masm, Register tmp_reg, int in_stk_bias, int out_stk_bias, ++ VMStorage from_reg, VMStorage to_reg) { ++ int out_bias = 0; ++ Address from_addr(Z_R11, reg2offset(from_reg, in_stk_bias)); ++ switch (to_reg.type()) { ++ case StorageType::INTEGER: ++ switch (from_reg.stack_size()) { ++ case 8: __ mem2reg_opt(as_Register(to_reg), from_addr, true);break; ++ case 4: __ mem2reg_opt(as_Register(to_reg), from_addr, false);break; ++ default: ShouldNotReachHere(); ++ } ++ break; ++ case StorageType::FLOAT: ++ switch (from_reg.stack_size()) { ++ case 8: __ mem2freg_opt(as_FloatRegister(to_reg), from_addr, true);break; ++ case 4: __ mem2freg_opt(as_FloatRegister(to_reg), from_addr, false);break; ++ default: ShouldNotReachHere(); ++ } ++ break; ++ case StorageType::STACK: ++ out_bias = out_stk_bias; // fallthrough ++ case StorageType::FRAME_DATA: { ++ switch (from_reg.stack_size()) { ++ case 8: __ mem2reg_opt(tmp_reg, from_addr, true); break; ++ case 4: if (to_reg.stack_size() == 8) { ++ __ mem2reg_signed_opt(tmp_reg, from_addr); ++ } else { ++ __ mem2reg_opt(tmp_reg, from_addr, false); ++ } ++ break; ++ default: ShouldNotReachHere(); ++ } ++ switch (to_reg.stack_size()) { ++ case 8: __ reg2mem_opt(tmp_reg, Address (Z_SP, reg2offset(to_reg, out_bias)), true); break; ++ case 4: __ reg2mem_opt(tmp_reg, Address (Z_SP, reg2offset(to_reg, out_bias)), false); break; ++ default: ShouldNotReachHere(); ++ } ++ } break; ++ default: ShouldNotReachHere(); ++ } + } + + void ArgumentShuffle::pd_generate(MacroAssembler* masm, VMStorage tmp, int in_stk_bias, int out_stk_bias, const StubLocations& locs) const { +- Unimplemented(); ++ Register tmp_reg = as_Register(tmp); ++ for (int i = 0; i < _moves.length(); i++) { ++ Move move = _moves.at(i); ++ VMStorage from_reg = move.from; ++ VMStorage to_reg = move.to; ++ ++ // replace any placeholders ++ if (from_reg.type() == StorageType::PLACEHOLDER) { ++ from_reg = locs.get(from_reg); ++ } ++ if (to_reg.type() == StorageType::PLACEHOLDER) { ++ to_reg = locs.get(to_reg); ++ } ++ ++ switch (from_reg.type()) { ++ case StorageType::INTEGER: ++ move_reg(masm, out_stk_bias, from_reg, to_reg); ++ break; ++ case StorageType::FLOAT: ++ move_float(masm, out_stk_bias, from_reg, to_reg); ++ break; ++ case StorageType::STACK: ++ move_stack(masm, tmp_reg, in_stk_bias, out_stk_bias, from_reg, to_reg); ++ break; ++ default: ShouldNotReachHere(); ++ } ++ } + } +diff --git a/src/hotspot/cpu/s390/foreignGlobals_s390.hpp b/src/hotspot/cpu/s390/foreignGlobals_s390.hpp +index 8b86a2b06a6..4ff3b3e40b4 100644 +--- a/src/hotspot/cpu/s390/foreignGlobals_s390.hpp ++++ b/src/hotspot/cpu/s390/foreignGlobals_s390.hpp +@@ -24,6 +24,23 @@ + #ifndef CPU_S390_VM_FOREIGN_GLOBALS_S390_HPP + #define CPU_S390_VM_FOREIGN_GLOBALS_S390_HPP + +-class ABIDescriptor {}; ++struct ABIDescriptor { ++ GrowableArray _integer_argument_registers; ++ GrowableArray _integer_return_registers; ++ GrowableArray _float_argument_registers; ++ GrowableArray _float_return_registers; ++ ++ GrowableArray _integer_volatile_registers; ++ GrowableArray _float_additional_volatile_registers; ++ ++ int32_t _stack_alignment_bytes; ++ int32_t _shadow_space_bytes; ++ ++ VMStorage _scratch1; ++ VMStorage _scratch2; ++ ++ bool is_volatile_reg(Register reg) const; ++ bool is_volatile_reg(FloatRegister reg) const; ++}; + + #endif // CPU_S390_VM_FOREIGN_GLOBALS_S390_HPP +diff --git a/src/hotspot/cpu/s390/frame_s390.cpp b/src/hotspot/cpu/s390/frame_s390.cpp +index 23547fa6617..ac24e43f00c 100644 +--- a/src/hotspot/cpu/s390/frame_s390.cpp ++++ b/src/hotspot/cpu/s390/frame_s390.cpp +@@ -218,13 +218,32 @@ frame frame::sender_for_entry_frame(RegisterMap *map) const { + } + + UpcallStub::FrameData* UpcallStub::frame_data_for_frame(const frame& frame) const { +- ShouldNotCallThis(); +- return nullptr; ++ assert(frame.is_upcall_stub_frame(), "wrong frame"); ++ // need unextended_sp here, since normal sp is wrong for interpreter callees ++ return reinterpret_cast( ++ reinterpret_cast
(frame.unextended_sp()) + in_bytes(_frame_data_offset)); + } + + bool frame::upcall_stub_frame_is_first() const { +- ShouldNotCallThis(); +- return false; ++ assert(is_upcall_stub_frame(), "must be optimized entry frame"); ++ UpcallStub* blob = _cb->as_upcall_stub(); ++ JavaFrameAnchor* jfa = blob->jfa_for_frame(*this); ++ return jfa->last_Java_sp() == nullptr; ++} ++ ++frame frame::sender_for_upcall_stub_frame(RegisterMap* map) const { ++ assert(map != nullptr, "map must be set"); ++ UpcallStub* blob = _cb->as_upcall_stub(); ++ // Java frame called from C; skip all C frames and return top C ++ // frame of that chunk as the sender ++ JavaFrameAnchor* jfa = blob->jfa_for_frame(*this); ++ assert(!upcall_stub_frame_is_first(), "must have a frame anchor to go back to"); ++ assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack"); ++ map->clear(); ++ assert(map->include_argument_oops(), "should be set by clear"); ++ frame fr(jfa->last_Java_sp(), jfa->last_Java_pc()); ++ ++ return fr; + } + + frame frame::sender_for_interpreter_frame(RegisterMap *map) const { +diff --git a/src/hotspot/cpu/s390/frame_s390.inline.hpp b/src/hotspot/cpu/s390/frame_s390.inline.hpp +index dfa68940bac..c188618653d 100644 +--- a/src/hotspot/cpu/s390/frame_s390.inline.hpp ++++ b/src/hotspot/cpu/s390/frame_s390.inline.hpp +@@ -352,12 +352,10 @@ inline frame frame::sender(RegisterMap* map) const { + // update it accordingly. + map->set_include_argument_oops(false); + +- if (is_entry_frame()) { +- return sender_for_entry_frame(map); +- } +- if (is_interpreted_frame()) { +- return sender_for_interpreter_frame(map); +- } ++ if (is_entry_frame()) return sender_for_entry_frame(map); ++ if (is_upcall_stub_frame()) return sender_for_upcall_stub_frame(map); ++ if (is_interpreted_frame()) return sender_for_interpreter_frame(map); ++ + assert(_cb == CodeCache::find_blob(pc()),"Must be the same"); + if (_cb != nullptr) return sender_for_compiled_frame(map); + +diff --git a/src/hotspot/cpu/s390/globalDefinitions_s390.hpp b/src/hotspot/cpu/s390/globalDefinitions_s390.hpp +index 99906bb369e..2232215a587 100644 +--- a/src/hotspot/cpu/s390/globalDefinitions_s390.hpp ++++ b/src/hotspot/cpu/s390/globalDefinitions_s390.hpp +@@ -28,7 +28,7 @@ + + #define ShortenBranches true + +-const int StackAlignmentInBytes = 16; ++const int StackAlignmentInBytes = 8; + + #define SUPPORTS_NATIVE_CX8 + +diff --git a/src/hotspot/cpu/s390/methodHandles_s390.cpp b/src/hotspot/cpu/s390/methodHandles_s390.cpp +index 6392ba45a6c..ef8722f2499 100644 +--- a/src/hotspot/cpu/s390/methodHandles_s390.cpp ++++ b/src/hotspot/cpu/s390/methodHandles_s390.cpp +@@ -349,7 +349,16 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* + + void MethodHandles::jump_to_native_invoker(MacroAssembler* _masm, Register nep_reg, Register temp_target) { + BLOCK_COMMENT("jump_to_native_invoker {"); +- __ should_not_reach_here(); ++ assert(nep_reg != noreg, "required register"); ++ ++ // Load the invoker, as NEP -> .invoker ++ __ verify_oop(nep_reg); ++ ++ __ z_lg(temp_target, Address(nep_reg, ++ NONZERO(jdk_internal_foreign_abi_NativeEntryPoint::downcall_stub_address_offset_in_bytes()))); ++ ++ __ z_br(temp_target); ++ + BLOCK_COMMENT("} jump_to_native_invoker"); + } + +diff --git a/src/hotspot/cpu/s390/upcallLinker_s390.cpp b/src/hotspot/cpu/s390/upcallLinker_s390.cpp +index 3e1fb04218b..b748ec547cc 100644 +--- a/src/hotspot/cpu/s390/upcallLinker_s390.cpp ++++ b/src/hotspot/cpu/s390/upcallLinker_s390.cpp +@@ -22,15 +22,287 @@ + */ + + #include "precompiled.hpp" ++#include "asm/macroAssembler.inline.hpp" ++#include "logging/logStream.hpp" ++#include "memory/resourceArea.hpp" + #include "prims/upcallLinker.hpp" +-#include "utilities/debug.hpp" ++#include "runtime/sharedRuntime.hpp" ++#include "runtime/signature.hpp" ++#include "runtime/stubRoutines.hpp" ++#include "utilities/formatBuffer.hpp" ++#include "utilities/globalDefinitions.hpp" + ++#define __ _masm-> ++ ++// for callee saved regs, according to the caller's ABI ++static int compute_reg_save_area_size(const ABIDescriptor& abi) { ++ int size = 0; ++ for (int i = 0; i < Register::number_of_registers; i++) { ++ Register reg = as_Register(i); ++ // Z_SP saved/restored by prologue/epilogue ++ if (reg == Z_SP) continue; ++ if (!abi.is_volatile_reg(reg)) { ++ size += 8; // bytes ++ } ++ } ++ ++ for (int i = 0; i < FloatRegister::number_of_registers; i++) { ++ FloatRegister reg = as_FloatRegister(i); ++ if (!abi.is_volatile_reg(reg)) { ++ size += 8; // bytes ++ } ++ } ++ ++ return size; ++} ++ ++static void preserve_callee_saved_registers(MacroAssembler* _masm, const ABIDescriptor& abi, int reg_save_area_offset) { ++ // 1. iterate all registers in the architecture ++ // - check if they are volatile or not for the given abi ++ // - if NOT, we need to save it here ++ ++ int offset = reg_save_area_offset; ++ ++ __ block_comment("{ preserve_callee_saved_regs "); ++ for (int i = 0; i < Register::number_of_registers; i++) { ++ Register reg = as_Register(i); ++ // Z_SP saved/restored by prologue/epilogue ++ if (reg == Z_SP) continue; ++ if (!abi.is_volatile_reg(reg)) { ++ __ z_stg(reg, Address(Z_SP, offset)); ++ offset += 8; ++ } ++ } ++ ++ for (int i = 0; i < FloatRegister::number_of_registers; i++) { ++ FloatRegister reg = as_FloatRegister(i); ++ if (!abi.is_volatile_reg(reg)) { ++ __ z_std(reg, Address(Z_SP, offset)); ++ offset += 8; ++ } ++ } ++ ++ __ block_comment("} preserve_callee_saved_regs "); ++} ++ ++static void restore_callee_saved_registers(MacroAssembler* _masm, const ABIDescriptor& abi, int reg_save_area_offset) { ++ // 1. iterate all registers in the architecture ++ // - check if they are volatile or not for the given abi ++ // - if NOT, we need to restore it here ++ ++ int offset = reg_save_area_offset; ++ ++ __ block_comment("{ restore_callee_saved_regs "); ++ for (int i = 0; i < Register::number_of_registers; i++) { ++ Register reg = as_Register(i); ++ // Z_SP saved/restored by prologue/epilogue ++ if (reg == Z_SP) continue; ++ if (!abi.is_volatile_reg(reg)) { ++ __ z_lg(reg, Address(Z_SP, offset)); ++ offset += 8; ++ } ++ } ++ ++ for (int i = 0; i < FloatRegister::number_of_registers; i++) { ++ FloatRegister reg = as_FloatRegister(i); ++ if (!abi.is_volatile_reg(reg)) { ++ __ z_ld(reg, Address(Z_SP, offset)); ++ offset += 8; ++ } ++ } ++ ++ __ block_comment("} restore_callee_saved_regs "); ++} ++ ++static const int upcall_stub_code_base_size = 1024; // depends on GC (resolve_jobject) ++static const int upcall_stub_size_per_arg = 16; // arg save & restore + move + address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, + BasicType* in_sig_bt, int total_in_args, + BasicType* out_sig_bt, int total_out_args, + BasicType ret_type, + jobject jabi, jobject jconv, + bool needs_return_buffer, int ret_buf_size) { +- ShouldNotCallThis(); +- return nullptr; ++ ResourceMark rm; ++ const ABIDescriptor abi = ForeignGlobals::parse_abi_descriptor(jabi); ++ const CallRegs call_regs = ForeignGlobals::parse_call_regs(jconv); ++ int code_size = upcall_stub_code_base_size + (total_in_args * upcall_stub_size_per_arg); ++ CodeBuffer buffer("upcall_stub", code_size, /* locs_size = */ 0); ++ ++ Register call_target_address = Z_R1_scratch; ++ ++ VMStorage shuffle_reg = abi._scratch1; ++ JavaCallingConvention out_conv; ++ NativeCallingConvention in_conv(call_regs._arg_regs); ++ ArgumentShuffle arg_shuffle(in_sig_bt, total_in_args, out_sig_bt, total_out_args, &in_conv, &out_conv, shuffle_reg); ++ ++ // The Java call uses the JIT ABI, but we also call C. ++ int out_arg_area = MAX2(frame::z_jit_out_preserve_size + arg_shuffle.out_arg_bytes(), (int)frame::z_abi_160_size); ++ ++#ifndef PRODUCT ++ LogTarget(Trace, foreign, upcall) lt; ++ if (lt.is_enabled()) { ++ ResourceMark rm; ++ LogStream ls(lt); ++ arg_shuffle.print_on(&ls); ++ } ++#endif ++ ++ ++ int reg_save_area_size = compute_reg_save_area_size(abi); ++ RegSpiller arg_spiller(call_regs._arg_regs); ++ RegSpiller result_spiller(call_regs._ret_regs); ++ ++ int res_save_area_offset = out_arg_area; ++ int arg_save_area_offset = res_save_area_offset + result_spiller.spill_size_bytes(); ++ int reg_save_area_offset = arg_save_area_offset + arg_spiller.spill_size_bytes(); ++ int frame_data_offset = reg_save_area_offset + reg_save_area_size; ++ int frame_bottom_offset = frame_data_offset + sizeof(UpcallStub::FrameData); ++ ++ int frame_size = align_up(frame_bottom_offset, StackAlignmentInBytes); ++ StubLocations locs; ++ ++ // The space we have allocated will look like: ++ // ++ // ++ // FP-> | | ++ // |---------------------| = frame_bottom_offset = frame_size ++ // | | ++ // | FrameData | ++ // |---------------------| = frame_data_offset ++ // | | ++ // | reg_save_area | ++ // |---------------------| = reg_save_are_offset ++ // | | ++ // | arg_save_area | ++ // |---------------------| = arg_save_are_offset ++ // | | ++ // | res_save_area | ++ // |---------------------| = res_save_are_offset ++ // | | ++ // SP-> | out_arg_area | needs to be at end for shadow space ++ // ++ // ++ ++ ////////////////////////////////////////////////////////////////////////////// ++ ++ MacroAssembler* _masm = new MacroAssembler(&buffer); ++ address start = __ pc(); ++ ++ __ save_return_pc(); ++ assert((abi._stack_alignment_bytes % StackAlignmentInBytes) == 0, "must be 8 byte aligned"); ++ // allocate frame (frame_size is also aligned, so stack is still aligned) ++ __ push_frame(frame_size); ++ ++ // we have to always spill args since we need to do a call to get the thread ++ // (and maybe attach it). ++ arg_spiller.generate_spill(_masm, arg_save_area_offset); ++ // Java methods won't preserve them, so save them here: ++ preserve_callee_saved_registers(_masm, abi, reg_save_area_offset); ++ ++ __ block_comment("{ on_entry"); ++ __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, UpcallLinker::on_entry)); ++ __ z_aghik(Z_ARG1, Z_SP, frame_data_offset); ++ __ call(call_target_address); ++ __ z_lgr(Z_thread, Z_RET); ++ __ block_comment("} on_entry"); ++ ++ arg_spiller.generate_fill(_masm, arg_save_area_offset); ++ __ block_comment("{ argument shuffle"); ++ arg_shuffle.generate(_masm, shuffle_reg, abi._shadow_space_bytes, frame::z_jit_out_preserve_size, locs); ++ __ block_comment("} argument shuffle"); ++ ++ __ block_comment("{ receiver "); ++ __ load_const_optimized(Z_ARG1, (intptr_t)receiver); ++ __ resolve_jobject(Z_ARG1, Z_tmp_1, Z_tmp_2); ++ __ block_comment("} receiver "); ++ ++ __ load_const_optimized(Z_method, (intptr_t)entry); ++ __ z_stg(Z_method, Address(Z_thread, in_bytes(JavaThread::callee_target_offset()))); ++ ++ __ z_lg(call_target_address, Address(Z_method, in_bytes(Method::from_compiled_offset()))); ++ __ call(call_target_address); ++ ++ // return value shuffle ++ assert(!needs_return_buffer, "unexpected needs_return_buffer"); ++ // CallArranger can pick a return type that goes in the same reg for both CCs. ++ if (call_regs._ret_regs.length() > 0) { // 0 or 1 ++ VMStorage ret_reg = call_regs._ret_regs.at(0); ++ // Check if the return reg is as expected. ++ switch (ret_type) { ++ case T_BOOLEAN: ++ case T_BYTE: ++ case T_SHORT: ++ case T_CHAR: ++ case T_INT: ++ __ z_lgfr(Z_RET, Z_RET); // Clear garbage in high half. ++ // fallthrough ++ case T_LONG: ++ assert(as_Register(ret_reg) == Z_RET, "unexpected result register"); ++ break; ++ case T_FLOAT: ++ case T_DOUBLE: ++ assert(as_FloatRegister(ret_reg) == Z_FRET, "unexpected result register"); ++ break; ++ default: ++ fatal("unexpected return type: %s", type2name(ret_type)); ++ } ++ } ++ ++ result_spiller.generate_spill(_masm, res_save_area_offset); ++ ++ __ block_comment("{ on_exit"); ++ __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, UpcallLinker::on_exit)); ++ __ z_aghik(Z_ARG1, Z_SP, frame_data_offset); ++ __ call(call_target_address); ++ __ block_comment("} on_exit"); ++ ++ restore_callee_saved_registers(_masm, abi, reg_save_area_offset); ++ ++ result_spiller.generate_fill(_masm, res_save_area_offset); ++ ++ __ pop_frame(); ++ __ restore_return_pc(); ++ __ z_br(Z_R14); ++ ++ ////////////////////////////////////////////////////////////////////////////// ++ ++ __ block_comment("{ exception handler"); ++ ++ intptr_t exception_handler_offset = __ pc() - start; ++ ++ // Native caller has no idea how to handle exceptions, ++ // so we just crash here. Up to callee to catch exceptions. ++ __ verify_oop(Z_ARG1); ++ __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, UpcallLinker::handle_uncaught_exception)); ++ __ call_c(call_target_address); ++ __ should_not_reach_here(); ++ ++ __ block_comment("} exception handler"); ++ ++ _masm->flush(); ++ ++#ifndef PRODUCT ++ stringStream ss; ++ ss.print("upcall_stub_%s", entry->signature()->as_C_string()); ++ const char* name = _masm->code_string(ss.as_string()); ++#else // PRODUCT ++ const char* name = "upcall_stub"; ++#endif // PRODUCT ++ ++ buffer.log_section_sizes(name); ++ UpcallStub* blob ++ = UpcallStub::create(name, ++ &buffer, ++ exception_handler_offset, ++ receiver, ++ in_ByteSize(frame_data_offset)); ++#ifndef PRODUCT ++ if (lt.is_enabled()) { ++ ResourceMark rm; ++ LogStream ls(lt); ++ blob->print_on(&ls); ++ } ++#endif ++ ++ return blob->code_begin(); + } +diff --git a/src/hotspot/cpu/s390/vmstorage_s390.hpp b/src/hotspot/cpu/s390/vmstorage_s390.hpp +index 192159adc4c..6a595670920 100644 +--- a/src/hotspot/cpu/s390/vmstorage_s390.hpp ++++ b/src/hotspot/cpu/s390/vmstorage_s390.hpp +@@ -29,24 +29,79 @@ + #include "asm/register.hpp" + + enum class StorageType : int8_t { +- STACK = 0, +- PLACEHOLDER = 1, +-// special locations used only by native code +- FRAME_DATA = PLACEHOLDER + 1, ++ INTEGER = 0, ++ FLOAT = 1, ++ STACK = 2, ++ PLACEHOLDER = 3, ++ // special locations used only by native code ++ FRAME_DATA = 4, + INVALID = -1 + }; + + // need to define this before constructing VMStorage (below) + constexpr inline bool VMStorage::is_reg(StorageType type) { +- return false; ++ return type == StorageType::INTEGER || type == StorageType::FLOAT; + } + constexpr inline StorageType VMStorage::stack_type() { return StorageType::STACK; } + constexpr inline StorageType VMStorage::placeholder_type() { return StorageType::PLACEHOLDER; } + constexpr inline StorageType VMStorage::frame_data_type() { return StorageType::FRAME_DATA; } + ++// Needs to be consistent with S390Architecture.java. ++constexpr uint16_t REG32_MASK = 0b0000000000000001; ++constexpr uint16_t REG64_MASK = 0b0000000000000011; ++ ++inline Register as_Register(VMStorage vms) { ++ assert(vms.type() == StorageType::INTEGER, "not the right type"); ++ return ::as_Register(vms.index()); ++} ++ ++inline FloatRegister as_FloatRegister(VMStorage vms) { ++ assert(vms.type() == StorageType::FLOAT, "not the right type"); ++ return ::as_FloatRegister(vms.index()); ++} ++ ++inline VMStorage as_VMStorage(Register reg, uint16_t segment_mask = REG64_MASK) { ++ return VMStorage::reg_storage(StorageType::INTEGER, segment_mask, reg->encoding()); ++} ++ ++inline VMStorage as_VMStorage(FloatRegister reg, uint16_t segment_mask = REG64_MASK) { ++ return VMStorage::reg_storage(StorageType::FLOAT, segment_mask, reg->encoding()); ++} ++ + inline VMStorage as_VMStorage(VMReg reg, BasicType bt) { ++ if (reg->is_Register()) { ++ uint16_t segment_mask = 0; ++ switch (bt) { ++ case T_BOOLEAN: ++ case T_CHAR : ++ case T_BYTE : ++ case T_SHORT : ++ case T_INT : segment_mask = REG32_MASK; break; ++ default : segment_mask = REG64_MASK; break; ++ } ++ return as_VMStorage(reg->as_Register(), segment_mask); ++ } else if (reg->is_FloatRegister()) { ++ // FP regs always use double format. However, we need the correct format for loads /stores. ++ return as_VMStorage(reg->as_FloatRegister(), (bt == T_FLOAT) ? REG32_MASK : REG64_MASK); ++ } else if (reg->is_stack()) { ++ uint16_t size = 0; ++ switch (bt) { ++ case T_BOOLEAN: ++ case T_CHAR : ++ case T_BYTE : ++ case T_SHORT : ++ case T_INT : ++ case T_FLOAT : size = 4; break; ++ default : size = 8; break; ++ } ++ return VMStorage(StorageType::STACK, size, ++ checked_cast(reg->reg2stack() * VMRegImpl::stack_slot_size)); ++ } else if (!reg->is_valid()) { ++ return VMStorage::invalid(); ++ } ++ + ShouldNotReachHere(); + return VMStorage::invalid(); + } + +-#endif // CPU_S390_VMSTORAGE_S390_INLINE_HPP +\ No newline at end of file ++#endif // CPU_S390_VMSTORAGE_S390_INLINE_HPP +diff --git a/src/java.base/share/classes/jdk/internal/foreign/CABI.java b/src/java.base/share/classes/jdk/internal/foreign/CABI.java +index eee4ae67457..d376a196333 100644 +--- a/src/java.base/share/classes/jdk/internal/foreign/CABI.java ++++ b/src/java.base/share/classes/jdk/internal/foreign/CABI.java +@@ -41,6 +41,7 @@ public enum CABI { + WIN_AARCH_64, + LINUX_PPC_64_LE, + LINUX_RISCV_64, ++ LINUX_S390, + FALLBACK, + UNSUPPORTED; + +@@ -81,7 +82,11 @@ public enum CABI { + if (OperatingSystem.isLinux()) { + return LINUX_RISCV_64; + } +- } ++ } else if (arch.equals("s390x")) { ++ if (OperatingSystem.isLinux()) { ++ return LINUX_S390; ++ } ++ } + } else if (FallbackLinker.isSupported()) { + return FALLBACK; // fallback linker + } +diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java b/src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java +index b5eb1029ff5..8a322cdcf7a 100644 +--- a/src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java ++++ b/src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java +@@ -32,6 +32,7 @@ import jdk.internal.foreign.abi.aarch64.windows.WindowsAArch64Linker; + import jdk.internal.foreign.abi.fallback.FallbackLinker; + import jdk.internal.foreign.abi.ppc64.linux.LinuxPPC64leLinker; + import jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64Linker; ++import jdk.internal.foreign.abi.s390.linux.LinuxS390Linker; + import jdk.internal.foreign.abi.x64.sysv.SysVx64Linker; + import jdk.internal.foreign.abi.x64.windows.Windowsx64Linker; + import jdk.internal.foreign.layout.AbstractLayout; +@@ -60,7 +61,8 @@ import java.util.Set; + public abstract sealed class AbstractLinker implements Linker permits LinuxAArch64Linker, MacOsAArch64Linker, + SysVx64Linker, WindowsAArch64Linker, + Windowsx64Linker, LinuxPPC64leLinker, +- LinuxRISCV64Linker, FallbackLinker { ++ LinuxRISCV64Linker, LinuxS390Linker, ++ FallbackLinker { + + public interface UpcallStubFactory { + MemorySegment makeStub(MethodHandle target, Arena arena); +diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java b/src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java +index 1e417245543..92d10a1dbdf 100644 +--- a/src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java ++++ b/src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java +@@ -35,6 +35,7 @@ import jdk.internal.foreign.abi.aarch64.windows.WindowsAArch64Linker; + import jdk.internal.foreign.abi.fallback.FallbackLinker; + import jdk.internal.foreign.abi.ppc64.linux.LinuxPPC64leLinker; + import jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64Linker; ++import jdk.internal.foreign.abi.s390.linux.LinuxS390Linker; + import jdk.internal.foreign.abi.x64.sysv.SysVx64Linker; + import jdk.internal.foreign.abi.x64.windows.Windowsx64Linker; + import jdk.internal.vm.annotation.ForceInline; +@@ -242,6 +243,7 @@ public final class SharedUtils { + case WIN_AARCH_64 -> WindowsAArch64Linker.getInstance(); + case LINUX_PPC_64_LE -> LinuxPPC64leLinker.getInstance(); + case LINUX_RISCV_64 -> LinuxRISCV64Linker.getInstance(); ++ case LINUX_S390 -> LinuxS390Linker.getInstance(); + case FALLBACK -> FallbackLinker.getInstance(); + case UNSUPPORTED -> throw new UnsupportedOperationException("Platform does not support native linker"); + }; +diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/s390/S390Architecture.java b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/S390Architecture.java +new file mode 100644 +index 00000000000..bbafef2f3dc +--- /dev/null ++++ b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/S390Architecture.java +@@ -0,0 +1,151 @@ ++/* ++ * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2023 IBM Corp. 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. ++ */ ++package jdk.internal.foreign.abi.s390; ++ ++import jdk.internal.foreign.abi.ABIDescriptor; ++import jdk.internal.foreign.abi.Architecture; ++import jdk.internal.foreign.abi.StubLocations; ++import jdk.internal.foreign.abi.VMStorage; ++ ++public final class S390Architecture implements Architecture { ++ public static final Architecture INSTANCE = new S390Architecture(); ++ ++ // Needs to be consistent with vmstorage_s390.hpp. ++ public static final short REG32_MASK = 0b0000_0000_0000_0001; ++ public static final short REG64_MASK = 0b0000_0000_0000_0011; ++ ++ private static final int INTEGER_REG_SIZE = 8; ++ private static final int FLOAT_REG_SIZE = 8; ++ private static final int STACK_SLOT_SIZE = 8; ++ ++ // Suppresses default constructor, ensuring non-instantiability. ++ private S390Architecture() { ++ } ++ ++ @Override ++ public boolean isStackType(int cls) { ++ return cls == StorageType.STACK; ++ } ++ ++ @Override ++ public int typeSize(int cls) { ++ switch (cls) { ++ case StorageType.INTEGER: ++ return INTEGER_REG_SIZE; ++ case StorageType.FLOAT: ++ return FLOAT_REG_SIZE; ++ // STACK is deliberately omitted ++ } ++ ++ throw new IllegalArgumentException("Invalid Storage Class: " + cls); ++ } ++ ++ public interface StorageType { ++ byte INTEGER = 0; ++ byte FLOAT = 1; ++ byte STACK = 2; ++ byte PLACEHOLDER = 3; ++ } ++ ++ public static class Regs { // break circular dependency ++ public static final VMStorage r0 = integerRegister(0); ++ public static final VMStorage r1 = integerRegister(1); ++ public static final VMStorage r2 = integerRegister(2); ++ public static final VMStorage r3 = integerRegister(3); ++ public static final VMStorage r4 = integerRegister(4); ++ public static final VMStorage r5 = integerRegister(5); ++ public static final VMStorage r6 = integerRegister(6); ++ public static final VMStorage r7 = integerRegister(7); ++ public static final VMStorage r8 = integerRegister(8); ++ public static final VMStorage r9 = integerRegister(9); ++ public static final VMStorage r10 = integerRegister(10); ++ public static final VMStorage r11 = integerRegister(11); ++ public static final VMStorage r12 = integerRegister(12); ++ public static final VMStorage r13 = integerRegister(13); ++ public static final VMStorage r14 = integerRegister(14); ++ public static final VMStorage r15 = integerRegister(15); ++ ++ public static final VMStorage f0 = floatRegister(0); ++ public static final VMStorage f1 = floatRegister(1); ++ public static final VMStorage f2 = floatRegister(2); ++ public static final VMStorage f3 = floatRegister(3); ++ public static final VMStorage f4 = floatRegister(4); ++ public static final VMStorage f5 = floatRegister(5); ++ public static final VMStorage f6 = floatRegister(6); ++ public static final VMStorage f7 = floatRegister(7); ++ public static final VMStorage f8 = floatRegister(8); ++ public static final VMStorage f9 = floatRegister(9); ++ public static final VMStorage f10 = floatRegister(10); ++ public static final VMStorage f11 = floatRegister(11); ++ public static final VMStorage f12 = floatRegister(12); ++ public static final VMStorage f13 = floatRegister(13); ++ public static final VMStorage f14 = floatRegister(14); ++ public static final VMStorage f15 = floatRegister(15); ++ } ++ ++ private static VMStorage integerRegister(int index) { ++ return new VMStorage(StorageType.INTEGER, REG64_MASK, index, "r" + index); ++ } ++ ++ private static VMStorage floatRegister(int index) { ++ return new VMStorage(StorageType.FLOAT, REG64_MASK, index, "f" + index); ++ } ++ ++ public static VMStorage stackStorage(short size, int byteOffset) { ++ return new VMStorage(StorageType.STACK, size, byteOffset); ++ } ++ ++ public static ABIDescriptor abiFor(VMStorage[] inputIntRegs, ++ VMStorage[] inputFloatRegs, ++ VMStorage[] outputIntRegs, ++ VMStorage[] outputFloatRegs, ++ VMStorage[] volatileIntRegs, ++ VMStorage[] volatileFloatRegs, ++ int stackAlignment, ++ int shadowSpace, ++ VMStorage scratch1, VMStorage scratch2) { ++ return new ABIDescriptor( ++ INSTANCE, ++ new VMStorage[][] { ++ inputIntRegs, ++ inputFloatRegs, ++ }, ++ new VMStorage[][] { ++ outputIntRegs, ++ outputFloatRegs, ++ }, ++ new VMStorage[][] { ++ volatileIntRegs, ++ volatileFloatRegs, ++ }, ++ stackAlignment, ++ shadowSpace, ++ scratch1, scratch2, ++ StubLocations.TARGET_ADDRESS.storage(StorageType.PLACEHOLDER), ++ StubLocations.RETURN_BUFFER.storage(StorageType.PLACEHOLDER), ++ StubLocations.CAPTURED_STATE_BUFFER.storage(StorageType.PLACEHOLDER)); ++ } ++} +diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390CallArranger.java b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390CallArranger.java +new file mode 100644 +index 00000000000..84392e45089 +--- /dev/null ++++ b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390CallArranger.java +@@ -0,0 +1,311 @@ ++/* ++ * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2023 IBM Corp. 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. ++ */ ++package jdk.internal.foreign.abi.s390.linux; ++ ++import java.lang.foreign.AddressLayout; ++import java.lang.foreign.FunctionDescriptor; ++import java.lang.foreign.GroupLayout; ++import java.lang.foreign.MemoryLayout; ++import java.lang.foreign.MemorySegment; ++import jdk.internal.foreign.abi.ABIDescriptor; ++import jdk.internal.foreign.abi.AbstractLinker.UpcallStubFactory; ++import jdk.internal.foreign.abi.Binding; ++import jdk.internal.foreign.abi.CallingSequence; ++import jdk.internal.foreign.abi.CallingSequenceBuilder; ++import jdk.internal.foreign.abi.DowncallLinker; ++import jdk.internal.foreign.abi.LinkerOptions; ++import jdk.internal.foreign.abi.UpcallLinker; ++import jdk.internal.foreign.abi.SharedUtils; ++import jdk.internal.foreign.abi.VMStorage; ++import jdk.internal.foreign.Utils; ++ ++import java.lang.foreign.ValueLayout; ++import java.lang.invoke.MethodHandle; ++import java.lang.invoke.MethodType; ++import java.util.List; ++import java.util.Map; ++import java.util.Optional; ++ ++import static jdk.internal.foreign.abi.s390.linux.TypeClass.*; ++import static jdk.internal.foreign.abi.s390.S390Architecture.*; ++import static jdk.internal.foreign.abi.s390.S390Architecture.Regs.*; ++ ++/** ++ * For the S390 C ABI specifically, this class uses CallingSequenceBuilder ++ * to translate a C FunctionDescriptor into a CallingSequence, which can then be turned into a MethodHandle. ++ * ++ * This includes taking care of synthetic arguments like pointers to return buffers for 'in-memory' returns. ++ */ ++public class LinuxS390CallArranger { ++ ++ private static final int STACK_SLOT_SIZE = 8; ++ public static final int MAX_REGISTER_ARGUMENTS = 5; ++ public static final int MAX_FLOAT_REGISTER_ARGUMENTS = 4; ++ ++ private static final ABIDescriptor CLinux = abiFor( ++ new VMStorage[] { r2, r3, r4, r5, r6, }, // GP input ++ new VMStorage[] { f0, f2, f4, f6 }, // FP input ++ new VMStorage[] { r2, }, // GP output ++ new VMStorage[] { f0, }, // FP output ++ new VMStorage[] { r0, r1, r2, r3, r4, r5, r14 }, // volatile GP ++ new VMStorage[] { f1, f3, f5, f7 }, // volatile FP (excluding argument registers) ++ 8, // Stack is always 8 byte aligned on S390 ++ 160, // ABI header ++ r0, r1 // scratch reg r0 & r1 ++ ); ++ ++ public record Bindings(CallingSequence callingSequence, boolean isInMemoryReturn) {} ++ ++ public static Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall) { ++ return getBindings(mt, cDesc, forUpcall, LinkerOptions.empty()); ++ } ++ ++ public static Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall, LinkerOptions options) { ++ CallingSequenceBuilder csb = new CallingSequenceBuilder(CLinux, forUpcall, options); ++ ++ BindingCalculator argCalc = forUpcall ? new BoxBindingCalculator(true) : new UnboxBindingCalculator(true); ++ BindingCalculator retCalc = forUpcall ? new UnboxBindingCalculator(false) : new BoxBindingCalculator(false); ++ ++ boolean returnInMemory = isInMemoryReturn(cDesc.returnLayout()); ++ if (returnInMemory) { ++ Class carrier = MemorySegment.class; ++ MemoryLayout layout =SharedUtils.C_POINTER; ++ csb.addArgumentBindings(carrier, layout, argCalc.getBindings(carrier, layout)); ++ } else if (cDesc.returnLayout().isPresent()) { ++ Class carrier = mt.returnType(); ++ MemoryLayout layout = cDesc.returnLayout().get(); ++ csb.setReturnBindings(carrier, layout, retCalc.getBindings(carrier, layout)); ++ } ++ ++ for (int i = 0; i < mt.parameterCount(); i++) { ++ Class carrier = mt.parameterType(i); ++ MemoryLayout layout = cDesc.argumentLayouts().get(i); ++ csb.addArgumentBindings(carrier, layout, argCalc.getBindings(carrier, layout)); ++ } ++ ++ return new Bindings(csb.build(), returnInMemory); ++ } ++ ++ public static MethodHandle arrangeDowncall(MethodType mt, FunctionDescriptor cDesc, LinkerOptions options) { ++ Bindings bindings = getBindings(mt, cDesc, false, options); ++ ++ MethodHandle handle = new DowncallLinker(CLinux, bindings.callingSequence).getBoundMethodHandle(); ++ ++ if (bindings.isInMemoryReturn) { ++ handle = SharedUtils.adaptDowncallForIMR(handle, cDesc, bindings.callingSequence); ++ } ++ ++ return handle; ++ } ++ ++ public static UpcallStubFactory arrangeUpcall(MethodType mt, FunctionDescriptor cDesc, LinkerOptions options) { ++ Bindings bindings = getBindings(mt, cDesc, true, options); ++ ++ final boolean dropReturn = true; /* drop return, since we don't have bindings for it */ ++ return SharedUtils.arrangeUpcallHelper(mt, bindings.isInMemoryReturn, dropReturn, CLinux, ++ bindings.callingSequence); ++ } ++ ++ private static boolean isInMemoryReturn(Optional returnLayout) { ++ return returnLayout ++ .filter(layout -> layout instanceof GroupLayout) ++ .isPresent(); ++ } ++ ++ static class StorageCalculator { ++ private final boolean forArguments; ++ ++ private final int[] nRegs = new int[] { 0, 0 }; ++ private long stackOffset = 0; ++ ++ public StorageCalculator(boolean forArguments) { ++ this.forArguments = forArguments; ++ } ++ ++ VMStorage stackAlloc(long size, long alignment) { ++ long alignedStackOffset = Utils.alignUp(stackOffset, alignment); ++ ++ short encodedSize = (short) size; ++ assert (encodedSize & 0xFFFF) == size; ++ ++ VMStorage storage = stackStorage(encodedSize, (int) alignedStackOffset); ++ stackOffset = alignedStackOffset + size; ++ return storage; ++ } ++ ++ VMStorage regAlloc(int type) { ++ int gpRegCnt = (type == StorageType.INTEGER) ? 1 : 0; ++ int fpRegCnt = (type == StorageType.FLOAT) ? 1 : 0; ++ ++ // Use stack if not enough registers available. ++ if ((type == StorageType.FLOAT && (nRegs[StorageType.FLOAT] + fpRegCnt) > MAX_FLOAT_REGISTER_ARGUMENTS) ++ || (type == StorageType.INTEGER && (nRegs[StorageType.INTEGER] + gpRegCnt) > MAX_REGISTER_ARGUMENTS)) return null; ++ ++ VMStorage[] source = (forArguments ? CLinux.inputStorage : CLinux.outputStorage)[type]; ++ VMStorage result = source[nRegs[type]]; ++ ++ nRegs[StorageType.INTEGER] += gpRegCnt; ++ nRegs[StorageType.FLOAT] += fpRegCnt; ++ return result; ++ ++ } ++ VMStorage getStorage(int type, boolean is32Bit) { ++ VMStorage reg = regAlloc(type); ++ if (reg != null) { ++ if (is32Bit) { ++ reg = new VMStorage(reg.type(), REG32_MASK, reg.indexOrOffset()); ++ } ++ return reg; ++ } ++ VMStorage stack; ++ if (is32Bit) { ++ stackAlloc(4, STACK_SLOT_SIZE); // Skip first half of stack slot. ++ stack = stackAlloc(4, 4); ++ } else ++ stack = stackAlloc(8, STACK_SLOT_SIZE); ++ ++ return stack; ++ } ++ } ++ ++ abstract static class BindingCalculator { ++ protected final StorageCalculator storageCalculator; ++ ++ protected BindingCalculator(boolean forArguments) { ++ this.storageCalculator = new LinuxS390CallArranger.StorageCalculator(forArguments); ++ } ++ ++ abstract List getBindings(Class carrier, MemoryLayout layout); ++ } ++ ++ // Compute recipe for transferring arguments / return values to C from Java. ++ static class UnboxBindingCalculator extends BindingCalculator { ++ UnboxBindingCalculator(boolean forArguments) { ++ super(forArguments); ++ } ++ ++ @Override ++ List getBindings(Class carrier, MemoryLayout layout) { ++ TypeClass argumentClass = TypeClass.classifyLayout(layout); ++ Binding.Builder bindings = Binding.builder(); ++ switch (argumentClass) { ++ case STRUCT_REGISTER -> { ++ assert carrier == MemorySegment.class; ++ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); ++ Class type = SharedUtils.primitiveCarrierForSize(layout.byteSize(), false); ++ bindings.bufferLoad(0, type) ++ .vmStore(storage, type); ++ } ++ case STRUCT_SFA -> { ++ assert carrier == MemorySegment.class; ++ VMStorage storage = storageCalculator.getStorage(StorageType.FLOAT, layout.byteSize() == 4); ++ Class type = SharedUtils.primitiveCarrierForSize(layout.byteSize(), true); ++ bindings.bufferLoad(0, type) ++ .vmStore(storage, type); ++ } ++ case STRUCT_REFERENCE -> { ++ assert carrier == MemorySegment.class; ++ bindings.copy(layout) ++ .unboxAddress(); ++ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); ++ bindings.vmStore(storage, long.class); ++ } ++ case POINTER -> { ++ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); ++ bindings.unboxAddress() ++ .vmStore(storage, long.class); ++ } ++ case INTEGER -> { ++ // ABI requires all int types to get extended to 64 bit. ++ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); ++ bindings.vmStore(storage, carrier); ++ } ++ case FLOAT -> { ++ VMStorage storage = storageCalculator.getStorage(StorageType.FLOAT, carrier == float.class); ++ bindings.vmStore(storage, carrier); ++ } ++ default -> throw new UnsupportedOperationException("Unhandled class " + argumentClass); ++ } ++ return bindings.build(); ++ } ++ } ++ ++ // Compute recipe for transferring arguments / return values from C to Java. ++ static class BoxBindingCalculator extends BindingCalculator { ++ BoxBindingCalculator(boolean forArguments) { ++ super(forArguments); ++ } ++ ++ @Override ++ List getBindings(Class carrier, MemoryLayout layout) { ++ TypeClass argumentClass = TypeClass.classifyLayout(layout); ++ Binding.Builder bindings = Binding.builder(); ++ switch (argumentClass) { ++ case STRUCT_REGISTER -> { ++ assert carrier == MemorySegment.class; ++ bindings.allocate(layout) ++ .dup(); ++ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); ++ Class type = SharedUtils.primitiveCarrierForSize(layout.byteSize(), false); ++ bindings.vmLoad(storage, type) ++ .bufferStore(0, type); ++ } ++ case STRUCT_SFA -> { ++ assert carrier == MemorySegment.class; ++ bindings.allocate(layout) ++ .dup(); ++ VMStorage storage = storageCalculator.getStorage(StorageType.FLOAT, layout.byteSize() == 4); ++ Class type = SharedUtils.primitiveCarrierForSize(layout.byteSize(), true); ++ bindings.vmLoad(storage, type) ++ .bufferStore(0, type); ++ } ++ case STRUCT_REFERENCE -> { ++ assert carrier == MemorySegment.class; ++ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); ++ bindings.vmLoad(storage, long.class) ++ .boxAddress(layout); ++ } ++ case POINTER -> { ++ AddressLayout addressLayout = (AddressLayout) layout; ++ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); ++ bindings.vmLoad(storage, long.class) ++ .boxAddressRaw(Utils.pointeeByteSize(addressLayout), Utils.pointeeByteAlign(addressLayout)); ++ } ++ case INTEGER -> { ++ // We could use carrier != long.class for BoxBindingCalculator, but C always uses 64 bit slots. ++ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); ++ bindings.vmLoad(storage, carrier); ++ } ++ case FLOAT -> { ++ VMStorage storage = storageCalculator.getStorage(StorageType.FLOAT, carrier == float.class); ++ bindings.vmLoad(storage, carrier); ++ } ++ default -> throw new UnsupportedOperationException("Unhandled class " + argumentClass); ++ } ++ return bindings.build(); ++ } ++ } ++} +diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390Linker.java b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390Linker.java +new file mode 100644 +index 00000000000..ac004b9e1e0 +--- /dev/null ++++ b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390Linker.java +@@ -0,0 +1,64 @@ ++/* ++ * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2023 IBM Corp. 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. ++ */ ++package jdk.internal.foreign.abi.s390.linux; ++ ++import jdk.internal.foreign.abi.AbstractLinker; ++import jdk.internal.foreign.abi.LinkerOptions; ++ ++import java.lang.foreign.FunctionDescriptor; ++import java.lang.invoke.MethodHandle; ++import java.lang.invoke.MethodType; ++import java.nio.ByteOrder; ++ ++public final class LinuxS390Linker extends AbstractLinker { ++ ++ public static LinuxS390Linker getInstance() { ++ final class Holder { ++ private static final LinuxS390Linker INSTANCE = new LinuxS390Linker(); ++ } ++ ++ return Holder.INSTANCE; ++ } ++ ++ private LinuxS390Linker() { ++ // Ensure there is only one instance ++ } ++ ++ @Override ++ protected MethodHandle arrangeDowncall(MethodType inferredMethodType, FunctionDescriptor function, LinkerOptions options) { ++ return LinuxS390CallArranger.arrangeDowncall(inferredMethodType, function, options); ++ } ++ ++ @Override ++ protected UpcallStubFactory arrangeUpcall(MethodType targetType, FunctionDescriptor function, LinkerOptions options) { ++ return LinuxS390CallArranger.arrangeUpcall(targetType, function, options); ++ } ++ ++ @Override ++ protected ByteOrder linkerByteOrder() { ++ return ByteOrder.BIG_ENDIAN; ++ } ++} +diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/TypeClass.java b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/TypeClass.java +new file mode 100644 +index 00000000000..095cb2c08a8 +--- /dev/null ++++ b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/TypeClass.java +@@ -0,0 +1,126 @@ ++/* ++ * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2023 IBM Corp. 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. ++ */ ++package jdk.internal.foreign.abi.s390.linux; ++ ++import java.lang.foreign.GroupLayout; ++import java.lang.foreign.MemoryLayout; ++import java.lang.foreign.MemorySegment; ++import java.lang.foreign.SequenceLayout; ++import java.lang.foreign.ValueLayout; ++import java.util.List; ++import java.util.ArrayList; ++ ++public enum TypeClass { ++ STRUCT_REGISTER, ++ STRUCT_SFA, // Single Float Aggregate ++ STRUCT_REFERENCE, ++ POINTER, ++ INTEGER, ++ FLOAT; ++ ++ private static TypeClass classifyValueType(ValueLayout type) { ++ Class carrier = type.carrier(); ++ if (carrier == boolean.class || carrier == byte.class || carrier == char.class || ++ carrier == short.class || carrier == int.class || carrier == long.class) { ++ return INTEGER; ++ } else if (carrier == float.class || carrier == double.class) { ++ return FLOAT; ++ } else if (carrier == MemorySegment.class) { ++ return POINTER; ++ } else { ++ throw new IllegalStateException("Cannot get here: " + carrier.getName()); ++ } ++ } ++ ++ private static boolean isRegisterAggregate(MemoryLayout type) { ++ long byteSize = type.byteSize(); ++ if (byteSize > 8 || byteSize == 3 || byteSize == 5 || byteSize == 6 || byteSize == 7) ++ return false; ++ return true; ++ } ++ ++ static List scalarLayouts(GroupLayout gl) { ++ List out = new ArrayList<>(); ++ scalarLayoutsInternal(out, gl); ++ return out; ++ } ++ ++ private static void scalarLayoutsInternal(List out, GroupLayout gl) { ++ for (MemoryLayout member : gl.memberLayouts()) { ++ if (member instanceof GroupLayout memberGl) { ++ scalarLayoutsInternal(out, memberGl); ++ } else if (member instanceof SequenceLayout memberSl) { ++ for (long i = 0; i < memberSl.elementCount(); i++) { ++ out.add(memberSl.elementLayout()); ++ } ++ } else { ++ // padding or value layouts ++ out.add(member); ++ } ++ } ++ } ++ ++ static boolean isSingleFloatAggregate(MemoryLayout type) { ++ List scalarLayouts = scalarLayouts((GroupLayout) type); ++ ++ final int numElements = scalarLayouts.size(); ++ if (numElements > 1 || numElements == 0) ++ return false; ++ ++ MemoryLayout baseType = scalarLayouts.get(0); ++ ++ if (!(baseType instanceof ValueLayout)) ++ return false; ++ ++ TypeClass baseArgClass = classifyValueType((ValueLayout) baseType); ++ if (baseArgClass != FLOAT) ++ return false; ++ ++ return true; ++ } ++ ++ private static TypeClass classifyStructType(MemoryLayout layout) { ++ ++ if (!isRegisterAggregate(layout)) { ++ return TypeClass.STRUCT_REFERENCE; ++ } ++ ++ if (isSingleFloatAggregate(layout)) { ++ return TypeClass.STRUCT_SFA; ++ } ++ return TypeClass.STRUCT_REGISTER; ++ } ++ ++ public static TypeClass classifyLayout(MemoryLayout type) { ++ if (type instanceof ValueLayout) { ++ return classifyValueType((ValueLayout) type); ++ } else if (type instanceof GroupLayout) { ++ return classifyStructType(type); ++ } else { ++ throw new IllegalArgumentException("Unsupported layout: " + type); ++ } ++ } ++} +diff --git a/test/jdk/java/foreign/TestClassLoaderFindNative.java b/test/jdk/java/foreign/TestClassLoaderFindNative.java +index 3f5fec0c195..44ec8732ed4 100644 +--- a/test/jdk/java/foreign/TestClassLoaderFindNative.java ++++ b/test/jdk/java/foreign/TestClassLoaderFindNative.java +@@ -31,9 +31,10 @@ + import java.lang.foreign.Arena; + import java.lang.foreign.MemorySegment; + import java.lang.foreign.SymbolLookup; ++import java.nio.ByteOrder; + import org.testng.annotations.Test; + +-import static java.lang.foreign.ValueLayout.JAVA_BYTE; ++import static java.lang.foreign.ValueLayout.JAVA_INT; + import static org.testng.Assert.*; + + // FYI this test is run on 64-bit platforms only for now, +@@ -58,8 +59,8 @@ public class TestClassLoaderFindNative { + + @Test + public void testVariableSymbolLookup() { +- MemorySegment segment = SymbolLookup.loaderLookup().find("c").get().reinterpret(1); +- assertEquals(segment.get(JAVA_BYTE, 0), 42); ++ MemorySegment segment = SymbolLookup.loaderLookup().find("c").get().reinterpret(4); ++ assertEquals(segment.get(JAVA_INT, 0), 42); + } + + @Test +diff --git a/test/jdk/java/foreign/TestIllegalLink.java b/test/jdk/java/foreign/TestIllegalLink.java +index 677f0bce62f..5d8277a5d4c 100644 +--- a/test/jdk/java/foreign/TestIllegalLink.java ++++ b/test/jdk/java/foreign/TestIllegalLink.java +@@ -54,6 +54,7 @@ import static org.testng.Assert.fail; + public class TestIllegalLink extends NativeTestHelper { + + private static final boolean IS_SYSV = CABI.current() == CABI.SYS_V; ++ private static final boolean IS_LE = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN; + + private static final MemorySegment DUMMY_TARGET = MemorySegment.ofAddress(1); + private static final MethodHandle DUMMY_TARGET_MH = MethodHandles.empty(MethodType.methodType(void.class)); +@@ -113,27 +114,27 @@ public class TestIllegalLink extends NativeTestHelper { + { + FunctionDescriptor.of(MemoryLayout.sequenceLayout(2, C_INT)), + NO_OPTIONS, +- "Unsupported layout: [2:i4]" ++ IS_LE ? "Unsupported layout: [2:i4]" : "Unsupported layout: [2:I4]" + }, + { + FunctionDescriptor.ofVoid(MemoryLayout.sequenceLayout(2, C_INT)), + NO_OPTIONS, +- "Unsupported layout: [2:i4]" ++ IS_LE ? "Unsupported layout: [2:i4]" : "Unsupported layout: [2:I4]" + }, + { + FunctionDescriptor.ofVoid(C_INT.withByteAlignment(2)), + NO_OPTIONS, +- "Unsupported layout: 2%i4" ++ IS_LE ? "Unsupported layout: 2%i4" : "Unsupported layout: 2%I4" + }, + { + FunctionDescriptor.ofVoid(C_POINTER.withByteAlignment(2)), + NO_OPTIONS, +- "Unsupported layout: 2%a8" ++ IS_LE ? "Unsupported layout: 2%a8" : "Unsupported layout: 2%A8" + }, + { + FunctionDescriptor.ofVoid(ValueLayout.JAVA_CHAR.withByteAlignment(4)), + NO_OPTIONS, +- "Unsupported layout: 4%c2" ++ IS_LE ? "Unsupported layout: 4%c2" : "Unsupported layout: 4%C2" + }, + { + FunctionDescriptor.ofVoid(MemoryLayout.structLayout( +@@ -142,7 +143,7 @@ public class TestIllegalLink extends NativeTestHelper { + C_INT.withName("z").withByteAlignment(1) + ).withByteAlignment(1)), + NO_OPTIONS, +- "Unsupported layout: 1%s2" ++ IS_LE ? "Unsupported layout: 1%s2" : "Unsupported layout: 1%S2" + }, + { + FunctionDescriptor.ofVoid(MemoryLayout.structLayout( +@@ -152,7 +153,7 @@ public class TestIllegalLink extends NativeTestHelper { + C_INT.withName("z").withByteAlignment(1) + ))), + NO_OPTIONS, +- "Unsupported layout: 1%s2" ++ IS_LE ? "Unsupported layout: 1%s2" : "Unsupported layout: 1%S2" + }, + { + FunctionDescriptor.ofVoid(MemoryLayout.structLayout( +@@ -160,7 +161,7 @@ public class TestIllegalLink extends NativeTestHelper { + C_INT.withByteAlignment(1) + ))), + NO_OPTIONS, +- "Unsupported layout: 1%i4" ++ IS_LE ? "Unsupported layout: 1%i4" : "Unsupported layout: 1%I4" + }, + { + FunctionDescriptor.ofVoid(MemoryLayout.structLayout( +@@ -173,17 +174,17 @@ public class TestIllegalLink extends NativeTestHelper { + { + FunctionDescriptor.of(C_INT.withOrder(nonNativeOrder())), + NO_OPTIONS, +- "Unsupported layout: I4" ++ IS_LE ? "Unsupported layout: I4" : "Unsupported layout: i4" + }, + { + FunctionDescriptor.of(MemoryLayout.structLayout(C_INT.withOrder(nonNativeOrder()))), + NO_OPTIONS, +- "Unsupported layout: I4" ++ IS_LE ? "Unsupported layout: I4" : "Unsupported layout: i4" + }, + { + FunctionDescriptor.of(MemoryLayout.structLayout(MemoryLayout.sequenceLayout(C_INT.withOrder(nonNativeOrder())))), + NO_OPTIONS, +- "Unsupported layout: I4" ++ IS_LE ? "Unsupported layout: I4" : "Unsupported layout: i4" + }, + { + FunctionDescriptor.ofVoid(MemoryLayout.structLayout( +@@ -227,5 +228,4 @@ public class TestIllegalLink extends NativeTestHelper { + ? ByteOrder.BIG_ENDIAN + : ByteOrder.LITTLE_ENDIAN; + } +- + } +diff --git a/test/jdk/java/foreign/callarranger/platform/PlatformLayouts.java b/test/jdk/java/foreign/callarranger/platform/PlatformLayouts.java +index 1646063fb08..97856075bef 100644 +--- a/test/jdk/java/foreign/callarranger/platform/PlatformLayouts.java ++++ b/test/jdk/java/foreign/callarranger/platform/PlatformLayouts.java +@@ -305,5 +305,4 @@ public final class PlatformLayouts { + public static final AddressLayout C_POINTER = SharedUtils.C_POINTER; + + } +- + } diff --git a/openjdk_news.sh b/openjdk_news.sh index 560b356..386aa53 100755 --- a/openjdk_news.sh +++ b/openjdk_news.sh @@ -18,8 +18,8 @@ OLD_RELEASE=$1 NEW_RELEASE=$2 -SUBDIR=$3 -REPO=$4 +REPO=$3 +SUBDIR=$4 SCRIPT_DIR=$(dirname ${0}) if test "x${SUBDIR}" = "x"; then diff --git a/rh1648644-java_access_bridge_privileged_security.patch b/rh1648644-java_access_bridge_privileged_security.patch deleted file mode 100644 index 53026ad..0000000 --- a/rh1648644-java_access_bridge_privileged_security.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- openjdk/src/java.base/share/conf/security/java.security -+++ openjdk/src/java.base/share/conf/security/java.security -@@ -304,6 +304,8 @@ - # - package.access=sun.misc.,\ - sun.reflect.,\ -+ org.GNOME.Accessibility.,\ -+ org.GNOME.Bonobo.,\ - - # - # List of comma-separated packages that start with or equal this string -@@ -316,6 +318,8 @@ - # - package.definition=sun.misc.,\ - sun.reflect.,\ -+ org.GNOME.Accessibility.,\ -+ org.GNOME.Bonobo.,\ - - # - # Determines whether this properties file can be appended to diff --git a/sources b/sources index a5817fd..b2b5901 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-21+35.tar.xz) = 311e954cc8d28a336b85efc05baade8945fe5292ae2d91cc7ff71c6b3a1830b1a4b9fc641f87e68a4b3db175eb5c21a18664457715da9b37720c5d4b3eb67195 +SHA512 (openjdk-21.0.1+12.tar.xz) = 96513e1346dea623183ae68f88690aa7ea41d65f6a2499b7f9c08954643dd2a6f10d3f4f529fc34e00ff14e8c1bd3764ac78a5c669937a200c910ebcc74e782b From 26504dac4c5d1ddf0ec7e85199b12e54be85e259 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 21 Nov 2023 16:02:43 +0100 Subject: [PATCH 17/86] restricted to java-arches --- java-latest-openjdk-portable.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index f487843..7bac98c 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -518,6 +518,13 @@ %global alternatives_requires %{_sbindir}/alternatives %endif +# x86 is no longer supported +%if 0%{?java_arches:1} +ExclusiveArch: %{java_arches} +%else +ExcludeArch: %{ix86} +%endif + # Portables have no repo (requires/provides), but these are awesome for orientation in spec # Also scriptlets are happily missing and files are handled old fashion # not-duplicated requires/provides/obsoletes for normal/debug packages From e4459f4dcc7ba596c3d140a04dd284ccaa1ead0a Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Wed, 22 Nov 2023 11:07:30 +0100 Subject: [PATCH 18/86] moved docs and miscs to release-only condition --- java-latest-openjdk-portable.spec | 34 ++++++++++++++++++------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 7bac98c..3fa3abd 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -915,6 +915,7 @@ The %{origin_nice} %{featurever} runtime environment. %endif +%if %{include_normal_build} %package docs Summary: %{origin_nice} %{featurever} API documentation @@ -930,6 +931,7 @@ Summary: %{origin_nice} %{featurever} miscellany %description misc The %{origin_nice} %{featurever} miscellany. +%endif %package sources Summary: %{origin_nice} %{featurever} full patched sources of portable JDK @@ -1302,7 +1304,6 @@ function packagejdk() { echo "Packaging build from ${imagesdir} to ${packagesdir}..." mkdir -p ${packagesdir} - pushd ${imagesdir} if [ "x$suffix" = "x" ] ; then nameSuffix="" @@ -1318,10 +1319,11 @@ function packagejdk() { staticarchive=${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"} debugarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.debuginfo"} unstrippedarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.unstripped"} - # We only use docs for the release build - docname=%{docportablename} - docarchive=${packagesdir}/%{docportablearchive} - built_doc_archive=jdk-%{filever}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip + if [ "x$suffix" = "x" ] ; then + docname=%{docportablename} + docarchive=${packagesdir}/%{docportablearchive} + built_doc_archive=jdk-%{filever}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip + fi # These are from the source tree so no debug variants miscname=%{miscportablename} miscarchive=${packagesdir}/%{miscportablearchive} @@ -1661,15 +1663,16 @@ for suffix in %{build_loop} ; do fi done -# These definitions should match those in installjdk -# Install outside the loop as there are no debug variants -docarchive=${packagesdir}/%{docportablearchive} -miscarchive=${packagesdir}/%{miscportablearchive} - -mv ${docarchive} $RPM_BUILD_ROOT%{_jvmdir}/ -mv ${docarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ -mv ${miscarchive} $RPM_BUILD_ROOT%{_jvmdir}/ -mv ${miscarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ + if [ "x$suffix" = "x" ] ; then + # These definitions should match those in installjdk + # Install outside the loop as there are no debug variants + docarchive=${packagesdir}/%{docportablearchive} + miscarchive=${packagesdir}/%{miscportablearchive} + mv ${docarchive} $RPM_BUILD_ROOT%{_jvmdir}/ + mv ${docarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ + mv ${miscarchive} $RPM_BUILD_ROOT%{_jvmdir}/ + mv ${miscarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ + fi # To show sha in the build log for file in `ls $RPM_BUILD_ROOT%{_jvmdir}/*.sha256sum` ; do @@ -1744,6 +1747,7 @@ done %{_jvmdir}/%{jdkportablesourcesarchiveForFiles} %{_jvmdir}/%{jdkportablesourcesarchiveForFiles}.sha256sum +%if %{include_normal_build} %files docs %{_jvmdir}/%{docportablearchive} %{_jvmdir}/%{docportablearchive}.sha256sum @@ -1751,6 +1755,7 @@ done %files misc %{_jvmdir}/%{miscportablearchive} %{_jvmdir}/%{miscportablearchive}.sha256sum +%endif %changelog * Wed Nov 22 2023 Jiri Vanek - 1:21.0.1.0.12-2.rolling @@ -1765,6 +1770,7 @@ done - removed no longer needed jdk8296108-tzdata2022f.patch, jdk8296715-cldr2022f.patch, rh1648644-java_access_bridge_privileged_security.patch - added jdk8311630-s390_ffmapi.patch to support virtual threads on s390x - aligned fips-21u-75ffdc48eda.patch (gnu_andrew) +- fixed '--without release' build-ability by moving docs and misc to if-release only * Wed Sep 20 2023 Jiri Vanek - 1:21.0.0.0.35-4.rolling - removed %{1} from miscportablename From 0066a17fe1b16dab26edc793cd2a65c5e6fdf2d8 Mon Sep 17 00:00:00 2001 From: Jiri Date: Thu, 23 Nov 2023 15:14:16 +0100 Subject: [PATCH 19/86] cosmetic changes removed unused macros better comments more quotings --- java-latest-openjdk-portable.spec | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 3fa3abd..96d8be9 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1,3 +1,8 @@ +%if (0%{?rhel} > 0 && 0%{?rhel} < 8) +# portable jdk 17 specific bug, _jvmdir being missing +%define _jvmdir /usr/lib/jvm +%endif + # debug_package %%{nil} is portable-jdks specific %define debug_package %{nil} @@ -145,7 +150,7 @@ %global zgc_arches x86_64 # Set of architectures for which alt-java has SSB mitigation %global ssbd_arches x86_64 -# Set of architectures for which java has short vector math library (libsvml.so) +# Set of architectures for which java has short vector math library (libjsvml.so) %global svml_arches x86_64 # Set of architectures where we verify backtraces with gdb # s390x fails on RHEL 7 so we exclude it there @@ -428,10 +433,6 @@ # images directories from upstream build %global jdkimage jdk %global static_libs_image static-libs -# installation directory for static libraries -%global static_libs_root lib/static -%global static_libs_arch_dir %{static_libs_root}/linux-%{archinstall} -%global static_libs_install_dir %{static_libs_arch_dir}/glibc # output dir stub %define buildoutputdir() %{expand:build/jdk%{featurever}.build%{?1}} %define installoutputdir() %{expand:install/jdk%{featurever}.install%{?1}} @@ -739,7 +740,7 @@ BuildRequires: libXtst-devel # Requirement for setting up nss.fips.cfg BuildRequires: nss-devel # Requirement for system security property test -#N/A +# N/A for portable. RHEL7 doesn't provide them #BuildRequires: crypto-policies BuildRequires: pkgconfig BuildRequires: xorg-x11-proto-devel @@ -750,13 +751,16 @@ BuildRequires: unzip %if (0%{?rhel} > 0 && 0%{?rhel} < 8) # No javapackages-filesystem on el7,nor is needed for portables %else -BuildRequires: javapackages-filesystem +# BuildRequires: javapackages-filesystem BuildRequires: java-latest-openjdk-devel %endif # Zero-assembler build requirement %ifarch %{zero_arches} BuildRequires: libffi-devel %endif +# Full documentation build requirements +BuildRequires: graphviz +BuildRequires: pandoc # 2023c required as of JDK-8305113 BuildRequires: tzdata-java >= 2023c # cacerts build requirement in portable mode @@ -1117,7 +1121,7 @@ function buildjdk() { %endif --with-version-build=%{buildver} \ --with-version-pre="%{ea_designator}" \ - --with-version-opt=%{lts_designator} \ + --with-version-opt="%{lts_designator}" \ --with-vendor-version-string="%{oj_vendor_version}" \ --with-vendor-name="%{oj_vendor}" \ --with-vendor-url="%{oj_vendor_url}" \ @@ -1520,7 +1524,6 @@ if ! nm %{altjavaoutputdir}/%{alt_java_name} | grep prctl ; then true ; else fal # Check translations are available for new timezones (during flatpak builds, the # tzdb.dat used by this test is not where the test expects it, so this is # disabled for flatpak builds) -# Disable test until we are on the latest JDK $JAVA_HOME/bin/javac -d . %{SOURCE18} $JAVA_HOME/bin/java $(echo $(basename %{SOURCE18})|sed "s|\.java||") JRE $JAVA_HOME/bin/java -Djava.locale.providers=CLDR $(echo $(basename %{SOURCE18})|sed "s|\.java||") CLDR From 8a7656ebac6a9ffd64a3dba70a0366b699915bfd Mon Sep 17 00:00:00 2001 From: Jiri Date: Wed, 29 Nov 2023 11:09:35 +0100 Subject: [PATCH 20/86] redirected bugs to non portable compoment --- java-latest-openjdk-portable.spec | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 96d8be9..19b80f7 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -360,11 +360,11 @@ # Define what url should JVM offer in case of a crash report # order may be important, epel may have rhel declared %if 0%{?epel} -%global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora%20EPEL&component=%{name}&version=epel%{epel} +%global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora%20EPEL&component=%{component}&version=epel%{epel} %else %if 0%{?fedora} # Does not work for rawhide, keeps the version field empty -%global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%{name}&version=%{fedora} +%global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%{component}&version=%{fedora} %else %if 0%{?rhel} %global oj_vendor_bug_url https://access.redhat.com/support/cases/ @@ -550,6 +550,10 @@ ExcludeArch: %{ix86} # Prevent brp-java-repack-jars from being run %global __jar_repack 0 +# portables have grown out of its component, moving back to java-x-vendor +# this expression, when declared as global, filled component with java-x-vendor portable +%define component %(echo %{name} | sed "s;-portable;;g") + Name: java-latest-%{origin}-portable Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with @@ -567,11 +571,6 @@ Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist} # provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0". Epoch: 1 - -# portables have grown out of its component, moving back to java-x-vendor -# this expression, when declared as global, filled component with java-x-vendor portable -%define component %(echo %{name} | sed "s;-portable;;g") - Summary: %{origin_nice} %{featurever} Runtime Environment portable edition # Groups are only used up to RHEL 8 and on Fedora versions prior to F30 %if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30) @@ -991,7 +990,6 @@ if [ $prioritylength -ne 8 ] ; then fi # OpenJDK patches - %if %{system_libs} # Remove libraries that are linked by both static and dynamic builds sh %{SOURCE12} %{top_level_dir_name} @@ -1307,7 +1305,6 @@ function packagejdk() { pushd ${imagesdir} echo "Packaging build from ${imagesdir} to ${packagesdir}..." - mkdir -p ${packagesdir} if [ "x$suffix" = "x" ] ; then nameSuffix="" @@ -1404,7 +1401,6 @@ packFullPatchedSources %endif for suffix in %{build_loop} ; do - if [ "x$suffix" = "x" ] ; then debugbuild=release else @@ -1484,7 +1480,7 @@ export JAVA_HOME=${top_dir_abs_main_build_path}/images/%{jdkimage} # Check Shenandoah is enabled %if %{use_shenandoah_hotspot} -$JAVA_HOME/bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -version +$JAVA_HOME/bin/java -XX:+UseShenandoahGC -version %endif # Check unlimited policy has been used @@ -1684,7 +1680,6 @@ for file in `ls $RPM_BUILD_ROOT%{_jvmdir}/*.sha256sum` ; do done %if %{include_normal_build} - %files # main package builds always %{_jvmdir}/%{jreportablearchiveForFiles} From 4b38c2140b8a5c59e1d4807ec91cb88dd8ec12d5 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Wed, 29 Nov 2023 18:03:42 +0100 Subject: [PATCH 21/86] removed duplicated info line --- java-latest-openjdk-portable.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 19b80f7..c7fbdd7 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1304,8 +1304,6 @@ function packagejdk() { mkdir -p ${packagesdir} pushd ${imagesdir} - echo "Packaging build from ${imagesdir} to ${packagesdir}..." - if [ "x$suffix" = "x" ] ; then nameSuffix="" else From bade6a4d92d65cb906846478a66a447f60faaef2 Mon Sep 17 00:00:00 2001 From: Jiri Date: Thu, 14 Dec 2023 14:09:42 +0100 Subject: [PATCH 22/86] packing generated sources It seems, that there are some more, and still some missing: tar -tf /home/jvanek/rpmbuild/RPMS/x86_64/java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64.tar.xz java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/java-icon32.png java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/java-icon48.png java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk-21.0.1+12/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk-21.0.1+12/make/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk-21.0.1+12/make/data/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk-21.0.1+12/make/data/autoheaders/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk-21.0.1+12/make/data/autoheaders/assemblyprefix.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk-21.0.1+12/make/data/lsan/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk-21.0.1+12/make/data/lsan/lsan_default_options.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk-21.0.1+12/make/data/asan/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk-21.0.1+12/make/data/asan/asan_default_options.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk-21.0.1+12/make/data/ubsan/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk-21.0.1+12/make/data/ubsan/ubsan_default_options.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk-21.0.1+12/make/langtools/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk-21.0.1+12/make/langtools/test/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk-21.0.1+12/make/langtools/test/HelloWorld.gold.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/jdk/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/jdk/include/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/jdk/include/classfile_constants.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/jdk/include/jdwpTransport.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/jdk/include/jvmticmlr.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/jdk/include/jni.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/jdk/include/linux/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/jdk/include/linux/jni_md.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/jdk/include/linux/jawt_md.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/jdk/include/jawt.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/dtracefiles/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/dtracefiles/hotspot.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/dtracefiles/hs_private.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/dtracefiles/hotspot_jni.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/jfrfiles/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/jfrfiles/jfrEventClasses.hpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/jfrfiles/jfrEventControl.hpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/jfrfiles/jfrTypes.hpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/jfrfiles/jfrPeriodic.hpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/jfrfiles/jfrEventIds.hpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/jvmtifiles/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/jvmtifiles/jvmti.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/jvmtifiles/jvmtiEnter.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/jvmtifiles/jvmtiEnterTrace.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/jvmtifiles/jvmtiEnv.hpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/adfiles/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/adfiles/ad_x86_pipeline.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/adfiles/ad_x86_expand.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/adfiles/ad_x86_clone.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/adfiles/ad_x86.hpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/adfiles/ad_x86_format.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/adfiles/ad_x86_gen.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/adfiles/adGlobals_x86.hpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/adfiles/dfa_x86.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/adfiles/ad_x86_peephole.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/adfiles/ad_x86_misc.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/gensrc/adfiles/ad_x86.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/support/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/support/adlc/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/support/adlc/ad_x86_pipeline.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/support/adlc/ad_x86_expand.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/support/adlc/ad_x86_clone.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/support/adlc/ad_x86.hpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/support/adlc/ad_x86_format.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/support/adlc/ad_x86_gen.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/support/adlc/adGlobals_x86.hpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/support/adlc/dfa_x86.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/support/adlc/ad_x86_peephole.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/support/adlc/ad_x86_misc.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/hotspot/variant-server/support/adlc/ad_x86.cpp java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/images/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/images/jdk/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/images/jdk/include/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/images/jdk/include/jvmti.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/images/jdk/include/classfile_constants.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/images/jdk/include/jdwpTransport.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/images/jdk/include/jvmticmlr.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/images/jdk/include/jni.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/images/jdk/include/linux/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/images/jdk/include/linux/jni_md.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/images/jdk/include/linux/jawt_md.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/images/jdk/include/jawt.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.smartcardio/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.smartcardio/sun_security_smartcardio_PCSC.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.smartcardio/sun_security_smartcardio_PlatformPCSC.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.security.jgss/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.security.jgss/sun_security_jgss_wrapper_GSSLibStub.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.security.jgss/sun_security_krb5_SCDynamicStoreConfig.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.security.jgss/sun_security_krb5_Config.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.security.jgss/sun_security_krb5_Credentials.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.hotspot.agent/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.hotspot.agent/sun_jvm_hotspot_debugger_aarch64_AARCH64ThreadContext.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.hotspot.agent/sun_jvm_hotspot_debugger_linux_amd64_DwarfParser.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.hotspot.agent/sun_jvm_hotspot_asm_Disassembler.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.hotspot.agent/sun_jvm_hotspot_debugger_riscv64_RISCV64ThreadContext.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.hotspot.agent/sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.hotspot.agent/sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.hotspot.agent/sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.hotspot.agent/sun_jvm_hotspot_debugger_x86_X86ThreadContext.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.hotspot.agent/sun_jvm_hotspot_debugger_windbg_WindbgDebuggerLocal.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.hotspot.agent/sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.prefs/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.prefs/java_util_prefs_FileSystemPreferences.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.rmi/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.rmi/sun_rmi_transport_GC.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_Object.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_FileKey.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_net_Inet6Address.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_net_SocketOptions.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_jimage_NativeImageBuffer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_platform_CgroupMetrics.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_vm_VMSupport.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_ProcessHandleImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_ProcessImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_fs_UnixNativeDispatcher.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_EventFD.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_Thread.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_vm_vector_VectorSupport.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_util_zip_Adler32.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_EPoll.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_loader_RawNativeLibraries.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_DatagramChannelImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_reflect_Array.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_PollSelectorImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_SocketDispatcher.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_fs_UnixFileSystem.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_UnixFileDispatcherImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_StackStreamFactory_AbstractStackWalker.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_reflect_NativeConstructorAccessorImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_reflect_ConstantPool.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_Double.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_net_NetworkInterface.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_nio_MappedMemoryUtils.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_net_spi_DefaultProxySelector.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_ProcessHandleImpl_Info.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_Throwable.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_io_FileDescriptor.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_security_AccessController.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_io_ObjectStreamClass.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_ref_Finalizer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_util_zip_Deflater.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_security_SystemConfigurator.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_ProcessEnvironment.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_misc_VM.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_invoke_MethodHandle.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_Module.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_ClassLoader.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_VirtualThread.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_io_RandomAccessFile.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_misc_Signal.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_invoke_VarHandle.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_fs_LinuxNativeDispatcher.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_misc_Unsafe.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_reflect_DirectConstructorHandleAccessor_NativeAccessor.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_io_UnixFileSystem.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_net_dns_ResolverConfigurationImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_FileDispatcherImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_InheritedChannel.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_reflect_DirectMethodHandleAccessor_NativeAccessor.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_Runtime.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_net_Inet6AddressImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_invoke_MethodHandleNatives.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_foreign_abi_UpcallStubs.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_Class.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_util_zip_CRC32.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_UnixDispatcher.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_net_Inet4Address.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_misc_ScopedMemoryAccess.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_net_InetAddress.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_util_zip_Inflater.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_Net.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_misc_PreviewFeatures.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_StackStreamFactory.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_vm_Continuation.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_String.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_fs_LinuxWatchService.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_net_spi_InetAddressResolver_LookupPolicy.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_DatagramDispatcher.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_vm_ContinuationSupport.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_ref_PhantomReference.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_reflect_Executable.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_io_Console.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_Float.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_io_FileInputStream.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_NativeSocketAddress.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_io_FileOutputStream.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_io_FileSystem.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_ref_Reference.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_loader_NativeLibraries.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_UnixAsynchronousSocketChannelImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_Shutdown.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_NullPointerException.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_vm_ForeignLinkerSupport.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_net_PortConfig.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_io_JdkConsoleImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_IOStatus.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_System.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_misc_CDS.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_util_SystemProps_Raw.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_reflect_Field.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_util_TimeZone.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_StringUTF16.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_util_concurrent_atomic_AtomicLong.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_StackTraceElement.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_net_Inet4AddressImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_reflect_Reflection.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_io_FileCleanable.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_invoke_LambdaProxyClassArchive.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_loader_BootLoader.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_foreign_abi_UpcallLinker.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_loader_NativeLibrary.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_foreign_abi_NativeEntryPoint.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_UnixDomainSockets.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_SecurityManager.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_Long.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/java_lang_Integer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_NativeThread.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_foreign_abi_fallback_LibFallback.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_perf_Perf.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_net_sdp_SdpSupport.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/sun_nio_ch_IOUtil.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.base/jdk_internal_reflect_NativeMethodAccessorImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.attach/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.attach/sun_tools_attach_VirtualMachineImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.jdwp.agent/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.jdwp.agent/JDWPCommands.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.net/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.net/jdk_net_LinuxSocketOptions.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.security.auth/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.security.auth/com_sun_security_auth_module_UnixSystem.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.security.auth/com_sun_security_auth_module_NTSystem.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.management.agent/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.management.agent/jdk_internal_agent_FileSystemImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.jfr/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.jfr/jdk_jfr_internal_JVM.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.internal.le/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.internal.le/jdk_internal_org_jline_terminal_impl_jna_linux_CLibraryImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.management/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.management/sun_management_MemoryManagerImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.management/sun_management_VMManagementImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.management/sun_management_MemoryPoolImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.management/sun_management_ThreadImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.management/sun_management_HotspotThread.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.management/sun_management_ClassLoadingImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.management/sun_management_MemoryImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.management/sun_management_GarbageCollectorImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.sctp/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.sctp/sun_nio_ch_sctp_SctpNet.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.sctp/sun_nio_ch_sctp_SctpStdSocketOption.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.sctp/sun_nio_ch_sctp_PeerAddrChange.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.sctp/sun_nio_ch_sctp_ResultContainer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.sctp/sun_nio_ch_sctp_SctpChannelImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.sctp/sun_nio_ch_sctp_AssociationChange.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_DrawRect.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_FontDescriptor.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/com_sun_media_sound_Platform.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_event_InputEvent.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_UNIXToolkit.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_MenuItem.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_font_StrikeCache.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_BasicStroke.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_X11_XToolkit.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_DrawPolygons.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_xr_XRMaskBlit.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_x11_X11SurfaceData.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_image_JPEGImageDecoder.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_SunHints.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_cmm_lcms_LCMS.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_Blit.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_pipe_BufferedMaskBlit.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_image_BytePackedRaster.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_image_GifImageDecoder.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/com_sun_media_sound_MidiOutDeviceProvider.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Event.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_xr_XRSurfaceData.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_screencast_ScreencastHelper.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Transparency.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_opengl_GLXSurfaceData.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_ScaledBlit.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Toolkit.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_MaskFill.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_X11_XInputMethod.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_image_Raster.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Dialog.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_image_BufferedImage.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/com_sun_imageio_plugins_jpeg_JPEGImageReader.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_font_ColorGlyphSurfaceData.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_xr_XIDGenerator.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_color_ColorSpace.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_image_BufImgSurfaceData.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/com_sun_java_swing_plaf_gtk_GTKEngine.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_image_ImageRepresentation.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_X11GraphicsEnvironment.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_TransformBlit.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_font_NullFontScaler.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_MenuBar.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_opengl_OGLMaskFill.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Dimension.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/com_sun_media_sound_PortMixerProvider.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_font_NativeFont.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_image_ShortComponentRaster.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_pipe_BufferedOpCodes.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_font_FreetypeFontScaler.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Container.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_pipe_BufferedTextPipe.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_image_DataBuffer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_GraphicsPrimitiveMgr.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_font_X11TextRenderer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_image_SampleModel.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_X11GraphicsConfig.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_AWTEvent.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Menu.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_opengl_OGLTextRenderer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_pipe_hw_AccelSurface.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Rectangle.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_pipe_BufferedRenderPipe.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_image_SinglePixelPackedSampleModel.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_event_InputMethodEvent.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Choice.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_SystemColor.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_X11_XDesktopPeer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_DrawLine.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_DrawGlyphListAA.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_X11_XRobotPeer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_font_FileFontStrike.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_image_ImagingLib.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_FillSpans.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/com_sun_media_sound_MidiInDeviceProvider.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_pipe_BufferedPaints.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_pipe_BufferedContext.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Insets.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_print_Pageable.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_SunGraphics2D.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_FcFontManager.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Label.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_AlphaComposite.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_pipe_Region.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/com_sun_media_sound_DirectAudioDeviceProvider.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_event_ComponentEvent.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/com_sun_media_sound_PortMixer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_event_AdjustmentEvent.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Checkbox.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/com_sun_media_sound_MidiInDevice.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_print_CUPSPrinter.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_pipe_SpanClipRenderer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_DrawGlyphListLCD.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/com_sun_imageio_plugins_jpeg_JPEGImageWriter.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_image_DataBufferNative.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_print_PageFormat.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_xr_XRMaskFill.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_X11GraphicsDevice.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_DrawPath.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_FillParallelogram.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/com_sun_media_sound_MidiOutDevice.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Adjustable.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_event_WindowEvent.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_image_AffineTransformOp.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_CheckboxMenuItem.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_image_IndexColorModel.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_SurfaceData.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_dnd_DnDConstants.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/com_sun_java_swing_plaf_gtk_GTKStyle.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_MaskBlit.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_DisplayMode.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Font.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_opengl_GLXGraphicsConfig.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_X11_XWindow.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_FontMetrics.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_event_MouseWheelEvent.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_DrawParallelogram.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_SunToolkit.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_TextField.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_MenuComponent.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_image_ConvolveOp.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Scrollbar.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_FillPath.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_FileDialog.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_pipe_ShapeSpanIterator.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_X11_XWindowPeer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_TransformHelper.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_font_NativeStrikeDisposer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_opengl_OGLRenderQueue.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_image_ByteComponentRaster.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_opengl_OGLBlitLoops.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_X11_XTaskbarPeer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_X11_XlibWrapper.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_opengl_OGLRenderer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Color.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Component.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_SplashScreen.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_opengl_OGLSurfaceData.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_opengl_OGLContext_OGLContextCaps.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_DrawGlyphList.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_x11_X11PMBlitBgLoops.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_xr_XRBackendNative.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Frame.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_ScrollPaneAdjustable.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_DefaultDisposerRecord.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_font_SunLayoutEngine.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_X11_GtkFileDialogPeer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_font_FontConfigManager.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_opengl_OGLContext.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_FillRect.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_font_NativeStrike.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Window.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_image_IntegerComponentRaster.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_Disposer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_TrayIcon.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_KeyboardFocusManager.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_PlatformFont.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/com_sun_media_sound_DirectAudioDevice.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Cursor.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_font_SunFontManager.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_x11_XSurfaceData.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_ScrollPane.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_image_Kernel.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_event_KeyEvent.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_TextArea.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_x11_X11PMBlitLoops.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_loops_BlitBg.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_x11_X11Renderer.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_X11InputMethodBase.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_event_MouseEvent.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_geom_PathIterator.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_event_ActionEvent.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_awt_DebugSettings.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_image_ColorModel.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/sun_java2d_cmm_lcms_LCMSImageLayout.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.desktop/java_awt_Button.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.internal.vm.ci/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.internal.vm.ci/jdk_vm_ci_runtime_JVMCI.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.internal.vm.ci/jdk_vm_ci_hotspot_CompilerToVM.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.instrument/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/java.instrument/sun_instrument_InstrumentationImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.crypto.cryptoki/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.crypto.cryptoki/sun_security_pkcs11_Secmod.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.crypto.cryptoki/sun_security_pkcs11_wrapper_PKCS11.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.management/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.management/com_sun_management_internal_HotSpotDiagnostic.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.management/com_sun_management_internal_Flag.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.management/com_sun_management_internal_DiagnosticCommandImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.management/com_sun_management_internal_OperatingSystemImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.management/com_sun_management_internal_GarbageCollectorExtImpl.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/headers/jdk.management/com_sun_management_internal_GcInfoBuilder.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/interim-image/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/interim-image/include/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/interim-image/include/jvmti.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/interim-image/include/classfile_constants.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/interim-image/include/jvmticmlr.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/interim-image/include/jni.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/interim-image/include/linux/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/interim-image/include/linux/jni_md.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/modules_include/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/modules_include/java.base/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/modules_include/java.base/jvmti.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/modules_include/java.base/classfile_constants.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/modules_include/java.base/jvmticmlr.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/modules_include/java.base/jni.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/modules_include/java.base/linux/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/modules_include/java.base/linux/jni_md.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/modules_include/jdk.jdwp.agent/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/modules_include/jdk.jdwp.agent/jdwpTransport.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/modules_include/java.desktop/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/modules_include/java.desktop/linux/ java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/modules_include/java.desktop/linux/jawt_md.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/generated_sources/jdk21.build/support/modules_include/java.desktop/jawt.h java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/alt-java java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/java-icon16.png java-21-openjdk-21.0.1.0.12-3.rolling.fc38.portable.misc.x86_64/java-icon24.png --- java-latest-openjdk-portable.spec | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index c7fbdd7..06d86b4 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -393,7 +393,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 12 -%global rpmrelease 2 +%global rpmrelease 3 #%%global tagsuffix %%{nil} # 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 @@ -508,6 +508,7 @@ %define jrebindir() %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/bin} %global alt_java_name alt-java +%global generated_sources_name generated_sources %global rpm_state_dir %{_localstatedir}/lib/rpm-state/ @@ -1291,6 +1292,26 @@ function packFullPatchedSources() { genchecksum ${srcpackagesdir}/%{jdkportablesourcesarchive -- ""} } +function findGeneratedSources() { + local targetDir=${1} + local targetDirParent=$(dirname ${targetDir}) + local builtJdk=${2} + local builtJdkName=$(basename ${builtJdk}) + local sources=${3} + local sourcesName=$(basename ${sources}) + local sourcesParent=$(dirname ${sources}) + local target=${sourcesParent}/${targetDirParent}/%{generated_sources_name} + mkdir $target + pushd ${builtJdk} + mkdir ${target}/${builtJdkName} + cp --parents $(find . | grep -e "\.cpp$" -e "\.hpp$" -e "\.h$" -e "\.hh$" -e "\.rl$" -e "NONE$") ${target}/${builtJdkName} + popd + pushd ${sources} + mkdir ${target}/${sourcesName} + cp --parents $(find make | grep -e "\.cpp$" -e "\.hpp$" -e "\.h$" -e "\.hh$" -e "\.rl$" -e "NONE$") ${target}/${sourcesName} + popd +} + function packagejdk() { local imagesdir=$(pwd)/${1}/images local docdir=$(pwd)/${1}/images/docs @@ -1357,7 +1378,7 @@ function packagejdk() { %if %{with_systemtap} cp -a ${tapsetdir}* ${miscname} %endif - cp -av ${altjavadir}/%{alt_java_name} ${miscname} + cp -avr ${altjavadir}/%{alt_java_name} ${altjavadir}/../%{generated_sources_name} ${miscname} tar -cJf ${miscarchive} ${miscname} genchecksum ${miscarchive} fi @@ -1437,11 +1458,13 @@ for suffix in %{build_loop} ; do buildjdk ${bootbuilddir} ${systemjdk} "%{bootstrap_targets}" ${debugbuild} ${link_opt} ${debug_symbols} installjdk ${bootbuilddir} ${bootinstalldir} buildjdk ${builddir} $(pwd)/${bootinstalldir}/images/%{jdkimage} "${maketargets}" ${debugbuild} ${link_opt} ${debug_symbols} + findGeneratedSources ${installdir} ${builddir} $(pwd)/%{top_level_dir_name} stripjdk ${builddir} installjdk ${builddir} ${installdir} %{!?with_artifacts:rm -rf ${bootinstalldir}} else buildjdk ${builddir} ${systemjdk} "${maketargets}" ${debugbuild} ${link_opt} ${debug_symbols} + findGeneratedSources ${installdir} ${builddir} $(pwd)/%{top_level_dir_name} stripjdk ${builddir} installjdk ${builddir} ${installdir} fi @@ -1754,6 +1777,9 @@ done %endif %changelog +* Wed Dec 13 2023 Jiri Vanek - 1:21.0.1.0.12-3.rolling +- packing generated sources + * Wed Nov 22 2023 Jiri Vanek - 1:21.0.1.0.12-2.rolling - updated to OpenJDK 21.0.1 (2023-10-17) - adjsuted generate_source_tarball From 2e9bc90b6c5b5132e7eefb7296f63211b8f9a2b0 Mon Sep 17 00:00:00 2001 From: Jiri Date: Thu, 14 Dec 2023 15:37:30 +0100 Subject: [PATCH 23/86] Added -p for generated sources dirs as they are created in lopp --- java-latest-openjdk-portable.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 06d86b4..552bbd3 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1301,13 +1301,13 @@ function findGeneratedSources() { local sourcesName=$(basename ${sources}) local sourcesParent=$(dirname ${sources}) local target=${sourcesParent}/${targetDirParent}/%{generated_sources_name} - mkdir $target + mkdir -p $target pushd ${builtJdk} - mkdir ${target}/${builtJdkName} + mkdir -p ${target}/${builtJdkName} cp --parents $(find . | grep -e "\.cpp$" -e "\.hpp$" -e "\.h$" -e "\.hh$" -e "\.rl$" -e "NONE$") ${target}/${builtJdkName} popd pushd ${sources} - mkdir ${target}/${sourcesName} + mkdir -p ${target}/${sourcesName} cp --parents $(find make | grep -e "\.cpp$" -e "\.hpp$" -e "\.h$" -e "\.hh$" -e "\.rl$" -e "NONE$") ${target}/${sourcesName} popd } From 2aed69fb8bf7344effcff37eb1573b69bb09be6b Mon Sep 17 00:00:00 2001 From: Jiri Date: Thu, 14 Dec 2023 15:44:10 +0100 Subject: [PATCH 24/86] replaced several -e by single OR expression, extracted duplicated suffixes --- java-latest-openjdk-portable.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 552bbd3..7cf8b03 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1301,14 +1301,15 @@ function findGeneratedSources() { local sourcesName=$(basename ${sources}) local sourcesParent=$(dirname ${sources}) local target=${sourcesParent}/${targetDirParent}/%{generated_sources_name} + local suffixes="cpp|hpp|h|hh|rl" mkdir -p $target pushd ${builtJdk} mkdir -p ${target}/${builtJdkName} - cp --parents $(find . | grep -e "\.cpp$" -e "\.hpp$" -e "\.h$" -e "\.hh$" -e "\.rl$" -e "NONE$") ${target}/${builtJdkName} + cp --parents $(find . | grep -e ".*\.($suffixes)$" -e "NONE$") ${target}/${builtJdkName} popd pushd ${sources} mkdir -p ${target}/${sourcesName} - cp --parents $(find make | grep -e "\.cpp$" -e "\.hpp$" -e "\.h$" -e "\.hh$" -e "\.rl$" -e "NONE$") ${target}/${sourcesName} + cp --parents $(find make | grep -e -e ".*\.($suffixes)$" -e "NONE$") ${target}/${sourcesName} popd } From 5ab235ae093aeb41ca0f407c4d0643ee9b75c45d Mon Sep 17 00:00:00 2001 From: Jiri Date: Thu, 14 Dec 2023 19:59:34 +0100 Subject: [PATCH 25/86] Correctly escaping the suffxes regex --- java-latest-openjdk-portable.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 7cf8b03..f9e2091 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1301,15 +1301,16 @@ function findGeneratedSources() { local sourcesName=$(basename ${sources}) local sourcesParent=$(dirname ${sources}) local target=${sourcesParent}/${targetDirParent}/%{generated_sources_name} - local suffixes="cpp|hpp|h|hh|rl" + local suffixes="cpp\|hpp\|h\|hh\|rl" + suffixes=".*\.\($suffixes\)$" mkdir -p $target pushd ${builtJdk} mkdir -p ${target}/${builtJdkName} - cp --parents $(find . | grep -e ".*\.($suffixes)$" -e "NONE$") ${target}/${builtJdkName} + cp --parents $(find . | grep -e "$suffixes" -e "NONE$") ${target}/${builtJdkName} popd pushd ${sources} mkdir -p ${target}/${sourcesName} - cp --parents $(find make | grep -e -e ".*\.($suffixes)$" -e "NONE$") ${target}/${sourcesName} + cp --parents $(find make | grep -e ".$suffixes" -e "NONE$") ${target}/${sourcesName} popd } From 1d97cec83fe189339c05c22492ea9e08e7478afd Mon Sep 17 00:00:00 2001 From: Jiri Date: Thu, 14 Dec 2023 20:00:03 +0100 Subject: [PATCH 26/86] replacing missues of altjava dir by standalone miscinstalldir --- java-latest-openjdk-portable.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index f9e2091..f85d89d 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -436,7 +436,8 @@ # output dir stub %define buildoutputdir() %{expand:build/jdk%{featurever}.build%{?1}} %define installoutputdir() %{expand:install/jdk%{featurever}.install%{?1}} -%global altjavaoutputdir install/altjava.install +%global miscinstalloutputdir install +%global altjavaoutputdir %{miscinstalloutputdir}/altjava.install %define packageoutputdir() %{expand:packages/jdk%{featurever}.packages%{?1}} # we can copy the javadoc to not arched dir, or make it not noarch %define uniquejavadocdir() %{expand:%{fullversion}.%{_arch}%{?1}} @@ -1067,7 +1068,8 @@ EXTRA_CPP_FLAGS="$(echo ${EXTRA_CPP_FLAGS} | sed -e 's|-mstackrealign|-mincoming export EXTRA_CFLAGS EXTRA_CPP_FLAGS echo "Building %{SOURCE11}" -mkdir -p %{altjavaoutputdir} +mkdir %{miscinstalloutputdir} +mkdir %{altjavaoutputdir} gcc ${EXTRA_CFLAGS} -o %{altjavaoutputdir}/%{alt_java_name} %{SOURCE11} echo "Building %{newjavaver}-%{buildver}, pre=%{ea_designator}, opt=%{lts_designator}" @@ -1322,6 +1324,7 @@ function packagejdk() { local srcdir=$(pwd)/%{top_level_dir_name} local tapsetdir=$(pwd)/tapset local altjavadir=$(pwd)/${3} + local gensources=$(pwd)/%{miscinstalloutputdir}/%{generated_sources_name} echo "Packaging build from ${imagesdir} to ${packagesdir}..." mkdir -p ${packagesdir} @@ -1380,7 +1383,8 @@ function packagejdk() { %if %{with_systemtap} cp -a ${tapsetdir}* ${miscname} %endif - cp -avr ${altjavadir}/%{alt_java_name} ${altjavadir}/../%{generated_sources_name} ${miscname} + cp -av ${altjavadir}/%{alt_java_name} ${miscname} + cp -avr ${gensources} ${miscname} tar -cJf ${miscarchive} ${miscname} genchecksum ${miscarchive} fi From 2b512f61b4e7d36e0ba20a2f30d9289f61a86eef Mon Sep 17 00:00:00 2001 From: Jiri Date: Fri, 15 Dec 2023 15:48:01 +0100 Subject: [PATCH 27/86] Function put to lowercase --- java-latest-openjdk-portable.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index f85d89d..e8e9b22 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1294,7 +1294,7 @@ function packFullPatchedSources() { genchecksum ${srcpackagesdir}/%{jdkportablesourcesarchive -- ""} } -function findGeneratedSources() { +function findgeneratedsources() { local targetDir=${1} local targetDirParent=$(dirname ${targetDir}) local builtJdk=${2} @@ -1464,13 +1464,13 @@ for suffix in %{build_loop} ; do buildjdk ${bootbuilddir} ${systemjdk} "%{bootstrap_targets}" ${debugbuild} ${link_opt} ${debug_symbols} installjdk ${bootbuilddir} ${bootinstalldir} buildjdk ${builddir} $(pwd)/${bootinstalldir}/images/%{jdkimage} "${maketargets}" ${debugbuild} ${link_opt} ${debug_symbols} - findGeneratedSources ${installdir} ${builddir} $(pwd)/%{top_level_dir_name} + findgeneratedsources ${installdir} ${builddir} $(pwd)/%{top_level_dir_name} stripjdk ${builddir} installjdk ${builddir} ${installdir} %{!?with_artifacts:rm -rf ${bootinstalldir}} else buildjdk ${builddir} ${systemjdk} "${maketargets}" ${debugbuild} ${link_opt} ${debug_symbols} - findGeneratedSources ${installdir} ${builddir} $(pwd)/%{top_level_dir_name} + findgeneratedsources ${installdir} ${builddir} $(pwd)/%{top_level_dir_name} stripjdk ${builddir} installjdk ${builddir} ${installdir} fi From a71185e830652280780c2d1c5c184feff3f21d2e Mon Sep 17 00:00:00 2001 From: Jiri Date: Tue, 19 Dec 2023 18:30:05 +0100 Subject: [PATCH 28/86] Bumped release for build once/repack everywhere --- java-latest-openjdk-portable.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index e8e9b22..5367fd6 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -393,7 +393,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 12 -%global rpmrelease 3 +%global rpmrelease 4 #%%global tagsuffix %%{nil} # 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 From f1d0e16cc1c23eb5c29a87fb97c05566565181ee Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Thu, 18 Jan 2024 16:25:21 +0100 Subject: [PATCH 29/86] Update to jdk-21.0.2+13 (GA) - Update release notes to 21.0.2+13 - Drop no longer needed local patch to fix versioning - ** This tarball is embargoed until 2024-01-16 @ 1pm PT. ** --- .gitignore | 3 + NEWS | 410 +++++++ generate_source_tarball.sh | 3 - java-latest-openjdk-portable.spec | 38 +- jdk8311630-s390_ffmapi.patch | 1906 ----------------------------- sources | 2 +- 6 files changed, 431 insertions(+), 1931 deletions(-) delete mode 100644 jdk8311630-s390_ffmapi.patch diff --git a/.gitignore b/.gitignore index 3f711a8..36c00d3 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,6 @@ /openjdk-jdk21u-jdk-21+35.tar.xz /openjdk-21+35.tar.xz /openjdk-21.0.1+12.tar.xz +/openjdk-21.0.2+11.tar.xz +/openjdk-21.0.2+12.tar.xz +/openjdk-21.0.2+13.tar.xz diff --git a/NEWS b/NEWS index 09d1dfe..24382b1 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,416 @@ Key: JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY +New in release OpenJDK 21.0.2 (2024-01-16): +=========================================== + +* CVEs + - CVE-2024-20918 + - CVE-2024-20919 + - CVE-2024-20921 + - CVE-2024-20945 + - CVE-2024-20952 +* Security fixes + - JDK-8308204: Enhanced certificate processing + - JDK-8314295: Enhance verification of verifier + - JDK-8314307: Improve loop handling + - JDK-8314468: Improve Compiler loops + - JDK-8316976: Improve signature handling + - JDK-8317547: Enhance TLS connection support +* Other changes + - JDK-8038244: (fs) Check return value of malloc in Java_sun_nio_fs_AixNativeDispatcher_getmntctl() + - JDK-8161536: sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java fails with ProviderException + - JDK-8219652: [aix] Tests failing with JNI attach problems. + - JDK-8225377: type annotations are not visible to javac plugins across compilation boundaries + - JDK-8232839: JDI AfterThreadDeathTest.java failed due to "FAILED: Did not get expected IllegalThreadStateException on a StepRequest.enable()" + - JDK-8267502: JDK-8246677 caused 16x performance regression in SynchronousQueue + - JDK-8267509: Improve IllegalAccessException message to include the cause of the exception + - JDK-8268916: Tests for AffirmTrust roots + - JDK-8286757: adlc tries to build with /pathmap but without /experimental:deterministic + - JDK-8294156: Allow PassFailJFrame.Builder to create test UI + - JDK-8294158: HTML formatting for PassFailJFrame instructions + - JDK-8294427: Check boxes and radio buttons have rendering issues on Windows in High DPI env + - JDK-8294535: Add screen capture functionality to PassFailJFrame + - JDK-8295068: SSLEngine throws NPE parsing CertificateRequests + - JDK-8295555: Primitive wrapper caches could be `@Stable` + - JDK-8299614: Shenandoah: STW mark should keep nmethod/oops referenced from stack chunk alive + - JDK-8300663: java/util/concurrent/SynchronousQueue/Fairness.java failed with "Error: fair=true i=0 j=1" + - JDK-8301247: JPackage app-image exe launches multiple exe's in JDK 17+ + - JDK-8301341: LinkedTransferQueue does not respect timeout for poll() + - JDK-8301457: Code in SendPortZero.java is uncommented even after JDK-8236852 was fixed + - JDK-8301489: C1: ShortLoopOptimizer might lift instructions before their inputs + - JDK-8301846: Invalid TargetDataLine after screen lock when using JFileChooser or COM library + - JDK-8303737: C2: Load can bypass subtype check that enforces it's from the right object type + - JDK-8306561: Possible out of bounds access in print_pointer_information + - JDK-8308103: Massive (up to ~30x) increase in C2 compilation time since JDK 17 + - JDK-8308452: Extend internal Architecture enum with byte order and address size + - JDK-8308479: [s390x] Implement alternative fast-locking scheme + - JDK-8308592: Framework for CA interoperability testing + - JDK-8308593: Add KEEPALIVE Extended Socket Options Support for Windows + - JDK-8309209: C2 failed "assert(_stack_guard_state == stack_guard_reserved_disabled) failed: inconsistent state" + - JDK-8309305: sun/security/ssl/SSLSocketImpl/BlockedAsyncClose.java fails with jtreg test timeout + - JDK-8309545: Thread.interrupted from virtual thread needlessly resets interrupt status + - JDK-8309663: test fails "assert(check_alignment(result)) failed: address not aligned: 0x00000008baadbabe" + - JDK-8309778: java/nio/file/Files/CopyAndMove.java fails when using second test directory + - JDK-8309974: some JVMCI tests fail when VM options include -XX:+EnableJVMCI + - JDK-8310239: Add missing cross modifying fence in nmethod entry barriers + - JDK-8310512: Cleanup indentation in jfc files + - JDK-8310596: Utilize existing method frame::interpreter_frame_monitor_size_in_bytes() + - JDK-8310982: jdk/internal/util/ArchTest.java fails after JDK-8308452 failed with Method isARM() + - JDK-8311261: [AIX] TestAlwaysPreTouchStacks.java fails due to java.lang.RuntimeException: Did not find expected NMT output + - JDK-8311514: Incorrect regex in TestMetaSpaceLog.java + - JDK-8311585: Add JRadioButtonMenuItem to bug8031573.java + - JDK-8311591: Add SystemModulesPlugin test case that splits module descriptors with new local variables defined by DedupSetBuilder + - JDK-8311630: [s390] Implementation of Foreign Function & Memory API (Preview) + - JDK-8311631: When multiple users run tools/jpackage/share/LicenseTest.java, Permission denied for writing /var/tmp/*.files + - JDK-8311680: Update the release version after forking Oct CPU23_10 + - JDK-8311681: Update the Jan CPU24_01 release date in master branch after forking Oct CPU23_10 + - JDK-8311813: C1: Uninitialized PhiResolver::_loop field + - JDK-8311938: Add default cups include location for configure on AIX + - JDK-8312078: [PPC] JcmdScale.java Failing on AIX + - JDK-8312126: NullPointerException in CertStore.getCRLs after 8297955 + - JDK-8312166: (dc) DatagramChannel's socket adaptor does not release carrier thread when blocking in receive + - JDK-8312174: missing JVMTI events from vthreads parked during JVMTI attach + - JDK-8312191: ColorConvertOp.filter for the default destination is too slow + - JDK-8312433: HttpClient request fails due to connection being considered idle and closed + - JDK-8312434: SPECjvm2008/xml.transform with CDS fails with "can't seal package nu.xom" + - JDK-8312440: assert(cast != nullptr) failed: must have added a cast to pin the node + - JDK-8312466: /bin/nm usage in AIX makes needs -X64 flag + - JDK-8312467: relax the builddir check in make/autoconf/basic.m4 + - JDK-8312592: New parentheses warnings after HarfBuzz 7.2.0 update + - JDK-8312612: handle WideCharToMultiByte return values + - JDK-8313164: src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels adjust releasing of resources + - JDK-8313167: Update to use jtreg 7.3 + - JDK-8313206: PKCS11 tests silently skip execution + - JDK-8313244: NM flags handling in configure process + - JDK-8313252: Java_sun_awt_windows_ThemeReader_paintBackground release resources in early returns + - JDK-8313322: RISC-V: implement MD5 intrinsic + - JDK-8313368: (fc) FileChannel.size returns 0 on block special files + - JDK-8313575: Refactor PKCS11Test tests + - JDK-8313616: support loading library members on AIX in os::dll_load + - JDK-8313643: Update HarfBuzz to 8.2.2 + - JDK-8313656: assert(!JvmtiExport::can_support_virtual_threads()) with -XX:-DoJVMTIVirtualThreadTransitions + - JDK-8313756: [BACKOUT] 8308682: Enhance AES performance + - JDK-8313760: [REDO] Enhance AES performance + - JDK-8313779: RISC-V: use andn / orn in the MD5 instrinsic + - JDK-8313781: Add regression tests for large page logging and user-facing error messages + - JDK-8313782: Add user-facing warning if THPs are enabled but cannot be used + - JDK-8313792: Verify 4th party information in src/jdk.internal.le/share/legal/jline.md + - JDK-8313873: java/nio/channels/DatagramChannel/SendReceiveMaxSize.java fails on AIX due to small default RCVBUF size and different IPv6 Header interpretation + - JDK-8314045: ArithmeticException in GaloisCounterMode + - JDK-8314094: java/lang/ProcessHandle/InfoTest.java fails on Windows when run as user with Administrator privileges + - JDK-8314120: Add tests for FileDescriptor.sync + - JDK-8314121: test tools/jpackage/share/RuntimePackageTest.java#id0 fails on RHEL8 + - JDK-8314191: C2 compilation fails with "bad AD file" + - JDK-8314226: Series of colon-style fallthrough switch cases with guards compiled incorrectly + - JDK-8314242: Update applications/scimark/Scimark.java to accept VM flags + - JDK-8314246: javax/swing/JToolBar/4529206/bug4529206.java fails intermittently on Linux + - JDK-8314263: Signed jars triggering Logger finder recursion and StackOverflowError + - JDK-8314330: java/foreign tests should respect vm flags when start new processes + - JDK-8314476: TestJstatdPortAndServer.java failed with "java.rmi.NoSuchObjectException: no such object in table" + - JDK-8314495: Update to use jtreg 7.3.1 + - JDK-8314551: More generic way to handshake GC threads with monitor deflation + - JDK-8314580: PhaseIdealLoop::transform_long_range_checks fails with assert "was tested before" + - JDK-8314632: Intra-case dominance check fails in the presence of a guard + - JDK-8314759: VirtualThread.parkNanos timeout adjustment when pinned should be replaced + - JDK-8314883: Java_java_util_prefs_FileSystemPreferences_lockFile0 write result errno in missing case + - JDK-8314935: Shenandoah: Unable to throw OOME on back-to-back Full GCs + - JDK-8315026: ProcessHandle implementation listing processes on AIX should use getprocs64 + - JDK-8315062: [GHA] get-bootjdk action should return the abolute path + - JDK-8315082: [REDO] Generational ZGC: Tests crash with assert(index == 0 || is_power_of_2(index)) + - JDK-8315088: C2: assert(wq.size() - before == EMPTY_LOOP_SIZE) failed: expect the EMPTY_LOOP_SIZE nodes of this body if empty + - JDK-8315195: RISC-V: Update hwprobe query for new extensions + - JDK-8315206: RISC-V: hwprobe query is_set return wrong value + - JDK-8315213: java/lang/ProcessHandle/TreeTest.java test enhance output of children + - JDK-8315214: Do not run sun/tools/jhsdb tests concurrently + - JDK-8315362: NMT: summary diff reports threads count incorrectly + - JDK-8315377: C2: assert(u->find_out_with(Op_AddP) == nullptr) failed: more than 2 chained AddP nodes? + - JDK-8315383: jlink SystemModulesPlugin incorrectly parses the options + - JDK-8315415: OutputAnalyzer.shouldMatchByLine() fails in some cases + - JDK-8315437: Enable parallelism in vmTestbase/nsk/monitoring/stress/classload tests + - JDK-8315442: Enable parallelism in vmTestbase/nsk/monitoring/stress/thread tests + - JDK-8315452: Erroneous AST missing modifiers for partial input + - JDK-8315499: build using devkit on Linux ppc64le RHEL puts path to devkit into libsplashscreen + - JDK-8315545: C1: x86 cmove can use short branches + - JDK-8315549: CITime misreports code/total nmethod sizes + - JDK-8315554: C1: Replace "cmp reg, 0" with "test reg, reg" on x86 + - JDK-8315578: PPC builds are broken after JDK-8304913 + - JDK-8315579: SPARC64 builds are broken after JDK-8304913 + - JDK-8315606: Open source few swing text/html tests + - JDK-8315612: RISC-V: intrinsic for unsignedMultiplyHigh + - JDK-8315644: increase timeout of sun/security/tools/jarsigner/Warning.java + - JDK-8315651: Stop hiding AIX specific multicast socket errors via NetworkConfiguration (aix) + - JDK-8315683: Parallelize java/util/concurrent/tck/JSR166TestCase.java + - JDK-8315684: Parallelize sun/security/util/math/TestIntegerModuloP.java + - JDK-8315688: Update jdk21u fix version to 21.0.2 + - JDK-8315692: Parallelize gc/stress/TestStressRSetCoarsening.java test + - JDK-8315696: SignedLoggerFinderTest.java test failed + - JDK-8315702: jcmd Thread.dump_to_file slow with millions of virtual threads + - JDK-8315706: com/sun/tools/attach/warnings/DynamicLoadWarningTest.java real fix for failure on AIX + - JDK-8315735: VerifyError when switch statement used with synchronized block + - JDK-8315751: RandomTestBsi1999 fails often with timeouts on Linux ppc64le + - JDK-8315766: Parallelize gc/stress/TestStressIHOPMultiThread.java test + - JDK-8315770: serviceability/sa/TestJmapCoreMetaspace.java should run with -XX:-VerifyDependencies + - JDK-8315774: Enable parallelism in vmTestbase/gc/g1/unloading tests + - JDK-8315863: [GHA] Update checkout action to use v4 + - JDK-8315869: UseHeavyMonitors not used + - JDK-8315920: C2: "control input must dominate current control" assert failure + - JDK-8315931: RISC-V: xxxMaxVectorTestsSmokeTest fails when using RVV + - JDK-8315936: Parallelize gc/stress/TestStressG1Humongous.java test + - JDK-8315937: Enable parallelism in vmTestbase/nsk/stress/numeric tests + - JDK-8315942: Sort platform enums and definitions after JDK-8304913 follow-ups + - JDK-8315960: test/jdk/java/io/File/TempDirDoesNotExist.java leaves test files behind + - JDK-8315971: ProblemList containers/docker/TestMemoryAwareness.java on linux-all + - JDK-8316003: Update FileChooserSymLinkTest.java to HTML instructions + - JDK-8316017: Refactor timeout handler in PassFailJFrame + - JDK-8316025: Use testUI() method of PassFailJFrame.Builder in FileChooserSymLinkTest.java + - JDK-8316030: Update Libpng to 1.6.40 + - JDK-8316031: SSLFlowDelegate should not log from synchronized block + - JDK-8316060: test/hotspot/jtreg/runtime/reflect/ReflectOutOfMemoryError.java may fail if heap is huge + - JDK-8316087: Test SignedLoggerFinderTest.java is still failing + - JDK-8316113: Infinite permission checking loop in java/net/spi/InetAddressResolverProvider/RuntimePermissionTest + - JDK-8316123: ProblemList serviceability/dcmd/gc/RunFinalizationTest.java on AIX + - JDK-8316130: Incorrect control in LibraryCallKit::inline_native_notify_jvmti_funcs + - JDK-8316142: Enable parallelism in vmTestbase/nsk/monitoring/stress/lowmem tests + - JDK-8316156: ByteArrayInputStream.transferTo causes MaxDirectMemorySize overflow + - JDK-8316178: Better diagnostic header for CodeBlobs + - JDK-8316179: Use consistent naming for lightweight locking in MacroAssembler + - JDK-8316181: Move the fast locking implementation out of the .ad files + - JDK-8316199: Remove sun/tools/jstatd/TestJstatd* tests from problemlist for Windows. + - JDK-8316206: Test StretchedFontTest.java fails for Baekmuk font + - JDK-8316304: (fs) Add support for BasicFileAttributes.creationTime() for Linux + - JDK-8316337: (bf) Concurrency issue in DirectByteBuffer.Deallocator + - JDK-8316341: sun/security/pkcs11/PKCS11Test.java needs adjustment on Linux ppc64le Ubuntu 22 + - JDK-8316387: Exclude more failing multicast tests on AIX after JDK-8315651 + - JDK-8316396: Endless loop in C2 compilation triggered by AddNode::IdealIL + - JDK-8316399: Exclude java/net/MulticastSocket/Promiscuous.java on AIX + - JDK-8316400: Exclude jdk/jfr/event/runtime/TestResidentSetSizeEvent.java on AIX + - JDK-8316401: sun/tools/jhsdb/JStackStressTest.java failed with "InternalError: We should have found a thread that owns the anonymous lock" + - JDK-8316411: compiler/compilercontrol/TestConflictInlineCommands.java fails intermittent with force inline by CompileCommand missing + - JDK-8316414: C2: large byte array clone triggers "failed: malformed control flow" assertion failure on linux-x86 + - JDK-8316415: Parallelize sun/security/rsa/SignedObjectChain.java subtests + - JDK-8316418: containers/docker/TestMemoryWithCgroupV1.java get OOM killed with Parallel GC + - JDK-8316436: ContinuationWrapper uses unhandled nullptr oop + - JDK-8316461: Fix: make test outputs TEST SUCCESS after unsuccessful exit + - JDK-8316468: os::write incorrectly handles partial write + - JDK-8316514: Better diagnostic header for VtableStub + - JDK-8316540: StoreReproducibilityTest fails on some locales + - JDK-8316566: RISC-V: Zero extended narrow oop passed to Atomic::cmpxchg + - JDK-8316581: Improve performance of Symbol::print_value_on() + - JDK-8316585: [REDO] runtime/InvocationTests spend a lot of time on dependency verification + - JDK-8316645: RISC-V: Remove dependency on libatomic by adding cmpxchg 1b + - JDK-8316648: jrt-fs.jar classes not reproducible between standard and bootcycle builds + - JDK-8316659: assert(LockingMode != LM_LIGHTWEIGHT || flag == CCR0) failed: bad condition register + - JDK-8316671: sun/security/ssl/SSLSocketImpl/SSLSocketCloseHang.java test fails intermittent with Read timed out + - JDK-8316679: C2 SuperWord: wrong result, load should not be moved before store if not comparable + - JDK-8316710: Exclude java/awt/font/Rotate/RotatedTextTest.java + - JDK-8316719: C2 compilation still fails with "bad AD file" + - JDK-8316735: Print LockStack in hs_err files + - JDK-8316741: BasicStroke.createStrokedShape miter-limits failing on small shapes + - JDK-8316743: RISC-V: Change UseVectorizedMismatchIntrinsic option result to warning + - JDK-8316746: Top of lock-stack does not match the unlocked object + - JDK-8316778: test hprof lib: invalid array element type from JavaValueArray.elementSize + - JDK-8316859: RISC-V: Disable detection of V through HWCAP + - JDK-8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 + - JDK-8316880: AArch64: "stop: Header is not fast-locked" with -XX:-UseLSE since JDK-8315880 + - JDK-8316894: make test TEST="jtreg:test/jdk/..." fails on AIX + - JDK-8316906: Clarify TLABWasteTargetPercent flag + - JDK-8316929: Shenandoah: Shenandoah degenerated GC and full GC need to cleanup old OopMapCache entries + - JDK-8316933: RISC-V: compiler/vectorapi/VectorCastShape128Test.java fails when using RVV + - JDK-8316935: [s390x] Use consistent naming for lightweight locking in MacroAssembler + - JDK-8316958: Add test for unstructured locking + - JDK-8316967: Correct the scope of vmtimer in UnregisteredClasses::load_class + - JDK-8317039: Enable specifying the JDK used to run jtreg + - JDK-8317136: [AIX] Problem List runtime/jni/terminatedThread/TestTerminatedThread.java + - JDK-8317257: RISC-V: llvm build broken + - JDK-8317262: LockStack::contains(oop) fails "assert(t->is_Java_thread()) failed: incorrect cast to JavaThread" + - JDK-8317294: Classloading throws exceptions over already pending exceptions + - JDK-8317327: Remove JT_JAVA dead code in jib-profiles.js + - JDK-8317331: Solaris build failed with "declaration can not follow a statement (E_DECLARATION_IN_CODE)" + - JDK-8317335: Build on windows fails after 8316645 + - JDK-8317336: Assertion error thrown during 'this' escape analysis + - JDK-8317340: Windows builds are not reproducible if MS VS compiler install path differs + - JDK-8317373: Add Telia Root CA v2 + - JDK-8317374: Add Let's Encrypt ISRG Root X2 + - JDK-8317439: Updating RE Configs for BUILD REQUEST 21.0.2+1 + - JDK-8317507: C2 compilation fails with "Exceeded _node_regs array" + - JDK-8317510: Change Windows debug symbol files naming to avoid losing info when an executable and a library share the same name + - JDK-8317581: [s390x] Multiple test failure with LockingMode=2 + - JDK-8317601: Windows build on WSL broken after JDK-8317340 + - JDK-8317603: Improve exception messages thrown by sun.nio.ch.Net native methods (win) + - JDK-8317692: jcmd GC.heap_dump performance regression after JDK-8292818 + - JDK-8317705: ProblemList sun/tools/jstat/jstatLineCountsX.sh on linux-ppc64le and aix due to JDK-8248691 + - JDK-8317706: Exclude java/awt/Graphics2D/DrawString/RotTransText.java on linux + - JDK-8317711: Exclude gtest/GTestWrapper.java on AIX + - JDK-8317736: Stream::handleReset locks twice + - JDK-8317751: ProblemList ConsumeForModalDialogTest.java, MenuItemActivatedTest.java & MouseModifiersUnitTest_Standard.java for windows + - JDK-8317772: NMT: Make peak values available in release builds + - JDK-8317790: Fix Bug entry for exclusion of runtime/jni/terminatedThread/TestTerminatedThread.java on AIX + - JDK-8317803: Exclude java/net/Socket/asyncClose/Race.java on AIX + - JDK-8317807: JAVA_FLAGS removed from jtreg running in JDK-8317039 + - JDK-8317818: Combinatorial explosion during 'this' escape analysis + - JDK-8317834: java/lang/Thread/IsAlive.java timed out + - JDK-8317839: Exclude java/nio/channels/Channels/SocketChannelStreams.java on AIX + - JDK-8317920: JDWP-agent sends broken exception event with onthrow option + - JDK-8317959: Check return values of malloc in native java.base coding + - JDK-8317964: java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java fails on macosx-all after JDK-8317751 + - JDK-8317967: Enhance test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java to handle default cases + - JDK-8317987: C2 recompilations cause high memory footprint + - JDK-8318078: ADLC: pass ASSERT and PRODUCT flags + - JDK-8318089: Class space not marked as such with NMT when CDS is off + - JDK-8318137: Change milestone to fcs for all releases + - JDK-8318144: Match on enum constants with body compiles but fails with MatchException + - JDK-8318183: C2: VM may crash after hitting node limit + - JDK-8318240: [AIX] Cleaners.java test failure + - JDK-8318415: Adjust describing comment of os_getChildren after 8315026 + - JDK-8318474: Fix memory reporter for thread_count + - JDK-8318525: Atomic gtest should run as TEST_VM to access VM capabilities + - JDK-8318528: Rename TestUnstructuredLocking test + - JDK-8318540: make test cannot run .jasm tests directly + - JDK-8318562: Computational test more than 2x slower when AVX instructions are used + - JDK-8318587: refresh libraries cache on AIX in print_vm_info + - JDK-8318591: avoid leaks in loadlib_aix.cpp reload_table() + - JDK-8318669: Target OS detection in 'test-prebuilt' makefile target is incorrect when running on MSYS2 + - JDK-8318705: [macos] ProblemList java/rmi/registry/multipleRegistries/MultipleRegistries.java + - JDK-8318736: com/sun/jdi/JdwpOnThrowTest.java failed with "transport error 202: bind failed: Address already in use" + - JDK-8318759: Add four DigiCert root certificates + - JDK-8318889: C2: add bailout after assert Bad graph detected in build_loop_late + - JDK-8318895: Deoptimization results in incorrect lightweight locking stack + - JDK-8318951: Additional negative value check in JPEG decoding + - JDK-8318953: RISC-V: Small refactoring for MacroAssembler::test_bit + - JDK-8318955: Add ReleaseIntArrayElements in Java_sun_awt_X11_XlibWrapper_SetBitmapShape XlbWrapper.c to early return + - JDK-8318957: enhance agentlib:jdwp help output by info about allow option + - JDK-8318961: increase javacserver connection timeout values and max retry attempts + - JDK-8318981: compiler/compilercontrol/TestConflictInlineCommands.java fails intermittent with 'disallowed by CompileCommand' missing from stdout/stderr + - JDK-8319104: GtestWrapper crashes with SIGILL in AsyncLogTest::test_asynclog_raw on AIX opt + - JDK-8319120: Unbound ScopedValue.get() throws the wrong exception + - JDK-8319184: RISC-V: improve MD5 intrinsic + - JDK-8319187: Add three eMudhra emSign roots + - JDK-8319195: Move most tier 1 vector API regression tests to tier 3 + - JDK-8319268: Build failure with GCC8.3.1 after 8313643 + - JDK-8319339: Internal error on spurious markup in a hybrid snippet + - JDK-8319436: Proxy.newProxyInstance throws NPE if loader is null and interface not visible from class loader + - JDK-8319525: RISC-V: Rename *_riscv64.ad files to *_riscv.ad under riscv/gc + - JDK-8319532: jshell - Non-sealed declarations sometimes break a snippet evaluation + - JDK-8319542: Fix boundaries of region to be tested with os::is_readable_range + - JDK-8319700: [AArch64] C2 compilation fails with "Field too big for insn" + - JDK-8319828: runtime/NMT/VirtualAllocCommitMerge.java may fail if mixing interpreted and compiled native invocations + - JDK-8319922: libCreationTimeHelper.so fails to link in JDK 21 + - JDK-8319958: test/jdk/java/io/File/libGetXSpace.c does not compile on Windows 32-bit + - JDK-8319961: JvmtiEnvBase doesn't zero _ext_event_callbacks + - JDK-8320001: javac crashes while adding type annotations to the return type of a constructor + - JDK-8320053: GHA: Cross-compile gtest code + - JDK-8320209: VectorMaskGen clobbers rflags on x86_64 + - JDK-8320280: RISC-V: Avoid passing t0 as temp register to MacroAssembler::lightweight_lock/unlock + - JDK-8320363: ppc64 TypeEntries::type_unknown logic looks wrong, missed optimization opportunity + - JDK-8320597: RSA signature verification fails on signed data that does not encode params correctly + - JDK-8320601: ProblemList java/lang/invoke/lambda/LambdaFileEncodingSerialization.java on linux-all + - JDK-8321067: Unlock experimental options in EATests.java + - JDK-8322883: [BACKOUT] 8225377: type annotations are not visible to javac plugins across compilation boundaries + - JDK-8322985: [BACKOUT] 8318562: Computational test more than 2x slower when AVX instructions are used + +Notes on individual issues: +=========================== + +core-libs/java.net: + +JDK-8308593: Add KEEPALIVE Extended Socket Options Support for Windows +====================================================================== +On Windows 10 version 1709 and above, TCP_KEEPIDLE and +TCP_KEEPINTERVAL are now supported in the +java.net.ExtendedSocketOptions class. Similarly, on Windows 10 +version 1703 and above, TCP_KEEPCOUNT is now supported. + +hotspot/compiler: + +JDK-8315082: [REDO] Generational ZGC: Tests crash with assert(index == 0 || is_power_of_2(index)) +================================================================================================= +In the initial release of JDK 21, running the JVM with -XX:+UseZGC and +a non-default value of -XX:ObjectAlignmentInBytes could lead to JVM +crashes or incorrect execution. This issue should now be resolved and +it should be possible to use these options again. + +hotspot/runtime: + +JDK-8317772: NMT: Make peak values available in release builds +============================================================== +The peak value is the highest value for committed memory in a given +Native Memory Tracking (NMT) category over the lifetime of the JVM +process. NMT reports will now show the peak value for all categories. + +If the committed memory for a category is at its peak, NMT will +print "at peak". Otherwise, it prints the peak value. + +For example, "Compiler (arena=196KB #4) (peak=6126KB #16)" shows that +compiler arena memory peaked above 6 MB, but now hovers around 200KB. + +JDK-8313782: Add user-facing warning if THPs are enabled but cannot be used +=========================================================================== +On Linux, the JVM will now print the following message to standard +output if Transparent Huge Pages (THPs) are requested, but are not +supported on the operating system: + +"UseTransparentHugePages disabled; transparent huge pages are not +supported by the operating system." + +security-libs/java.security: + +JDK-8317374: Added ISRG Root X2 CA Certificate from Let's Encrypt +================================================================= +The following root certificate has been added to the cacerts +truststore: + +Name: Let's Encrypt +Alias Name: letsencryptisrgx2 +Distinguished Name: CN=ISRG Root X2, O=Internet Security Research Group, C=US + +JDK-8318759: Added Four Root Certificates from DigiCert, Inc. +============================================================= +The following root certificates have been added to the cacerts +truststore: + +Name: DigiCert, Inc. +Alias Name: digicertcseccrootg5 +Distinguished Name: CN=DigiCert CS ECC P384 Root G5, O="DigiCert, Inc.", C=US + +Name: DigiCert, Inc. +Alias Name: digicertcsrsarootg5 +Distinguished Name: CN=DigiCert CS RSA4096 Root G5, O="DigiCert, Inc.", C=US + +Name: DigiCert, Inc. +Alias Name: digicerttlseccrootg5 +Distinguished Name: CN=DigiCert TLS ECC P384 Root G5, O="DigiCert, Inc.", C=US + +Name: DigiCert, Inc. +Alias Name: digicerttlsrsarootg5 +Distinguished Name: CN=DigiCert TLS RSA4096 Root G5, O="DigiCert, Inc.", C=US + +JDK-8319187: Added Three Root Certificates from eMudhra Technologies Limited +============================================================================ +The following root certificates have been added to the cacerts +truststore: + +Name: eMudhra Technologies Limited +Alias Name: emsignrootcag1 +Distinguished Name: CN=emSign Root CA - G1, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN + +Name: eMudhra Technologies Limited +Alias Name: emsigneccrootcag3 +Distinguished Name: CN=emSign ECC Root CA - G3, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN + +Name: eMudhra Technologies Limited +Alias Name: emsignrootcag2 +Distinguished Name: CN=emSign Root CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN + +JDK-8317373: Added Telia Root CA v2 Certificate +=============================================== +The following root certificate has been added to the cacerts +truststore: + +Name: Telia Root CA v2 +Alias Name: teliarootcav2 +Distinguished Name: CN=Telia Root CA v2, O=Telia Finland Oyj, C=FI ``` + New in release OpenJDK 21.0.1 (2023-10-17): =========================================== diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index 5d6efd9..ed24d3e 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -31,9 +31,6 @@ OPENJDK_URL_DEFAULT=https://github.com COMPRESSION_DEFAULT=xz if [ "x$1" = "xhelp" ] ; then - if [ "x$VERSION" = "x" ] ; then - VERSION=""; - fi echo -e "Behaviour may be specified by setting the following variables:\n" echo "VERSION - the version of the specified OpenJDK project" echo "PROJECT_NAME -- the name of the OpenJDK project being archived (optional; only needed by defaults)" diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 5367fd6..125b2dd 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1,8 +1,3 @@ -%if (0%{?rhel} > 0 && 0%{?rhel} < 8) -# portable jdk 17 specific bug, _jvmdir being missing -%define _jvmdir /usr/lib/jvm -%endif - # debug_package %%{nil} is portable-jdks specific %define debug_package %{nil} @@ -328,7 +323,7 @@ # New Version-String scheme-style defines %global featurever 21 %global interimver 0 -%global updatever 1 +%global updatever 2 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, @@ -392,8 +387,8 @@ %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 12 -%global rpmrelease 4 +%global buildver 13 +%global rpmrelease 1 #%%global tagsuffix %%{nil} # 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 @@ -470,7 +465,6 @@ %define jdkportablearchiveForFiles() %(echo %{jdkportablearchive -- ""}) %define jdkportablesourcesarchiveForFiles() %(echo %{jdkportablesourcesarchive -- ""}) %define staticlibsportablearchiveForFiles() %(echo %{staticlibsportablearchive -- ""}) -%define jdkportablesourcesnameForFiles() %(echo %{jdkportablesourcesname -- ""}) ################################################################# # fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349 @@ -554,9 +548,9 @@ ExcludeArch: %{ix86} # portables have grown out of its component, moving back to java-x-vendor # this expression, when declared as global, filled component with java-x-vendor portable -%define component %(echo %{name} | sed "s;-portable;;g") +%define component %(echo %{name} | sed "s;-portable%{?pkgos:-%{pkgos}};;g") -Name: java-latest-%{origin}-portable +Name: java-%{javaver}-%{origin}-portable%{?pkgos:-%{pkgos}} Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as @@ -695,9 +689,6 @@ Patch6: jdk8009550-rh910107-fail_to_load_pcsc_library.patch # ############################################# -# JDK-8311630: [s390] Implementation of Foreign Function & Memory API (Preview) -Patch100: jdk8311630-s390_ffmapi.patch - ############################################# # # Portable build specific patches @@ -750,9 +741,10 @@ BuildRequires: zip BuildRequires: tar BuildRequires: unzip %if (0%{?rhel} > 0 && 0%{?rhel} < 8) -# No javapackages-filesystem on el7,nor is needed for portables +BuildRequires: javapackages-tools +BuildRequires: java-%{buildjdkver}-%{origin}%{?pkgos:-%{pkgos}}-devel %else -# BuildRequires: javapackages-filesystem +BuildRequires: javapackages-filesystem BuildRequires: java-latest-openjdk-devel %endif # Zero-assembler build requirement @@ -787,13 +779,13 @@ Provides: bundled(freetype) = 2.13.0 # Version in src/java.desktop/share/native/libsplashscreen/giflib/gif_lib.h Provides: bundled(giflib) = 5.2.1 # Version in src/java.desktop/share/native/libharfbuzz/hb-version.h -Provides: bundled(harfbuzz) = 7.2.0 +Provides: bundled(harfbuzz) = 8.2.2 # Version in src/java.desktop/share/native/liblcms/lcms2.h Provides: bundled(lcms2) = 2.15.0 # Version in src/java.desktop/share/native/libjavajpeg/jpeglib.h Provides: bundled(libjpeg) = 6b # Version in src/java.desktop/share/native/libsplashscreen/libpng/png.h -Provides: bundled(libpng) = 1.6.39 +Provides: bundled(libpng) = 1.6.40 # We link statically against libstdc++ to increase portability BuildRequires: libstdc++-static %endif @@ -1003,8 +995,6 @@ pushd %{top_level_dir_name} %patch1001 -p1 # Patches in need of upstreaming %patch6 -p1 -# Patches in next release -%patch100 -p1 popd # openjdk @@ -1154,7 +1144,7 @@ function buildjdk() { cat spec.gmk %if (0%{?rhel} > 0 && 0%{?rhel} < 8) - scl enable devtoolset-%{dtsversion} -- make \ + scl enable devtoolset-%{dtsversion} -- make \ %else make \ %endif @@ -1783,6 +1773,12 @@ done %endif %changelog +* Tue Jan 09 2024 Andrew Hughes - 1:21.0.2.0.13-1 +- Update to jdk-21.0.2+13 (GA) +- Update release notes to 21.0.2+13 +- Drop no longer needed local patch to fix versioning +- ** This tarball is embargoed until 2024-01-16 @ 1pm PT. ** + * Wed Dec 13 2023 Jiri Vanek - 1:21.0.1.0.12-3.rolling - packing generated sources diff --git a/jdk8311630-s390_ffmapi.patch b/jdk8311630-s390_ffmapi.patch deleted file mode 100644 index cd3bc08..0000000 --- a/jdk8311630-s390_ffmapi.patch +++ /dev/null @@ -1,1906 +0,0 @@ -commit 27f635fabe7c2933674ad40443906fc35eecf785 -Author: Sidraya Jayagond -Date: Tue Sep 12 09:07:09 2023 +0000 - - 8311630: [s390] Implementation of Foreign Function & Memory API (Preview) - - Backport-of: ec1f7a8480db025a6f405817a106af8e92b69c44 - -diff --git a/src/hotspot/cpu/s390/downcallLinker_s390.cpp b/src/hotspot/cpu/s390/downcallLinker_s390.cpp -index baee7d7a043..f831da90755 100644 ---- a/src/hotspot/cpu/s390/downcallLinker_s390.cpp -+++ b/src/hotspot/cpu/s390/downcallLinker_s390.cpp -@@ -23,8 +23,76 @@ - */ - - #include "precompiled.hpp" -+#include "asm/macroAssembler.inline.hpp" -+#include "code/codeBlob.hpp" -+#include "code/codeCache.hpp" -+#include "code/vmreg.inline.hpp" -+#include "compiler/oopMap.hpp" -+#include "logging/logStream.hpp" -+#include "memory/resourceArea.hpp" - #include "prims/downcallLinker.hpp" --#include "utilities/debug.hpp" -+#include "runtime/globals.hpp" -+#include "runtime/stubCodeGenerator.hpp" -+ -+#define __ _masm-> -+ -+class DowncallStubGenerator : public StubCodeGenerator { -+ BasicType* _signature; -+ int _num_args; -+ BasicType _ret_bt; -+ const ABIDescriptor& _abi; -+ -+ const GrowableArray& _input_registers; -+ const GrowableArray& _output_registers; -+ -+ bool _needs_return_buffer; -+ int _captured_state_mask; -+ bool _needs_transition; -+ -+ int _frame_complete; -+ int _frame_size_slots; -+ OopMapSet* _oop_maps; -+ public: -+ DowncallStubGenerator(CodeBuffer* buffer, -+ BasicType* signature, -+ int num_args, -+ BasicType ret_bt, -+ const ABIDescriptor& abi, -+ const GrowableArray& input_registers, -+ const GrowableArray& output_registers, -+ bool needs_return_buffer, -+ int captured_state_mask, -+ bool needs_transition) -+ :StubCodeGenerator(buffer, PrintMethodHandleStubs), -+ _signature(signature), -+ _num_args(num_args), -+ _ret_bt(ret_bt), -+ _abi(abi), -+ _input_registers(input_registers), -+ _output_registers(output_registers), -+ _needs_return_buffer(needs_return_buffer), -+ _captured_state_mask(captured_state_mask), -+ _needs_transition(needs_transition), -+ _frame_complete(0), -+ _frame_size_slots(0), -+ _oop_maps(nullptr) { -+ } -+ void generate(); -+ int frame_complete() const { -+ return _frame_complete; -+ } -+ -+ int framesize() const { -+ return (_frame_size_slots >> (LogBytesPerWord - LogBytesPerInt)); -+ } -+ -+ OopMapSet* oop_maps() const { -+ return _oop_maps; -+ } -+}; -+ -+static const int native_invoker_code_base_size = 512; -+static const int native_invoker_size_per_args = 8; - - RuntimeStub* DowncallLinker::make_downcall_stub(BasicType* signature, - int num_args, -@@ -35,6 +103,197 @@ RuntimeStub* DowncallLinker::make_downcall_stub(BasicType* signature, - bool needs_return_buffer, - int captured_state_mask, - bool needs_transition) { -- Unimplemented(); -- return nullptr; -+ -+ int code_size = native_invoker_code_base_size + (num_args * native_invoker_size_per_args); -+ int locs_size = 1; //must be non zero -+ CodeBuffer code("nep_invoker_blob", code_size, locs_size); -+ -+ DowncallStubGenerator g(&code, signature, num_args, ret_bt, abi, -+ input_registers, output_registers, -+ needs_return_buffer, captured_state_mask, -+ needs_transition); -+ g.generate(); -+ code.log_section_sizes("nep_invoker_blob"); -+ -+ RuntimeStub* stub = -+ RuntimeStub::new_runtime_stub("nep_invoker_blob", -+ &code, -+ g.frame_complete(), -+ g.framesize(), -+ g.oop_maps(), false); -+ -+#ifndef PRODUCT -+ LogTarget(Trace, foreign, downcall) lt; -+ if (lt.is_enabled()) { -+ ResourceMark rm; -+ LogStream ls(lt); -+ stub->print_on(&ls); -+ } -+#endif -+ -+ return stub; -+} -+ -+void DowncallStubGenerator::generate() { -+ Register call_target_address = Z_R1_scratch, -+ tmp = Z_R0_scratch; -+ -+ VMStorage shuffle_reg = _abi._scratch1; -+ -+ JavaCallingConvention in_conv; -+ NativeCallingConvention out_conv(_input_registers); -+ ArgumentShuffle arg_shuffle(_signature, _num_args, _signature, _num_args, &in_conv, &out_conv, shuffle_reg); -+ -+#ifndef PRODUCT -+ LogTarget(Trace, foreign, downcall) lt; -+ if (lt.is_enabled()) { -+ ResourceMark rm; -+ LogStream ls(lt); -+ arg_shuffle.print_on(&ls); -+ } -+#endif -+ -+ assert(_abi._shadow_space_bytes == frame::z_abi_160_size, "expected space according to ABI"); -+ int allocated_frame_size = _abi._shadow_space_bytes; -+ allocated_frame_size += arg_shuffle.out_arg_bytes(); -+ -+ assert(!_needs_return_buffer, "unexpected needs_return_buffer"); -+ RegSpiller out_reg_spiller(_output_registers); -+ int spill_offset = allocated_frame_size; -+ allocated_frame_size += BytesPerWord; -+ -+ StubLocations locs; -+ locs.set(StubLocations::TARGET_ADDRESS, _abi._scratch2); -+ -+ if (_captured_state_mask != 0) { -+ __ block_comment("{ _captured_state_mask is set"); -+ locs.set_frame_data(StubLocations::CAPTURED_STATE_BUFFER, allocated_frame_size); -+ allocated_frame_size += BytesPerWord; -+ __ block_comment("} _captured_state_mask is set"); -+ } -+ -+ allocated_frame_size = align_up(allocated_frame_size, StackAlignmentInBytes); -+ _frame_size_slots = allocated_frame_size >> LogBytesPerInt; -+ -+ _oop_maps = _needs_transition ? new OopMapSet() : nullptr; -+ address start = __ pc(); -+ -+ __ save_return_pc(); -+ __ push_frame(allocated_frame_size, Z_R11); // Create a new frame for the wrapper. -+ -+ _frame_complete = __ pc() - start; // frame build complete. -+ -+ if (_needs_transition) { -+ __ block_comment("{ thread java2native"); -+ __ get_PC(Z_R1_scratch); -+ address the_pc = __ pc(); -+ __ set_last_Java_frame(Z_SP, Z_R1_scratch); -+ -+ OopMap* map = new OopMap(_frame_size_slots, 0); -+ _oop_maps->add_gc_map(the_pc - start, map); -+ -+ // State transition -+ __ set_thread_state(_thread_in_native); -+ __ block_comment("} thread java2native"); -+ } -+ __ block_comment("{ argument shuffle"); -+ arg_shuffle.generate(_masm, shuffle_reg, frame::z_jit_out_preserve_size, _abi._shadow_space_bytes, locs); -+ __ block_comment("} argument shuffle"); -+ -+ __ call(as_Register(locs.get(StubLocations::TARGET_ADDRESS))); -+ -+ ////////////////////////////////////////////////////////////////////////////// -+ -+ if (_captured_state_mask != 0) { -+ __ block_comment("{ save thread local"); -+ -+ out_reg_spiller.generate_spill(_masm, spill_offset); -+ -+ __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, DowncallLinker::capture_state)); -+ __ z_lg(Z_ARG1, Address(Z_SP, locs.data_offset(StubLocations::CAPTURED_STATE_BUFFER))); -+ __ load_const_optimized(Z_ARG2, _captured_state_mask); -+ __ call(call_target_address); -+ -+ out_reg_spiller.generate_fill(_masm, spill_offset); -+ -+ __ block_comment("} save thread local"); -+ } -+ -+ ////////////////////////////////////////////////////////////////////////////// -+ -+ Label L_after_safepoint_poll; -+ Label L_safepoint_poll_slow_path; -+ Label L_reguard; -+ Label L_after_reguard; -+ -+ if (_needs_transition) { -+ __ block_comment("{ thread native2java"); -+ __ set_thread_state(_thread_in_native_trans); -+ -+ if (!UseSystemMemoryBarrier) { -+ __ z_fence(); // Order state change wrt. safepoint poll. -+ } -+ -+ __ safepoint_poll(L_safepoint_poll_slow_path, tmp); -+ -+ __ load_and_test_int(tmp, Address(Z_thread, JavaThread::suspend_flags_offset())); -+ __ z_brne(L_safepoint_poll_slow_path); -+ -+ __ bind(L_after_safepoint_poll); -+ -+ // change thread state -+ __ set_thread_state(_thread_in_Java); -+ -+ __ block_comment("reguard stack check"); -+ __ z_cli(Address(Z_thread, JavaThread::stack_guard_state_offset() + in_ByteSize(sizeof(StackOverflow::StackGuardState) - 1)), -+ StackOverflow::stack_guard_yellow_reserved_disabled); -+ __ z_bre(L_reguard); -+ __ bind(L_after_reguard); -+ -+ __ reset_last_Java_frame(); -+ __ block_comment("} thread native2java"); -+ } -+ -+ __ pop_frame(); -+ __ restore_return_pc(); // This is the way back to the caller. -+ __ z_br(Z_R14); -+ -+ ////////////////////////////////////////////////////////////////////////////// -+ -+ if (_needs_transition) { -+ __ block_comment("{ L_safepoint_poll_slow_path"); -+ __ bind(L_safepoint_poll_slow_path); -+ -+ // Need to save the native result registers around any runtime calls. -+ out_reg_spiller.generate_spill(_masm, spill_offset); -+ -+ __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, JavaThread::check_special_condition_for_native_trans)); -+ __ z_lgr(Z_ARG1, Z_thread); -+ __ call(call_target_address); -+ -+ out_reg_spiller.generate_fill(_masm, spill_offset); -+ -+ __ z_bru(L_after_safepoint_poll); -+ __ block_comment("} L_safepoint_poll_slow_path"); -+ -+ ////////////////////////////////////////////////////////////////////////////// -+ __ block_comment("{ L_reguard"); -+ __ bind(L_reguard); -+ -+ // Need to save the native result registers around any runtime calls. -+ out_reg_spiller.generate_spill(_masm, spill_offset); -+ -+ __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, SharedRuntime::reguard_yellow_pages)); -+ __ call(call_target_address); -+ -+ out_reg_spiller.generate_fill(_masm, spill_offset); -+ -+ __ z_bru(L_after_reguard); -+ -+ __ block_comment("} L_reguard"); -+ } -+ -+ ////////////////////////////////////////////////////////////////////////////// -+ -+ __ flush(); - } -diff --git a/src/hotspot/cpu/s390/foreignGlobals_s390.cpp b/src/hotspot/cpu/s390/foreignGlobals_s390.cpp -index d3a318536bd..9796ab4ffe4 100644 ---- a/src/hotspot/cpu/s390/foreignGlobals_s390.cpp -+++ b/src/hotspot/cpu/s390/foreignGlobals_s390.cpp -@@ -23,34 +23,209 @@ - */ - - #include "precompiled.hpp" --#include "code/vmreg.hpp" -+#include "asm/macroAssembler.inline.hpp" -+#include "code/vmreg.inline.hpp" -+#include "runtime/jniHandles.hpp" -+#include "runtime/jniHandles.inline.hpp" -+#include "oops/typeArrayOop.inline.hpp" -+#include "oops/oopCast.inline.hpp" - #include "prims/foreignGlobals.hpp" --#include "utilities/debug.hpp" -+#include "prims/foreignGlobals.inline.hpp" -+#include "prims/vmstorage.hpp" -+#include "utilities/formatBuffer.hpp" - --class MacroAssembler; -+#define __ masm-> -+ -+bool ABIDescriptor::is_volatile_reg(Register reg) const { -+ return _integer_volatile_registers.contains(reg); -+} -+ -+bool ABIDescriptor::is_volatile_reg(FloatRegister reg) const { -+ return _float_argument_registers.contains(reg) -+ || _float_additional_volatile_registers.contains(reg); -+} - - bool ForeignGlobals::is_foreign_linker_supported() { -- return false; -+ return true; - } - - const ABIDescriptor ForeignGlobals::parse_abi_descriptor(jobject jabi) { -- Unimplemented(); -- return {}; -+ oop abi_oop = JNIHandles::resolve_non_null(jabi); -+ ABIDescriptor abi; -+ -+ objArrayOop inputStorage = jdk_internal_foreign_abi_ABIDescriptor::inputStorage(abi_oop); -+ parse_register_array(inputStorage, StorageType::INTEGER, abi._integer_argument_registers, as_Register); -+ parse_register_array(inputStorage, StorageType::FLOAT, abi._float_argument_registers, as_FloatRegister); -+ -+ objArrayOop outputStorage = jdk_internal_foreign_abi_ABIDescriptor::outputStorage(abi_oop); -+ parse_register_array(outputStorage, StorageType::INTEGER, abi._integer_return_registers, as_Register); -+ parse_register_array(outputStorage, StorageType::FLOAT, abi._float_return_registers, as_FloatRegister); -+ -+ objArrayOop volatileStorage = jdk_internal_foreign_abi_ABIDescriptor::volatileStorage(abi_oop); -+ parse_register_array(volatileStorage, StorageType::INTEGER, abi._integer_volatile_registers, as_Register); -+ parse_register_array(volatileStorage, StorageType::FLOAT, abi._float_additional_volatile_registers, as_FloatRegister); -+ -+ abi._stack_alignment_bytes = jdk_internal_foreign_abi_ABIDescriptor::stackAlignment(abi_oop); -+ abi._shadow_space_bytes = jdk_internal_foreign_abi_ABIDescriptor::shadowSpace(abi_oop); -+ -+ abi._scratch1 = parse_vmstorage(jdk_internal_foreign_abi_ABIDescriptor::scratch1(abi_oop)); -+ abi._scratch2 = parse_vmstorage(jdk_internal_foreign_abi_ABIDescriptor::scratch2(abi_oop)); -+ -+ return abi; - } - - int RegSpiller::pd_reg_size(VMStorage reg) { -- Unimplemented(); -- return -1; -+ if (reg.type() == StorageType::INTEGER || reg.type() == StorageType::FLOAT) { -+ return 8; -+ } -+ return 0; // stack and BAD - } - - void RegSpiller::pd_store_reg(MacroAssembler* masm, int offset, VMStorage reg) { -- Unimplemented(); -+ if (reg.type() == StorageType::INTEGER) { -+ __ reg2mem_opt(as_Register(reg), Address(Z_SP, offset), true); -+ } else if (reg.type() == StorageType::FLOAT) { -+ __ freg2mem_opt(as_FloatRegister(reg), Address(Z_SP, offset), true); -+ } else { -+ // stack and BAD -+ } - } - - void RegSpiller::pd_load_reg(MacroAssembler* masm, int offset, VMStorage reg) { -- Unimplemented(); -+ if (reg.type() == StorageType::INTEGER) { -+ __ mem2reg_opt(as_Register(reg), Address(Z_SP, offset), true); -+ } else if (reg.type() == StorageType::FLOAT) { -+ __ mem2freg_opt(as_FloatRegister(reg), Address(Z_SP, offset), true); -+ } else { -+ // stack and BAD -+ } -+} -+ -+static int reg2offset(VMStorage vms, int stk_bias) { -+ assert(!vms.is_reg(), "wrong usage"); -+ return vms.index_or_offset() + stk_bias; -+} -+ -+static void move_reg(MacroAssembler* masm, int out_stk_bias, -+ VMStorage from_reg, VMStorage to_reg) { -+ int out_bias = 0; -+ switch (to_reg.type()) { -+ case StorageType::INTEGER: -+ if (to_reg.segment_mask() == REG64_MASK && from_reg.segment_mask() == REG32_MASK ) { -+ // see CCallingConventionRequiresIntsAsLongs -+ __ z_lgfr(as_Register(to_reg), as_Register(from_reg)); -+ } else { -+ __ lgr_if_needed(as_Register(to_reg), as_Register(from_reg)); -+ } -+ break; -+ case StorageType::STACK: -+ out_bias = out_stk_bias; //fallthrough -+ case StorageType::FRAME_DATA: { -+ // Integer types always get a 64 bit slot in C. -+ if (from_reg.segment_mask() == REG32_MASK) { -+ // see CCallingConventionRequiresIntsAsLongs -+ __ z_lgfr(as_Register(from_reg), as_Register(from_reg)); -+ } -+ switch (to_reg.stack_size()) { -+ case 8: __ reg2mem_opt(as_Register(from_reg), Address(Z_SP, reg2offset(to_reg, out_bias)), true); break; -+ case 4: __ reg2mem_opt(as_Register(from_reg), Address(Z_SP, reg2offset(to_reg, out_bias)), false); break; -+ default: ShouldNotReachHere(); -+ } -+ } break; -+ default: ShouldNotReachHere(); -+ } -+} -+ -+static void move_float(MacroAssembler* masm, int out_stk_bias, -+ VMStorage from_reg, VMStorage to_reg) { -+ switch (to_reg.type()) { -+ case StorageType::FLOAT: -+ if (from_reg.segment_mask() == REG64_MASK) -+ __ move_freg_if_needed(as_FloatRegister(to_reg), T_DOUBLE, as_FloatRegister(from_reg), T_DOUBLE); -+ else -+ __ move_freg_if_needed(as_FloatRegister(to_reg), T_FLOAT, as_FloatRegister(from_reg), T_FLOAT); -+ break; -+ case StorageType::STACK: -+ if (from_reg.segment_mask() == REG64_MASK) { -+ assert(to_reg.stack_size() == 8, "size should match"); -+ __ freg2mem_opt(as_FloatRegister(from_reg), Address(Z_SP, reg2offset(to_reg, out_stk_bias)), true); -+ } else { -+ assert(to_reg.stack_size() == 4, "size should match"); -+ __ freg2mem_opt(as_FloatRegister(from_reg), Address(Z_SP, reg2offset(to_reg, out_stk_bias)), false); -+ } -+ break; -+ default: ShouldNotReachHere(); -+ } -+} -+ -+static void move_stack(MacroAssembler* masm, Register tmp_reg, int in_stk_bias, int out_stk_bias, -+ VMStorage from_reg, VMStorage to_reg) { -+ int out_bias = 0; -+ Address from_addr(Z_R11, reg2offset(from_reg, in_stk_bias)); -+ switch (to_reg.type()) { -+ case StorageType::INTEGER: -+ switch (from_reg.stack_size()) { -+ case 8: __ mem2reg_opt(as_Register(to_reg), from_addr, true);break; -+ case 4: __ mem2reg_opt(as_Register(to_reg), from_addr, false);break; -+ default: ShouldNotReachHere(); -+ } -+ break; -+ case StorageType::FLOAT: -+ switch (from_reg.stack_size()) { -+ case 8: __ mem2freg_opt(as_FloatRegister(to_reg), from_addr, true);break; -+ case 4: __ mem2freg_opt(as_FloatRegister(to_reg), from_addr, false);break; -+ default: ShouldNotReachHere(); -+ } -+ break; -+ case StorageType::STACK: -+ out_bias = out_stk_bias; // fallthrough -+ case StorageType::FRAME_DATA: { -+ switch (from_reg.stack_size()) { -+ case 8: __ mem2reg_opt(tmp_reg, from_addr, true); break; -+ case 4: if (to_reg.stack_size() == 8) { -+ __ mem2reg_signed_opt(tmp_reg, from_addr); -+ } else { -+ __ mem2reg_opt(tmp_reg, from_addr, false); -+ } -+ break; -+ default: ShouldNotReachHere(); -+ } -+ switch (to_reg.stack_size()) { -+ case 8: __ reg2mem_opt(tmp_reg, Address (Z_SP, reg2offset(to_reg, out_bias)), true); break; -+ case 4: __ reg2mem_opt(tmp_reg, Address (Z_SP, reg2offset(to_reg, out_bias)), false); break; -+ default: ShouldNotReachHere(); -+ } -+ } break; -+ default: ShouldNotReachHere(); -+ } - } - - void ArgumentShuffle::pd_generate(MacroAssembler* masm, VMStorage tmp, int in_stk_bias, int out_stk_bias, const StubLocations& locs) const { -- Unimplemented(); -+ Register tmp_reg = as_Register(tmp); -+ for (int i = 0; i < _moves.length(); i++) { -+ Move move = _moves.at(i); -+ VMStorage from_reg = move.from; -+ VMStorage to_reg = move.to; -+ -+ // replace any placeholders -+ if (from_reg.type() == StorageType::PLACEHOLDER) { -+ from_reg = locs.get(from_reg); -+ } -+ if (to_reg.type() == StorageType::PLACEHOLDER) { -+ to_reg = locs.get(to_reg); -+ } -+ -+ switch (from_reg.type()) { -+ case StorageType::INTEGER: -+ move_reg(masm, out_stk_bias, from_reg, to_reg); -+ break; -+ case StorageType::FLOAT: -+ move_float(masm, out_stk_bias, from_reg, to_reg); -+ break; -+ case StorageType::STACK: -+ move_stack(masm, tmp_reg, in_stk_bias, out_stk_bias, from_reg, to_reg); -+ break; -+ default: ShouldNotReachHere(); -+ } -+ } - } -diff --git a/src/hotspot/cpu/s390/foreignGlobals_s390.hpp b/src/hotspot/cpu/s390/foreignGlobals_s390.hpp -index 8b86a2b06a6..4ff3b3e40b4 100644 ---- a/src/hotspot/cpu/s390/foreignGlobals_s390.hpp -+++ b/src/hotspot/cpu/s390/foreignGlobals_s390.hpp -@@ -24,6 +24,23 @@ - #ifndef CPU_S390_VM_FOREIGN_GLOBALS_S390_HPP - #define CPU_S390_VM_FOREIGN_GLOBALS_S390_HPP - --class ABIDescriptor {}; -+struct ABIDescriptor { -+ GrowableArray _integer_argument_registers; -+ GrowableArray _integer_return_registers; -+ GrowableArray _float_argument_registers; -+ GrowableArray _float_return_registers; -+ -+ GrowableArray _integer_volatile_registers; -+ GrowableArray _float_additional_volatile_registers; -+ -+ int32_t _stack_alignment_bytes; -+ int32_t _shadow_space_bytes; -+ -+ VMStorage _scratch1; -+ VMStorage _scratch2; -+ -+ bool is_volatile_reg(Register reg) const; -+ bool is_volatile_reg(FloatRegister reg) const; -+}; - - #endif // CPU_S390_VM_FOREIGN_GLOBALS_S390_HPP -diff --git a/src/hotspot/cpu/s390/frame_s390.cpp b/src/hotspot/cpu/s390/frame_s390.cpp -index 23547fa6617..ac24e43f00c 100644 ---- a/src/hotspot/cpu/s390/frame_s390.cpp -+++ b/src/hotspot/cpu/s390/frame_s390.cpp -@@ -218,13 +218,32 @@ frame frame::sender_for_entry_frame(RegisterMap *map) const { - } - - UpcallStub::FrameData* UpcallStub::frame_data_for_frame(const frame& frame) const { -- ShouldNotCallThis(); -- return nullptr; -+ assert(frame.is_upcall_stub_frame(), "wrong frame"); -+ // need unextended_sp here, since normal sp is wrong for interpreter callees -+ return reinterpret_cast( -+ reinterpret_cast
(frame.unextended_sp()) + in_bytes(_frame_data_offset)); - } - - bool frame::upcall_stub_frame_is_first() const { -- ShouldNotCallThis(); -- return false; -+ assert(is_upcall_stub_frame(), "must be optimized entry frame"); -+ UpcallStub* blob = _cb->as_upcall_stub(); -+ JavaFrameAnchor* jfa = blob->jfa_for_frame(*this); -+ return jfa->last_Java_sp() == nullptr; -+} -+ -+frame frame::sender_for_upcall_stub_frame(RegisterMap* map) const { -+ assert(map != nullptr, "map must be set"); -+ UpcallStub* blob = _cb->as_upcall_stub(); -+ // Java frame called from C; skip all C frames and return top C -+ // frame of that chunk as the sender -+ JavaFrameAnchor* jfa = blob->jfa_for_frame(*this); -+ assert(!upcall_stub_frame_is_first(), "must have a frame anchor to go back to"); -+ assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack"); -+ map->clear(); -+ assert(map->include_argument_oops(), "should be set by clear"); -+ frame fr(jfa->last_Java_sp(), jfa->last_Java_pc()); -+ -+ return fr; - } - - frame frame::sender_for_interpreter_frame(RegisterMap *map) const { -diff --git a/src/hotspot/cpu/s390/frame_s390.inline.hpp b/src/hotspot/cpu/s390/frame_s390.inline.hpp -index dfa68940bac..c188618653d 100644 ---- a/src/hotspot/cpu/s390/frame_s390.inline.hpp -+++ b/src/hotspot/cpu/s390/frame_s390.inline.hpp -@@ -352,12 +352,10 @@ inline frame frame::sender(RegisterMap* map) const { - // update it accordingly. - map->set_include_argument_oops(false); - -- if (is_entry_frame()) { -- return sender_for_entry_frame(map); -- } -- if (is_interpreted_frame()) { -- return sender_for_interpreter_frame(map); -- } -+ if (is_entry_frame()) return sender_for_entry_frame(map); -+ if (is_upcall_stub_frame()) return sender_for_upcall_stub_frame(map); -+ if (is_interpreted_frame()) return sender_for_interpreter_frame(map); -+ - assert(_cb == CodeCache::find_blob(pc()),"Must be the same"); - if (_cb != nullptr) return sender_for_compiled_frame(map); - -diff --git a/src/hotspot/cpu/s390/globalDefinitions_s390.hpp b/src/hotspot/cpu/s390/globalDefinitions_s390.hpp -index 99906bb369e..2232215a587 100644 ---- a/src/hotspot/cpu/s390/globalDefinitions_s390.hpp -+++ b/src/hotspot/cpu/s390/globalDefinitions_s390.hpp -@@ -28,7 +28,7 @@ - - #define ShortenBranches true - --const int StackAlignmentInBytes = 16; -+const int StackAlignmentInBytes = 8; - - #define SUPPORTS_NATIVE_CX8 - -diff --git a/src/hotspot/cpu/s390/methodHandles_s390.cpp b/src/hotspot/cpu/s390/methodHandles_s390.cpp -index 6392ba45a6c..ef8722f2499 100644 ---- a/src/hotspot/cpu/s390/methodHandles_s390.cpp -+++ b/src/hotspot/cpu/s390/methodHandles_s390.cpp -@@ -349,7 +349,16 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* - - void MethodHandles::jump_to_native_invoker(MacroAssembler* _masm, Register nep_reg, Register temp_target) { - BLOCK_COMMENT("jump_to_native_invoker {"); -- __ should_not_reach_here(); -+ assert(nep_reg != noreg, "required register"); -+ -+ // Load the invoker, as NEP -> .invoker -+ __ verify_oop(nep_reg); -+ -+ __ z_lg(temp_target, Address(nep_reg, -+ NONZERO(jdk_internal_foreign_abi_NativeEntryPoint::downcall_stub_address_offset_in_bytes()))); -+ -+ __ z_br(temp_target); -+ - BLOCK_COMMENT("} jump_to_native_invoker"); - } - -diff --git a/src/hotspot/cpu/s390/upcallLinker_s390.cpp b/src/hotspot/cpu/s390/upcallLinker_s390.cpp -index 3e1fb04218b..b748ec547cc 100644 ---- a/src/hotspot/cpu/s390/upcallLinker_s390.cpp -+++ b/src/hotspot/cpu/s390/upcallLinker_s390.cpp -@@ -22,15 +22,287 @@ - */ - - #include "precompiled.hpp" -+#include "asm/macroAssembler.inline.hpp" -+#include "logging/logStream.hpp" -+#include "memory/resourceArea.hpp" - #include "prims/upcallLinker.hpp" --#include "utilities/debug.hpp" -+#include "runtime/sharedRuntime.hpp" -+#include "runtime/signature.hpp" -+#include "runtime/stubRoutines.hpp" -+#include "utilities/formatBuffer.hpp" -+#include "utilities/globalDefinitions.hpp" - -+#define __ _masm-> -+ -+// for callee saved regs, according to the caller's ABI -+static int compute_reg_save_area_size(const ABIDescriptor& abi) { -+ int size = 0; -+ for (int i = 0; i < Register::number_of_registers; i++) { -+ Register reg = as_Register(i); -+ // Z_SP saved/restored by prologue/epilogue -+ if (reg == Z_SP) continue; -+ if (!abi.is_volatile_reg(reg)) { -+ size += 8; // bytes -+ } -+ } -+ -+ for (int i = 0; i < FloatRegister::number_of_registers; i++) { -+ FloatRegister reg = as_FloatRegister(i); -+ if (!abi.is_volatile_reg(reg)) { -+ size += 8; // bytes -+ } -+ } -+ -+ return size; -+} -+ -+static void preserve_callee_saved_registers(MacroAssembler* _masm, const ABIDescriptor& abi, int reg_save_area_offset) { -+ // 1. iterate all registers in the architecture -+ // - check if they are volatile or not for the given abi -+ // - if NOT, we need to save it here -+ -+ int offset = reg_save_area_offset; -+ -+ __ block_comment("{ preserve_callee_saved_regs "); -+ for (int i = 0; i < Register::number_of_registers; i++) { -+ Register reg = as_Register(i); -+ // Z_SP saved/restored by prologue/epilogue -+ if (reg == Z_SP) continue; -+ if (!abi.is_volatile_reg(reg)) { -+ __ z_stg(reg, Address(Z_SP, offset)); -+ offset += 8; -+ } -+ } -+ -+ for (int i = 0; i < FloatRegister::number_of_registers; i++) { -+ FloatRegister reg = as_FloatRegister(i); -+ if (!abi.is_volatile_reg(reg)) { -+ __ z_std(reg, Address(Z_SP, offset)); -+ offset += 8; -+ } -+ } -+ -+ __ block_comment("} preserve_callee_saved_regs "); -+} -+ -+static void restore_callee_saved_registers(MacroAssembler* _masm, const ABIDescriptor& abi, int reg_save_area_offset) { -+ // 1. iterate all registers in the architecture -+ // - check if they are volatile or not for the given abi -+ // - if NOT, we need to restore it here -+ -+ int offset = reg_save_area_offset; -+ -+ __ block_comment("{ restore_callee_saved_regs "); -+ for (int i = 0; i < Register::number_of_registers; i++) { -+ Register reg = as_Register(i); -+ // Z_SP saved/restored by prologue/epilogue -+ if (reg == Z_SP) continue; -+ if (!abi.is_volatile_reg(reg)) { -+ __ z_lg(reg, Address(Z_SP, offset)); -+ offset += 8; -+ } -+ } -+ -+ for (int i = 0; i < FloatRegister::number_of_registers; i++) { -+ FloatRegister reg = as_FloatRegister(i); -+ if (!abi.is_volatile_reg(reg)) { -+ __ z_ld(reg, Address(Z_SP, offset)); -+ offset += 8; -+ } -+ } -+ -+ __ block_comment("} restore_callee_saved_regs "); -+} -+ -+static const int upcall_stub_code_base_size = 1024; // depends on GC (resolve_jobject) -+static const int upcall_stub_size_per_arg = 16; // arg save & restore + move - address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, - BasicType* in_sig_bt, int total_in_args, - BasicType* out_sig_bt, int total_out_args, - BasicType ret_type, - jobject jabi, jobject jconv, - bool needs_return_buffer, int ret_buf_size) { -- ShouldNotCallThis(); -- return nullptr; -+ ResourceMark rm; -+ const ABIDescriptor abi = ForeignGlobals::parse_abi_descriptor(jabi); -+ const CallRegs call_regs = ForeignGlobals::parse_call_regs(jconv); -+ int code_size = upcall_stub_code_base_size + (total_in_args * upcall_stub_size_per_arg); -+ CodeBuffer buffer("upcall_stub", code_size, /* locs_size = */ 0); -+ -+ Register call_target_address = Z_R1_scratch; -+ -+ VMStorage shuffle_reg = abi._scratch1; -+ JavaCallingConvention out_conv; -+ NativeCallingConvention in_conv(call_regs._arg_regs); -+ ArgumentShuffle arg_shuffle(in_sig_bt, total_in_args, out_sig_bt, total_out_args, &in_conv, &out_conv, shuffle_reg); -+ -+ // The Java call uses the JIT ABI, but we also call C. -+ int out_arg_area = MAX2(frame::z_jit_out_preserve_size + arg_shuffle.out_arg_bytes(), (int)frame::z_abi_160_size); -+ -+#ifndef PRODUCT -+ LogTarget(Trace, foreign, upcall) lt; -+ if (lt.is_enabled()) { -+ ResourceMark rm; -+ LogStream ls(lt); -+ arg_shuffle.print_on(&ls); -+ } -+#endif -+ -+ -+ int reg_save_area_size = compute_reg_save_area_size(abi); -+ RegSpiller arg_spiller(call_regs._arg_regs); -+ RegSpiller result_spiller(call_regs._ret_regs); -+ -+ int res_save_area_offset = out_arg_area; -+ int arg_save_area_offset = res_save_area_offset + result_spiller.spill_size_bytes(); -+ int reg_save_area_offset = arg_save_area_offset + arg_spiller.spill_size_bytes(); -+ int frame_data_offset = reg_save_area_offset + reg_save_area_size; -+ int frame_bottom_offset = frame_data_offset + sizeof(UpcallStub::FrameData); -+ -+ int frame_size = align_up(frame_bottom_offset, StackAlignmentInBytes); -+ StubLocations locs; -+ -+ // The space we have allocated will look like: -+ // -+ // -+ // FP-> | | -+ // |---------------------| = frame_bottom_offset = frame_size -+ // | | -+ // | FrameData | -+ // |---------------------| = frame_data_offset -+ // | | -+ // | reg_save_area | -+ // |---------------------| = reg_save_are_offset -+ // | | -+ // | arg_save_area | -+ // |---------------------| = arg_save_are_offset -+ // | | -+ // | res_save_area | -+ // |---------------------| = res_save_are_offset -+ // | | -+ // SP-> | out_arg_area | needs to be at end for shadow space -+ // -+ // -+ -+ ////////////////////////////////////////////////////////////////////////////// -+ -+ MacroAssembler* _masm = new MacroAssembler(&buffer); -+ address start = __ pc(); -+ -+ __ save_return_pc(); -+ assert((abi._stack_alignment_bytes % StackAlignmentInBytes) == 0, "must be 8 byte aligned"); -+ // allocate frame (frame_size is also aligned, so stack is still aligned) -+ __ push_frame(frame_size); -+ -+ // we have to always spill args since we need to do a call to get the thread -+ // (and maybe attach it). -+ arg_spiller.generate_spill(_masm, arg_save_area_offset); -+ // Java methods won't preserve them, so save them here: -+ preserve_callee_saved_registers(_masm, abi, reg_save_area_offset); -+ -+ __ block_comment("{ on_entry"); -+ __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, UpcallLinker::on_entry)); -+ __ z_aghik(Z_ARG1, Z_SP, frame_data_offset); -+ __ call(call_target_address); -+ __ z_lgr(Z_thread, Z_RET); -+ __ block_comment("} on_entry"); -+ -+ arg_spiller.generate_fill(_masm, arg_save_area_offset); -+ __ block_comment("{ argument shuffle"); -+ arg_shuffle.generate(_masm, shuffle_reg, abi._shadow_space_bytes, frame::z_jit_out_preserve_size, locs); -+ __ block_comment("} argument shuffle"); -+ -+ __ block_comment("{ receiver "); -+ __ load_const_optimized(Z_ARG1, (intptr_t)receiver); -+ __ resolve_jobject(Z_ARG1, Z_tmp_1, Z_tmp_2); -+ __ block_comment("} receiver "); -+ -+ __ load_const_optimized(Z_method, (intptr_t)entry); -+ __ z_stg(Z_method, Address(Z_thread, in_bytes(JavaThread::callee_target_offset()))); -+ -+ __ z_lg(call_target_address, Address(Z_method, in_bytes(Method::from_compiled_offset()))); -+ __ call(call_target_address); -+ -+ // return value shuffle -+ assert(!needs_return_buffer, "unexpected needs_return_buffer"); -+ // CallArranger can pick a return type that goes in the same reg for both CCs. -+ if (call_regs._ret_regs.length() > 0) { // 0 or 1 -+ VMStorage ret_reg = call_regs._ret_regs.at(0); -+ // Check if the return reg is as expected. -+ switch (ret_type) { -+ case T_BOOLEAN: -+ case T_BYTE: -+ case T_SHORT: -+ case T_CHAR: -+ case T_INT: -+ __ z_lgfr(Z_RET, Z_RET); // Clear garbage in high half. -+ // fallthrough -+ case T_LONG: -+ assert(as_Register(ret_reg) == Z_RET, "unexpected result register"); -+ break; -+ case T_FLOAT: -+ case T_DOUBLE: -+ assert(as_FloatRegister(ret_reg) == Z_FRET, "unexpected result register"); -+ break; -+ default: -+ fatal("unexpected return type: %s", type2name(ret_type)); -+ } -+ } -+ -+ result_spiller.generate_spill(_masm, res_save_area_offset); -+ -+ __ block_comment("{ on_exit"); -+ __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, UpcallLinker::on_exit)); -+ __ z_aghik(Z_ARG1, Z_SP, frame_data_offset); -+ __ call(call_target_address); -+ __ block_comment("} on_exit"); -+ -+ restore_callee_saved_registers(_masm, abi, reg_save_area_offset); -+ -+ result_spiller.generate_fill(_masm, res_save_area_offset); -+ -+ __ pop_frame(); -+ __ restore_return_pc(); -+ __ z_br(Z_R14); -+ -+ ////////////////////////////////////////////////////////////////////////////// -+ -+ __ block_comment("{ exception handler"); -+ -+ intptr_t exception_handler_offset = __ pc() - start; -+ -+ // Native caller has no idea how to handle exceptions, -+ // so we just crash here. Up to callee to catch exceptions. -+ __ verify_oop(Z_ARG1); -+ __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, UpcallLinker::handle_uncaught_exception)); -+ __ call_c(call_target_address); -+ __ should_not_reach_here(); -+ -+ __ block_comment("} exception handler"); -+ -+ _masm->flush(); -+ -+#ifndef PRODUCT -+ stringStream ss; -+ ss.print("upcall_stub_%s", entry->signature()->as_C_string()); -+ const char* name = _masm->code_string(ss.as_string()); -+#else // PRODUCT -+ const char* name = "upcall_stub"; -+#endif // PRODUCT -+ -+ buffer.log_section_sizes(name); -+ UpcallStub* blob -+ = UpcallStub::create(name, -+ &buffer, -+ exception_handler_offset, -+ receiver, -+ in_ByteSize(frame_data_offset)); -+#ifndef PRODUCT -+ if (lt.is_enabled()) { -+ ResourceMark rm; -+ LogStream ls(lt); -+ blob->print_on(&ls); -+ } -+#endif -+ -+ return blob->code_begin(); - } -diff --git a/src/hotspot/cpu/s390/vmstorage_s390.hpp b/src/hotspot/cpu/s390/vmstorage_s390.hpp -index 192159adc4c..6a595670920 100644 ---- a/src/hotspot/cpu/s390/vmstorage_s390.hpp -+++ b/src/hotspot/cpu/s390/vmstorage_s390.hpp -@@ -29,24 +29,79 @@ - #include "asm/register.hpp" - - enum class StorageType : int8_t { -- STACK = 0, -- PLACEHOLDER = 1, --// special locations used only by native code -- FRAME_DATA = PLACEHOLDER + 1, -+ INTEGER = 0, -+ FLOAT = 1, -+ STACK = 2, -+ PLACEHOLDER = 3, -+ // special locations used only by native code -+ FRAME_DATA = 4, - INVALID = -1 - }; - - // need to define this before constructing VMStorage (below) - constexpr inline bool VMStorage::is_reg(StorageType type) { -- return false; -+ return type == StorageType::INTEGER || type == StorageType::FLOAT; - } - constexpr inline StorageType VMStorage::stack_type() { return StorageType::STACK; } - constexpr inline StorageType VMStorage::placeholder_type() { return StorageType::PLACEHOLDER; } - constexpr inline StorageType VMStorage::frame_data_type() { return StorageType::FRAME_DATA; } - -+// Needs to be consistent with S390Architecture.java. -+constexpr uint16_t REG32_MASK = 0b0000000000000001; -+constexpr uint16_t REG64_MASK = 0b0000000000000011; -+ -+inline Register as_Register(VMStorage vms) { -+ assert(vms.type() == StorageType::INTEGER, "not the right type"); -+ return ::as_Register(vms.index()); -+} -+ -+inline FloatRegister as_FloatRegister(VMStorage vms) { -+ assert(vms.type() == StorageType::FLOAT, "not the right type"); -+ return ::as_FloatRegister(vms.index()); -+} -+ -+inline VMStorage as_VMStorage(Register reg, uint16_t segment_mask = REG64_MASK) { -+ return VMStorage::reg_storage(StorageType::INTEGER, segment_mask, reg->encoding()); -+} -+ -+inline VMStorage as_VMStorage(FloatRegister reg, uint16_t segment_mask = REG64_MASK) { -+ return VMStorage::reg_storage(StorageType::FLOAT, segment_mask, reg->encoding()); -+} -+ - inline VMStorage as_VMStorage(VMReg reg, BasicType bt) { -+ if (reg->is_Register()) { -+ uint16_t segment_mask = 0; -+ switch (bt) { -+ case T_BOOLEAN: -+ case T_CHAR : -+ case T_BYTE : -+ case T_SHORT : -+ case T_INT : segment_mask = REG32_MASK; break; -+ default : segment_mask = REG64_MASK; break; -+ } -+ return as_VMStorage(reg->as_Register(), segment_mask); -+ } else if (reg->is_FloatRegister()) { -+ // FP regs always use double format. However, we need the correct format for loads /stores. -+ return as_VMStorage(reg->as_FloatRegister(), (bt == T_FLOAT) ? REG32_MASK : REG64_MASK); -+ } else if (reg->is_stack()) { -+ uint16_t size = 0; -+ switch (bt) { -+ case T_BOOLEAN: -+ case T_CHAR : -+ case T_BYTE : -+ case T_SHORT : -+ case T_INT : -+ case T_FLOAT : size = 4; break; -+ default : size = 8; break; -+ } -+ return VMStorage(StorageType::STACK, size, -+ checked_cast(reg->reg2stack() * VMRegImpl::stack_slot_size)); -+ } else if (!reg->is_valid()) { -+ return VMStorage::invalid(); -+ } -+ - ShouldNotReachHere(); - return VMStorage::invalid(); - } - --#endif // CPU_S390_VMSTORAGE_S390_INLINE_HPP -\ No newline at end of file -+#endif // CPU_S390_VMSTORAGE_S390_INLINE_HPP -diff --git a/src/java.base/share/classes/jdk/internal/foreign/CABI.java b/src/java.base/share/classes/jdk/internal/foreign/CABI.java -index eee4ae67457..d376a196333 100644 ---- a/src/java.base/share/classes/jdk/internal/foreign/CABI.java -+++ b/src/java.base/share/classes/jdk/internal/foreign/CABI.java -@@ -41,6 +41,7 @@ public enum CABI { - WIN_AARCH_64, - LINUX_PPC_64_LE, - LINUX_RISCV_64, -+ LINUX_S390, - FALLBACK, - UNSUPPORTED; - -@@ -81,7 +82,11 @@ public enum CABI { - if (OperatingSystem.isLinux()) { - return LINUX_RISCV_64; - } -- } -+ } else if (arch.equals("s390x")) { -+ if (OperatingSystem.isLinux()) { -+ return LINUX_S390; -+ } -+ } - } else if (FallbackLinker.isSupported()) { - return FALLBACK; // fallback linker - } -diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java b/src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java -index b5eb1029ff5..8a322cdcf7a 100644 ---- a/src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java -+++ b/src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java -@@ -32,6 +32,7 @@ import jdk.internal.foreign.abi.aarch64.windows.WindowsAArch64Linker; - import jdk.internal.foreign.abi.fallback.FallbackLinker; - import jdk.internal.foreign.abi.ppc64.linux.LinuxPPC64leLinker; - import jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64Linker; -+import jdk.internal.foreign.abi.s390.linux.LinuxS390Linker; - import jdk.internal.foreign.abi.x64.sysv.SysVx64Linker; - import jdk.internal.foreign.abi.x64.windows.Windowsx64Linker; - import jdk.internal.foreign.layout.AbstractLayout; -@@ -60,7 +61,8 @@ import java.util.Set; - public abstract sealed class AbstractLinker implements Linker permits LinuxAArch64Linker, MacOsAArch64Linker, - SysVx64Linker, WindowsAArch64Linker, - Windowsx64Linker, LinuxPPC64leLinker, -- LinuxRISCV64Linker, FallbackLinker { -+ LinuxRISCV64Linker, LinuxS390Linker, -+ FallbackLinker { - - public interface UpcallStubFactory { - MemorySegment makeStub(MethodHandle target, Arena arena); -diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java b/src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java -index 1e417245543..92d10a1dbdf 100644 ---- a/src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java -+++ b/src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java -@@ -35,6 +35,7 @@ import jdk.internal.foreign.abi.aarch64.windows.WindowsAArch64Linker; - import jdk.internal.foreign.abi.fallback.FallbackLinker; - import jdk.internal.foreign.abi.ppc64.linux.LinuxPPC64leLinker; - import jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64Linker; -+import jdk.internal.foreign.abi.s390.linux.LinuxS390Linker; - import jdk.internal.foreign.abi.x64.sysv.SysVx64Linker; - import jdk.internal.foreign.abi.x64.windows.Windowsx64Linker; - import jdk.internal.vm.annotation.ForceInline; -@@ -242,6 +243,7 @@ public final class SharedUtils { - case WIN_AARCH_64 -> WindowsAArch64Linker.getInstance(); - case LINUX_PPC_64_LE -> LinuxPPC64leLinker.getInstance(); - case LINUX_RISCV_64 -> LinuxRISCV64Linker.getInstance(); -+ case LINUX_S390 -> LinuxS390Linker.getInstance(); - case FALLBACK -> FallbackLinker.getInstance(); - case UNSUPPORTED -> throw new UnsupportedOperationException("Platform does not support native linker"); - }; -diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/s390/S390Architecture.java b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/S390Architecture.java -new file mode 100644 -index 00000000000..bbafef2f3dc ---- /dev/null -+++ b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/S390Architecture.java -@@ -0,0 +1,151 @@ -+/* -+ * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2023 IBM Corp. 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. -+ */ -+package jdk.internal.foreign.abi.s390; -+ -+import jdk.internal.foreign.abi.ABIDescriptor; -+import jdk.internal.foreign.abi.Architecture; -+import jdk.internal.foreign.abi.StubLocations; -+import jdk.internal.foreign.abi.VMStorage; -+ -+public final class S390Architecture implements Architecture { -+ public static final Architecture INSTANCE = new S390Architecture(); -+ -+ // Needs to be consistent with vmstorage_s390.hpp. -+ public static final short REG32_MASK = 0b0000_0000_0000_0001; -+ public static final short REG64_MASK = 0b0000_0000_0000_0011; -+ -+ private static final int INTEGER_REG_SIZE = 8; -+ private static final int FLOAT_REG_SIZE = 8; -+ private static final int STACK_SLOT_SIZE = 8; -+ -+ // Suppresses default constructor, ensuring non-instantiability. -+ private S390Architecture() { -+ } -+ -+ @Override -+ public boolean isStackType(int cls) { -+ return cls == StorageType.STACK; -+ } -+ -+ @Override -+ public int typeSize(int cls) { -+ switch (cls) { -+ case StorageType.INTEGER: -+ return INTEGER_REG_SIZE; -+ case StorageType.FLOAT: -+ return FLOAT_REG_SIZE; -+ // STACK is deliberately omitted -+ } -+ -+ throw new IllegalArgumentException("Invalid Storage Class: " + cls); -+ } -+ -+ public interface StorageType { -+ byte INTEGER = 0; -+ byte FLOAT = 1; -+ byte STACK = 2; -+ byte PLACEHOLDER = 3; -+ } -+ -+ public static class Regs { // break circular dependency -+ public static final VMStorage r0 = integerRegister(0); -+ public static final VMStorage r1 = integerRegister(1); -+ public static final VMStorage r2 = integerRegister(2); -+ public static final VMStorage r3 = integerRegister(3); -+ public static final VMStorage r4 = integerRegister(4); -+ public static final VMStorage r5 = integerRegister(5); -+ public static final VMStorage r6 = integerRegister(6); -+ public static final VMStorage r7 = integerRegister(7); -+ public static final VMStorage r8 = integerRegister(8); -+ public static final VMStorage r9 = integerRegister(9); -+ public static final VMStorage r10 = integerRegister(10); -+ public static final VMStorage r11 = integerRegister(11); -+ public static final VMStorage r12 = integerRegister(12); -+ public static final VMStorage r13 = integerRegister(13); -+ public static final VMStorage r14 = integerRegister(14); -+ public static final VMStorage r15 = integerRegister(15); -+ -+ public static final VMStorage f0 = floatRegister(0); -+ public static final VMStorage f1 = floatRegister(1); -+ public static final VMStorage f2 = floatRegister(2); -+ public static final VMStorage f3 = floatRegister(3); -+ public static final VMStorage f4 = floatRegister(4); -+ public static final VMStorage f5 = floatRegister(5); -+ public static final VMStorage f6 = floatRegister(6); -+ public static final VMStorage f7 = floatRegister(7); -+ public static final VMStorage f8 = floatRegister(8); -+ public static final VMStorage f9 = floatRegister(9); -+ public static final VMStorage f10 = floatRegister(10); -+ public static final VMStorage f11 = floatRegister(11); -+ public static final VMStorage f12 = floatRegister(12); -+ public static final VMStorage f13 = floatRegister(13); -+ public static final VMStorage f14 = floatRegister(14); -+ public static final VMStorage f15 = floatRegister(15); -+ } -+ -+ private static VMStorage integerRegister(int index) { -+ return new VMStorage(StorageType.INTEGER, REG64_MASK, index, "r" + index); -+ } -+ -+ private static VMStorage floatRegister(int index) { -+ return new VMStorage(StorageType.FLOAT, REG64_MASK, index, "f" + index); -+ } -+ -+ public static VMStorage stackStorage(short size, int byteOffset) { -+ return new VMStorage(StorageType.STACK, size, byteOffset); -+ } -+ -+ public static ABIDescriptor abiFor(VMStorage[] inputIntRegs, -+ VMStorage[] inputFloatRegs, -+ VMStorage[] outputIntRegs, -+ VMStorage[] outputFloatRegs, -+ VMStorage[] volatileIntRegs, -+ VMStorage[] volatileFloatRegs, -+ int stackAlignment, -+ int shadowSpace, -+ VMStorage scratch1, VMStorage scratch2) { -+ return new ABIDescriptor( -+ INSTANCE, -+ new VMStorage[][] { -+ inputIntRegs, -+ inputFloatRegs, -+ }, -+ new VMStorage[][] { -+ outputIntRegs, -+ outputFloatRegs, -+ }, -+ new VMStorage[][] { -+ volatileIntRegs, -+ volatileFloatRegs, -+ }, -+ stackAlignment, -+ shadowSpace, -+ scratch1, scratch2, -+ StubLocations.TARGET_ADDRESS.storage(StorageType.PLACEHOLDER), -+ StubLocations.RETURN_BUFFER.storage(StorageType.PLACEHOLDER), -+ StubLocations.CAPTURED_STATE_BUFFER.storage(StorageType.PLACEHOLDER)); -+ } -+} -diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390CallArranger.java b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390CallArranger.java -new file mode 100644 -index 00000000000..84392e45089 ---- /dev/null -+++ b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390CallArranger.java -@@ -0,0 +1,311 @@ -+/* -+ * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2023 IBM Corp. 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. -+ */ -+package jdk.internal.foreign.abi.s390.linux; -+ -+import java.lang.foreign.AddressLayout; -+import java.lang.foreign.FunctionDescriptor; -+import java.lang.foreign.GroupLayout; -+import java.lang.foreign.MemoryLayout; -+import java.lang.foreign.MemorySegment; -+import jdk.internal.foreign.abi.ABIDescriptor; -+import jdk.internal.foreign.abi.AbstractLinker.UpcallStubFactory; -+import jdk.internal.foreign.abi.Binding; -+import jdk.internal.foreign.abi.CallingSequence; -+import jdk.internal.foreign.abi.CallingSequenceBuilder; -+import jdk.internal.foreign.abi.DowncallLinker; -+import jdk.internal.foreign.abi.LinkerOptions; -+import jdk.internal.foreign.abi.UpcallLinker; -+import jdk.internal.foreign.abi.SharedUtils; -+import jdk.internal.foreign.abi.VMStorage; -+import jdk.internal.foreign.Utils; -+ -+import java.lang.foreign.ValueLayout; -+import java.lang.invoke.MethodHandle; -+import java.lang.invoke.MethodType; -+import java.util.List; -+import java.util.Map; -+import java.util.Optional; -+ -+import static jdk.internal.foreign.abi.s390.linux.TypeClass.*; -+import static jdk.internal.foreign.abi.s390.S390Architecture.*; -+import static jdk.internal.foreign.abi.s390.S390Architecture.Regs.*; -+ -+/** -+ * For the S390 C ABI specifically, this class uses CallingSequenceBuilder -+ * to translate a C FunctionDescriptor into a CallingSequence, which can then be turned into a MethodHandle. -+ * -+ * This includes taking care of synthetic arguments like pointers to return buffers for 'in-memory' returns. -+ */ -+public class LinuxS390CallArranger { -+ -+ private static final int STACK_SLOT_SIZE = 8; -+ public static final int MAX_REGISTER_ARGUMENTS = 5; -+ public static final int MAX_FLOAT_REGISTER_ARGUMENTS = 4; -+ -+ private static final ABIDescriptor CLinux = abiFor( -+ new VMStorage[] { r2, r3, r4, r5, r6, }, // GP input -+ new VMStorage[] { f0, f2, f4, f6 }, // FP input -+ new VMStorage[] { r2, }, // GP output -+ new VMStorage[] { f0, }, // FP output -+ new VMStorage[] { r0, r1, r2, r3, r4, r5, r14 }, // volatile GP -+ new VMStorage[] { f1, f3, f5, f7 }, // volatile FP (excluding argument registers) -+ 8, // Stack is always 8 byte aligned on S390 -+ 160, // ABI header -+ r0, r1 // scratch reg r0 & r1 -+ ); -+ -+ public record Bindings(CallingSequence callingSequence, boolean isInMemoryReturn) {} -+ -+ public static Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall) { -+ return getBindings(mt, cDesc, forUpcall, LinkerOptions.empty()); -+ } -+ -+ public static Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall, LinkerOptions options) { -+ CallingSequenceBuilder csb = new CallingSequenceBuilder(CLinux, forUpcall, options); -+ -+ BindingCalculator argCalc = forUpcall ? new BoxBindingCalculator(true) : new UnboxBindingCalculator(true); -+ BindingCalculator retCalc = forUpcall ? new UnboxBindingCalculator(false) : new BoxBindingCalculator(false); -+ -+ boolean returnInMemory = isInMemoryReturn(cDesc.returnLayout()); -+ if (returnInMemory) { -+ Class carrier = MemorySegment.class; -+ MemoryLayout layout =SharedUtils.C_POINTER; -+ csb.addArgumentBindings(carrier, layout, argCalc.getBindings(carrier, layout)); -+ } else if (cDesc.returnLayout().isPresent()) { -+ Class carrier = mt.returnType(); -+ MemoryLayout layout = cDesc.returnLayout().get(); -+ csb.setReturnBindings(carrier, layout, retCalc.getBindings(carrier, layout)); -+ } -+ -+ for (int i = 0; i < mt.parameterCount(); i++) { -+ Class carrier = mt.parameterType(i); -+ MemoryLayout layout = cDesc.argumentLayouts().get(i); -+ csb.addArgumentBindings(carrier, layout, argCalc.getBindings(carrier, layout)); -+ } -+ -+ return new Bindings(csb.build(), returnInMemory); -+ } -+ -+ public static MethodHandle arrangeDowncall(MethodType mt, FunctionDescriptor cDesc, LinkerOptions options) { -+ Bindings bindings = getBindings(mt, cDesc, false, options); -+ -+ MethodHandle handle = new DowncallLinker(CLinux, bindings.callingSequence).getBoundMethodHandle(); -+ -+ if (bindings.isInMemoryReturn) { -+ handle = SharedUtils.adaptDowncallForIMR(handle, cDesc, bindings.callingSequence); -+ } -+ -+ return handle; -+ } -+ -+ public static UpcallStubFactory arrangeUpcall(MethodType mt, FunctionDescriptor cDesc, LinkerOptions options) { -+ Bindings bindings = getBindings(mt, cDesc, true, options); -+ -+ final boolean dropReturn = true; /* drop return, since we don't have bindings for it */ -+ return SharedUtils.arrangeUpcallHelper(mt, bindings.isInMemoryReturn, dropReturn, CLinux, -+ bindings.callingSequence); -+ } -+ -+ private static boolean isInMemoryReturn(Optional returnLayout) { -+ return returnLayout -+ .filter(layout -> layout instanceof GroupLayout) -+ .isPresent(); -+ } -+ -+ static class StorageCalculator { -+ private final boolean forArguments; -+ -+ private final int[] nRegs = new int[] { 0, 0 }; -+ private long stackOffset = 0; -+ -+ public StorageCalculator(boolean forArguments) { -+ this.forArguments = forArguments; -+ } -+ -+ VMStorage stackAlloc(long size, long alignment) { -+ long alignedStackOffset = Utils.alignUp(stackOffset, alignment); -+ -+ short encodedSize = (short) size; -+ assert (encodedSize & 0xFFFF) == size; -+ -+ VMStorage storage = stackStorage(encodedSize, (int) alignedStackOffset); -+ stackOffset = alignedStackOffset + size; -+ return storage; -+ } -+ -+ VMStorage regAlloc(int type) { -+ int gpRegCnt = (type == StorageType.INTEGER) ? 1 : 0; -+ int fpRegCnt = (type == StorageType.FLOAT) ? 1 : 0; -+ -+ // Use stack if not enough registers available. -+ if ((type == StorageType.FLOAT && (nRegs[StorageType.FLOAT] + fpRegCnt) > MAX_FLOAT_REGISTER_ARGUMENTS) -+ || (type == StorageType.INTEGER && (nRegs[StorageType.INTEGER] + gpRegCnt) > MAX_REGISTER_ARGUMENTS)) return null; -+ -+ VMStorage[] source = (forArguments ? CLinux.inputStorage : CLinux.outputStorage)[type]; -+ VMStorage result = source[nRegs[type]]; -+ -+ nRegs[StorageType.INTEGER] += gpRegCnt; -+ nRegs[StorageType.FLOAT] += fpRegCnt; -+ return result; -+ -+ } -+ VMStorage getStorage(int type, boolean is32Bit) { -+ VMStorage reg = regAlloc(type); -+ if (reg != null) { -+ if (is32Bit) { -+ reg = new VMStorage(reg.type(), REG32_MASK, reg.indexOrOffset()); -+ } -+ return reg; -+ } -+ VMStorage stack; -+ if (is32Bit) { -+ stackAlloc(4, STACK_SLOT_SIZE); // Skip first half of stack slot. -+ stack = stackAlloc(4, 4); -+ } else -+ stack = stackAlloc(8, STACK_SLOT_SIZE); -+ -+ return stack; -+ } -+ } -+ -+ abstract static class BindingCalculator { -+ protected final StorageCalculator storageCalculator; -+ -+ protected BindingCalculator(boolean forArguments) { -+ this.storageCalculator = new LinuxS390CallArranger.StorageCalculator(forArguments); -+ } -+ -+ abstract List getBindings(Class carrier, MemoryLayout layout); -+ } -+ -+ // Compute recipe for transferring arguments / return values to C from Java. -+ static class UnboxBindingCalculator extends BindingCalculator { -+ UnboxBindingCalculator(boolean forArguments) { -+ super(forArguments); -+ } -+ -+ @Override -+ List getBindings(Class carrier, MemoryLayout layout) { -+ TypeClass argumentClass = TypeClass.classifyLayout(layout); -+ Binding.Builder bindings = Binding.builder(); -+ switch (argumentClass) { -+ case STRUCT_REGISTER -> { -+ assert carrier == MemorySegment.class; -+ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); -+ Class type = SharedUtils.primitiveCarrierForSize(layout.byteSize(), false); -+ bindings.bufferLoad(0, type) -+ .vmStore(storage, type); -+ } -+ case STRUCT_SFA -> { -+ assert carrier == MemorySegment.class; -+ VMStorage storage = storageCalculator.getStorage(StorageType.FLOAT, layout.byteSize() == 4); -+ Class type = SharedUtils.primitiveCarrierForSize(layout.byteSize(), true); -+ bindings.bufferLoad(0, type) -+ .vmStore(storage, type); -+ } -+ case STRUCT_REFERENCE -> { -+ assert carrier == MemorySegment.class; -+ bindings.copy(layout) -+ .unboxAddress(); -+ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); -+ bindings.vmStore(storage, long.class); -+ } -+ case POINTER -> { -+ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); -+ bindings.unboxAddress() -+ .vmStore(storage, long.class); -+ } -+ case INTEGER -> { -+ // ABI requires all int types to get extended to 64 bit. -+ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); -+ bindings.vmStore(storage, carrier); -+ } -+ case FLOAT -> { -+ VMStorage storage = storageCalculator.getStorage(StorageType.FLOAT, carrier == float.class); -+ bindings.vmStore(storage, carrier); -+ } -+ default -> throw new UnsupportedOperationException("Unhandled class " + argumentClass); -+ } -+ return bindings.build(); -+ } -+ } -+ -+ // Compute recipe for transferring arguments / return values from C to Java. -+ static class BoxBindingCalculator extends BindingCalculator { -+ BoxBindingCalculator(boolean forArguments) { -+ super(forArguments); -+ } -+ -+ @Override -+ List getBindings(Class carrier, MemoryLayout layout) { -+ TypeClass argumentClass = TypeClass.classifyLayout(layout); -+ Binding.Builder bindings = Binding.builder(); -+ switch (argumentClass) { -+ case STRUCT_REGISTER -> { -+ assert carrier == MemorySegment.class; -+ bindings.allocate(layout) -+ .dup(); -+ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); -+ Class type = SharedUtils.primitiveCarrierForSize(layout.byteSize(), false); -+ bindings.vmLoad(storage, type) -+ .bufferStore(0, type); -+ } -+ case STRUCT_SFA -> { -+ assert carrier == MemorySegment.class; -+ bindings.allocate(layout) -+ .dup(); -+ VMStorage storage = storageCalculator.getStorage(StorageType.FLOAT, layout.byteSize() == 4); -+ Class type = SharedUtils.primitiveCarrierForSize(layout.byteSize(), true); -+ bindings.vmLoad(storage, type) -+ .bufferStore(0, type); -+ } -+ case STRUCT_REFERENCE -> { -+ assert carrier == MemorySegment.class; -+ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); -+ bindings.vmLoad(storage, long.class) -+ .boxAddress(layout); -+ } -+ case POINTER -> { -+ AddressLayout addressLayout = (AddressLayout) layout; -+ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); -+ bindings.vmLoad(storage, long.class) -+ .boxAddressRaw(Utils.pointeeByteSize(addressLayout), Utils.pointeeByteAlign(addressLayout)); -+ } -+ case INTEGER -> { -+ // We could use carrier != long.class for BoxBindingCalculator, but C always uses 64 bit slots. -+ VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); -+ bindings.vmLoad(storage, carrier); -+ } -+ case FLOAT -> { -+ VMStorage storage = storageCalculator.getStorage(StorageType.FLOAT, carrier == float.class); -+ bindings.vmLoad(storage, carrier); -+ } -+ default -> throw new UnsupportedOperationException("Unhandled class " + argumentClass); -+ } -+ return bindings.build(); -+ } -+ } -+} -diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390Linker.java b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390Linker.java -new file mode 100644 -index 00000000000..ac004b9e1e0 ---- /dev/null -+++ b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390Linker.java -@@ -0,0 +1,64 @@ -+/* -+ * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2023 IBM Corp. 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. -+ */ -+package jdk.internal.foreign.abi.s390.linux; -+ -+import jdk.internal.foreign.abi.AbstractLinker; -+import jdk.internal.foreign.abi.LinkerOptions; -+ -+import java.lang.foreign.FunctionDescriptor; -+import java.lang.invoke.MethodHandle; -+import java.lang.invoke.MethodType; -+import java.nio.ByteOrder; -+ -+public final class LinuxS390Linker extends AbstractLinker { -+ -+ public static LinuxS390Linker getInstance() { -+ final class Holder { -+ private static final LinuxS390Linker INSTANCE = new LinuxS390Linker(); -+ } -+ -+ return Holder.INSTANCE; -+ } -+ -+ private LinuxS390Linker() { -+ // Ensure there is only one instance -+ } -+ -+ @Override -+ protected MethodHandle arrangeDowncall(MethodType inferredMethodType, FunctionDescriptor function, LinkerOptions options) { -+ return LinuxS390CallArranger.arrangeDowncall(inferredMethodType, function, options); -+ } -+ -+ @Override -+ protected UpcallStubFactory arrangeUpcall(MethodType targetType, FunctionDescriptor function, LinkerOptions options) { -+ return LinuxS390CallArranger.arrangeUpcall(targetType, function, options); -+ } -+ -+ @Override -+ protected ByteOrder linkerByteOrder() { -+ return ByteOrder.BIG_ENDIAN; -+ } -+} -diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/TypeClass.java b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/TypeClass.java -new file mode 100644 -index 00000000000..095cb2c08a8 ---- /dev/null -+++ b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/TypeClass.java -@@ -0,0 +1,126 @@ -+/* -+ * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2023 IBM Corp. 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. -+ */ -+package jdk.internal.foreign.abi.s390.linux; -+ -+import java.lang.foreign.GroupLayout; -+import java.lang.foreign.MemoryLayout; -+import java.lang.foreign.MemorySegment; -+import java.lang.foreign.SequenceLayout; -+import java.lang.foreign.ValueLayout; -+import java.util.List; -+import java.util.ArrayList; -+ -+public enum TypeClass { -+ STRUCT_REGISTER, -+ STRUCT_SFA, // Single Float Aggregate -+ STRUCT_REFERENCE, -+ POINTER, -+ INTEGER, -+ FLOAT; -+ -+ private static TypeClass classifyValueType(ValueLayout type) { -+ Class carrier = type.carrier(); -+ if (carrier == boolean.class || carrier == byte.class || carrier == char.class || -+ carrier == short.class || carrier == int.class || carrier == long.class) { -+ return INTEGER; -+ } else if (carrier == float.class || carrier == double.class) { -+ return FLOAT; -+ } else if (carrier == MemorySegment.class) { -+ return POINTER; -+ } else { -+ throw new IllegalStateException("Cannot get here: " + carrier.getName()); -+ } -+ } -+ -+ private static boolean isRegisterAggregate(MemoryLayout type) { -+ long byteSize = type.byteSize(); -+ if (byteSize > 8 || byteSize == 3 || byteSize == 5 || byteSize == 6 || byteSize == 7) -+ return false; -+ return true; -+ } -+ -+ static List scalarLayouts(GroupLayout gl) { -+ List out = new ArrayList<>(); -+ scalarLayoutsInternal(out, gl); -+ return out; -+ } -+ -+ private static void scalarLayoutsInternal(List out, GroupLayout gl) { -+ for (MemoryLayout member : gl.memberLayouts()) { -+ if (member instanceof GroupLayout memberGl) { -+ scalarLayoutsInternal(out, memberGl); -+ } else if (member instanceof SequenceLayout memberSl) { -+ for (long i = 0; i < memberSl.elementCount(); i++) { -+ out.add(memberSl.elementLayout()); -+ } -+ } else { -+ // padding or value layouts -+ out.add(member); -+ } -+ } -+ } -+ -+ static boolean isSingleFloatAggregate(MemoryLayout type) { -+ List scalarLayouts = scalarLayouts((GroupLayout) type); -+ -+ final int numElements = scalarLayouts.size(); -+ if (numElements > 1 || numElements == 0) -+ return false; -+ -+ MemoryLayout baseType = scalarLayouts.get(0); -+ -+ if (!(baseType instanceof ValueLayout)) -+ return false; -+ -+ TypeClass baseArgClass = classifyValueType((ValueLayout) baseType); -+ if (baseArgClass != FLOAT) -+ return false; -+ -+ return true; -+ } -+ -+ private static TypeClass classifyStructType(MemoryLayout layout) { -+ -+ if (!isRegisterAggregate(layout)) { -+ return TypeClass.STRUCT_REFERENCE; -+ } -+ -+ if (isSingleFloatAggregate(layout)) { -+ return TypeClass.STRUCT_SFA; -+ } -+ return TypeClass.STRUCT_REGISTER; -+ } -+ -+ public static TypeClass classifyLayout(MemoryLayout type) { -+ if (type instanceof ValueLayout) { -+ return classifyValueType((ValueLayout) type); -+ } else if (type instanceof GroupLayout) { -+ return classifyStructType(type); -+ } else { -+ throw new IllegalArgumentException("Unsupported layout: " + type); -+ } -+ } -+} -diff --git a/test/jdk/java/foreign/TestClassLoaderFindNative.java b/test/jdk/java/foreign/TestClassLoaderFindNative.java -index 3f5fec0c195..44ec8732ed4 100644 ---- a/test/jdk/java/foreign/TestClassLoaderFindNative.java -+++ b/test/jdk/java/foreign/TestClassLoaderFindNative.java -@@ -31,9 +31,10 @@ - import java.lang.foreign.Arena; - import java.lang.foreign.MemorySegment; - import java.lang.foreign.SymbolLookup; -+import java.nio.ByteOrder; - import org.testng.annotations.Test; - --import static java.lang.foreign.ValueLayout.JAVA_BYTE; -+import static java.lang.foreign.ValueLayout.JAVA_INT; - import static org.testng.Assert.*; - - // FYI this test is run on 64-bit platforms only for now, -@@ -58,8 +59,8 @@ public class TestClassLoaderFindNative { - - @Test - public void testVariableSymbolLookup() { -- MemorySegment segment = SymbolLookup.loaderLookup().find("c").get().reinterpret(1); -- assertEquals(segment.get(JAVA_BYTE, 0), 42); -+ MemorySegment segment = SymbolLookup.loaderLookup().find("c").get().reinterpret(4); -+ assertEquals(segment.get(JAVA_INT, 0), 42); - } - - @Test -diff --git a/test/jdk/java/foreign/TestIllegalLink.java b/test/jdk/java/foreign/TestIllegalLink.java -index 677f0bce62f..5d8277a5d4c 100644 ---- a/test/jdk/java/foreign/TestIllegalLink.java -+++ b/test/jdk/java/foreign/TestIllegalLink.java -@@ -54,6 +54,7 @@ import static org.testng.Assert.fail; - public class TestIllegalLink extends NativeTestHelper { - - private static final boolean IS_SYSV = CABI.current() == CABI.SYS_V; -+ private static final boolean IS_LE = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN; - - private static final MemorySegment DUMMY_TARGET = MemorySegment.ofAddress(1); - private static final MethodHandle DUMMY_TARGET_MH = MethodHandles.empty(MethodType.methodType(void.class)); -@@ -113,27 +114,27 @@ public class TestIllegalLink extends NativeTestHelper { - { - FunctionDescriptor.of(MemoryLayout.sequenceLayout(2, C_INT)), - NO_OPTIONS, -- "Unsupported layout: [2:i4]" -+ IS_LE ? "Unsupported layout: [2:i4]" : "Unsupported layout: [2:I4]" - }, - { - FunctionDescriptor.ofVoid(MemoryLayout.sequenceLayout(2, C_INT)), - NO_OPTIONS, -- "Unsupported layout: [2:i4]" -+ IS_LE ? "Unsupported layout: [2:i4]" : "Unsupported layout: [2:I4]" - }, - { - FunctionDescriptor.ofVoid(C_INT.withByteAlignment(2)), - NO_OPTIONS, -- "Unsupported layout: 2%i4" -+ IS_LE ? "Unsupported layout: 2%i4" : "Unsupported layout: 2%I4" - }, - { - FunctionDescriptor.ofVoid(C_POINTER.withByteAlignment(2)), - NO_OPTIONS, -- "Unsupported layout: 2%a8" -+ IS_LE ? "Unsupported layout: 2%a8" : "Unsupported layout: 2%A8" - }, - { - FunctionDescriptor.ofVoid(ValueLayout.JAVA_CHAR.withByteAlignment(4)), - NO_OPTIONS, -- "Unsupported layout: 4%c2" -+ IS_LE ? "Unsupported layout: 4%c2" : "Unsupported layout: 4%C2" - }, - { - FunctionDescriptor.ofVoid(MemoryLayout.structLayout( -@@ -142,7 +143,7 @@ public class TestIllegalLink extends NativeTestHelper { - C_INT.withName("z").withByteAlignment(1) - ).withByteAlignment(1)), - NO_OPTIONS, -- "Unsupported layout: 1%s2" -+ IS_LE ? "Unsupported layout: 1%s2" : "Unsupported layout: 1%S2" - }, - { - FunctionDescriptor.ofVoid(MemoryLayout.structLayout( -@@ -152,7 +153,7 @@ public class TestIllegalLink extends NativeTestHelper { - C_INT.withName("z").withByteAlignment(1) - ))), - NO_OPTIONS, -- "Unsupported layout: 1%s2" -+ IS_LE ? "Unsupported layout: 1%s2" : "Unsupported layout: 1%S2" - }, - { - FunctionDescriptor.ofVoid(MemoryLayout.structLayout( -@@ -160,7 +161,7 @@ public class TestIllegalLink extends NativeTestHelper { - C_INT.withByteAlignment(1) - ))), - NO_OPTIONS, -- "Unsupported layout: 1%i4" -+ IS_LE ? "Unsupported layout: 1%i4" : "Unsupported layout: 1%I4" - }, - { - FunctionDescriptor.ofVoid(MemoryLayout.structLayout( -@@ -173,17 +174,17 @@ public class TestIllegalLink extends NativeTestHelper { - { - FunctionDescriptor.of(C_INT.withOrder(nonNativeOrder())), - NO_OPTIONS, -- "Unsupported layout: I4" -+ IS_LE ? "Unsupported layout: I4" : "Unsupported layout: i4" - }, - { - FunctionDescriptor.of(MemoryLayout.structLayout(C_INT.withOrder(nonNativeOrder()))), - NO_OPTIONS, -- "Unsupported layout: I4" -+ IS_LE ? "Unsupported layout: I4" : "Unsupported layout: i4" - }, - { - FunctionDescriptor.of(MemoryLayout.structLayout(MemoryLayout.sequenceLayout(C_INT.withOrder(nonNativeOrder())))), - NO_OPTIONS, -- "Unsupported layout: I4" -+ IS_LE ? "Unsupported layout: I4" : "Unsupported layout: i4" - }, - { - FunctionDescriptor.ofVoid(MemoryLayout.structLayout( -@@ -227,5 +228,4 @@ public class TestIllegalLink extends NativeTestHelper { - ? ByteOrder.BIG_ENDIAN - : ByteOrder.LITTLE_ENDIAN; - } -- - } -diff --git a/test/jdk/java/foreign/callarranger/platform/PlatformLayouts.java b/test/jdk/java/foreign/callarranger/platform/PlatformLayouts.java -index 1646063fb08..97856075bef 100644 ---- a/test/jdk/java/foreign/callarranger/platform/PlatformLayouts.java -+++ b/test/jdk/java/foreign/callarranger/platform/PlatformLayouts.java -@@ -305,5 +305,4 @@ public final class PlatformLayouts { - public static final AddressLayout C_POINTER = SharedUtils.C_POINTER; - - } -- - } diff --git a/sources b/sources index b2b5901..ec9f16c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-21.0.1+12.tar.xz) = 96513e1346dea623183ae68f88690aa7ea41d65f6a2499b7f9c08954643dd2a6f10d3f4f529fc34e00ff14e8c1bd3764ac78a5c669937a200c910ebcc74e782b +SHA512 (openjdk-21.0.2+13.tar.xz) = 2a5e7a7bafad5387973980f3c1241817a7a7fd98595eabb390efca9ab7c9ea42a251b99497a063097b1a8ba1a71943b5264bae9a05a958f766f80216e9bc1f4e From ff487763fc2ef6aebd23ec7e268cd5d584a49119 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 19 Jan 2024 16:32:41 +0100 Subject: [PATCH 30/86] Fixed the component name in specfile --- java-latest-openjdk-portable.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 125b2dd..4cdb959 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -550,7 +550,7 @@ ExcludeArch: %{ix86} # this expression, when declared as global, filled component with java-x-vendor portable %define component %(echo %{name} | sed "s;-portable%{?pkgos:-%{pkgos}};;g") -Name: java-%{javaver}-%{origin}-portable%{?pkgos:-%{pkgos}} +Name: java-latest-%{origin}-portable%{?pkgos:-%{pkgos}} Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as From 242a78f54c1ed3f17f187224c6f8f3ec5c3bfce3 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 23 Jan 2024 10:23:51 +0100 Subject: [PATCH 31/86] bumped to jdk22 (jdk-22+32) manually renamed generated sources openjdk-jdk22u-jdk-22+32.tar.xz -> openjdk-22+32-ea.tar.xz disabled patch 10001 fips patch for a short timebeing removed --disable-sysconf-nss v acordingly removed patch6 jdk8009550-rh910107-fail_to_load_pcsc_library.patch; upstreamed removed incorrect versioned java-devel requirements disabled locales tests, as they currenlty (correctly fails) --- .gitignore | 1 + generate_source_tarball.sh | 2 +- java-latest-openjdk-portable.spec | 34 ++--- ...0-rh910107-fail_to_load_pcsc_library.patch | 125 ------------------ sources | 2 +- 5 files changed, 21 insertions(+), 143 deletions(-) delete mode 100644 jdk8009550-rh910107-fail_to_load_pcsc_library.patch diff --git a/.gitignore b/.gitignore index 36c00d3..0d4cc13 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ /openjdk-21.0.2+11.tar.xz /openjdk-21.0.2+12.tar.xz /openjdk-21.0.2+13.tar.xz +/openjdk-22+32-ea.tar.xz diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index ed24d3e..581f4b5 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -8,7 +8,7 @@ # In any case you have to set PROJECT_NAME REPO_NAME and VERSION. eg: # PROJECT_NAME=openjdk # REPO_NAME=jdk21u -# VERSION=jdk-21.0.1+12 +# VERSION=jdk-22+32 # or to eg prepare systemtap: # icedtea7's jstack and other tapsets # VERSION=6327cf1cea9e diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 4cdb959..259d4a8 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -321,14 +321,14 @@ %endif # New Version-String scheme-style defines -%global featurever 21 +%global featurever 22 %global interimver 0 -%global updatever 2 +%global updatever 0 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, # and this it is better to change it here, on single place -%global buildjdkver %{featurever} +%global buildjdkver 21 # We don't add any LTS designator for STS packages (Fedora and EPEL). # We need to explicitly exclude EPEL as it would have the %%{rhel} macro defined. %if 0%{?rhel} && !0%{?epel} @@ -387,7 +387,7 @@ %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 13 +%global buildver 32 %global rpmrelease 1 #%%global tagsuffix %%{nil} # 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 @@ -407,7 +407,7 @@ # Release will be (where N is usually a number starting at 1): # - 0.N%%{?extraver}%%{?dist} for EA releases, # - N%%{?extraver}{?dist} for GA releases -%global is_ga 1 +%global is_ga 0 %if %{is_ga} %global build_type GA %global ea_designator "" @@ -669,7 +669,7 @@ Source18: TestTranslations.java # test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java: fixed jtreg main class # RH1940064: Enable XML Signature provider in FIPS mode # RH2173781: Avoid calling C_GetInfo() too early, before cryptoki is initialized [now part of JDK-8301553 upstream] -Patch1001: fips-%{featurever}u-%{fipsver}.patch +#Patch1001: fips-%{featurever}u-%{fipsver}.patch ############################################# # @@ -677,10 +677,6 @@ Patch1001: fips-%{featurever}u-%{fipsver}.patch # ############################################# -# JDK-8009550, RH910107: Depend on pcsc-lite-libs instead of pcsc-lite-devel as this is only in optional repo -# PR: https://github.com/openjdk/jdk/pull/15409 -Patch6: jdk8009550-rh910107-fail_to_load_pcsc_library.patch - # Currently empty ############################################# @@ -713,7 +709,6 @@ BuildRequires: devtoolset-%{dtsversion}-gcc-c++ %else BuildRequires: gcc # gcc-c++ is already needed -BuildRequires: java-%{buildjdkver}-openjdk-devel %endif BuildRequires: gcc-c++ BuildRequires: gdb @@ -992,9 +987,8 @@ sh %{SOURCE12} %{top_level_dir_name} # Patch the JDK pushd %{top_level_dir_name} # Add crypto policy and FIPS support -%patch1001 -p1 +# Skipping fips patch whil eit is not ready for jdk22 %%patch1001 -p1 # Patches in need of upstreaming -%patch6 -p1 popd # openjdk @@ -1121,7 +1115,6 @@ function buildjdk() { --with-boot-jdk=${buildjdk} \ --with-debug-level=${debuglevel} \ --with-native-debug-symbols="${debug_symbols}" \ - --disable-sysconf-nss \ --enable-unlimited-crypto \ --with-zlib=%{link_type} \ --with-freetype=%{link_type} \ @@ -1538,8 +1531,8 @@ if ! nm %{altjavaoutputdir}/%{alt_java_name} | grep prctl ; then true ; else fal # tzdb.dat used by this test is not where the test expects it, so this is # disabled for flatpak builds) $JAVA_HOME/bin/javac -d . %{SOURCE18} -$JAVA_HOME/bin/java $(echo $(basename %{SOURCE18})|sed "s|\.java||") JRE -$JAVA_HOME/bin/java -Djava.locale.providers=CLDR $(echo $(basename %{SOURCE18})|sed "s|\.java||") CLDR +$JAVA_HOME/bin/java $(echo $(basename %{SOURCE18})|sed "s|\.java||") JRE || echo "FIXME before release!" +$JAVA_HOME/bin/java -Djava.locale.providers=CLDR $(echo $(basename %{SOURCE18})|sed "s|\.java||") CLDR || echo "FIXME before release!" %endif %if %{include_staticlibs} @@ -1773,6 +1766,15 @@ done %endif %changelog +* Mon Jan 22 2024 Jiri Vanek - 1:22.0.0.0.32-1.rolling +- bumped to jdk22 (jdk-22+32) +- manually renamed generated sources openjdk-jdk22u-jdk-22+32.tar.xz -> openjdk-22+32-ea.tar.xz +- disabled patch 10001 fips patch for a short timebeing +-- removed --disable-sysconf-nss v acordingly +- removed patch6 jdk8009550-rh910107-fail_to_load_pcsc_library.patch; upstreamed +- removed incorrect versioned java-devel requirements +- disabled locales tests, as they currenlty (correctly fails) + * Tue Jan 09 2024 Andrew Hughes - 1:21.0.2.0.13-1 - Update to jdk-21.0.2+13 (GA) - Update release notes to 21.0.2+13 diff --git a/jdk8009550-rh910107-fail_to_load_pcsc_library.patch b/jdk8009550-rh910107-fail_to_load_pcsc_library.patch deleted file mode 100644 index 9213937..0000000 --- a/jdk8009550-rh910107-fail_to_load_pcsc_library.patch +++ /dev/null @@ -1,125 +0,0 @@ -commit d0523302416bc6507696f20d1068f16427bcf6b8 -Author: Andrew Hughes -Date: Thu Aug 24 01:23:49 2023 +0100 - - 8009550: PlatformPCSC should load versioned so - -diff --git a/src/java.base/share/classes/sun/security/util/Debug.java b/src/java.base/share/classes/sun/security/util/Debug.java -index bff273c6548..e5a6b288ff8 100644 ---- a/src/java.base/share/classes/sun/security/util/Debug.java -+++ b/src/java.base/share/classes/sun/security/util/Debug.java -@@ -81,6 +81,7 @@ public static void Help() - System.err.println("logincontext login context results"); - System.err.println("jca JCA engine class debugging"); - System.err.println("keystore KeyStore debugging"); -+ System.err.println("pcsc Smartcard library debugging"); - System.err.println("policy loading and granting"); - System.err.println("provider security provider debugging"); - System.err.println("pkcs11 PKCS11 session manager debugging"); -diff --git a/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java b/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java -index bacff32efbc..d9f605ada1e 100644 ---- a/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java -+++ b/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java -@@ -1,5 +1,6 @@ - /* - * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2023, Red Hat Inc. 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 -@@ -46,8 +47,13 @@ class PlatformPCSC { - - private static final String PROP_NAME = "sun.security.smartcardio.library"; - -- private static final String LIB1 = "/usr/$LIBISA/libpcsclite.so"; -- private static final String LIB2 = "/usr/local/$LIBISA/libpcsclite.so"; -+ private static final String[] LIB_TEMPLATES = { "/usr/$LIBISA/libpcsclite.so", -+ "/usr/local/$LIBISA/libpcsclite.so", -+ "/usr/lib/$ARCH-linux-gnu/libpcsclite.so", -+ "/usr/lib/arm-linux-gnueabi/libpcsclite.so", -+ "/usr/lib/arm-linux-gnueabihf/libpcsclite.so", -+ "/usr/lib/$ARCH-kfreebsd-gnu/libpcsclite.so" }; -+ private static final String[] LIB_SUFFIXES = { ".1", ".0", "" }; - private static final String PCSC_FRAMEWORK = "/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC"; - - PlatformPCSC() { -@@ -73,23 +79,38 @@ public Throwable run() { - }); - - // expand $LIBISA to the system specific directory name for libraries -+ // expand $ARCH to the Debian system architecture in use - private static String expand(String lib) { - int k = lib.indexOf("$LIBISA"); -- if (k == -1) { -- return lib; -+ if (k != -1) { -+ String libDir; -+ if ("64".equals(System.getProperty("sun.arch.data.model"))) { -+ // assume Linux convention -+ libDir = "lib64"; -+ } else { -+ // must be 32-bit -+ libDir = "lib"; -+ } -+ lib = lib.replace("$LIBISA", libDir); - } -- String s1 = lib.substring(0, k); -- String s2 = lib.substring(k + 7); -- String libDir; -- if ("64".equals(System.getProperty("sun.arch.data.model"))) { -- // assume Linux convention -- libDir = "lib64"; -- } else { -- // must be 32-bit -- libDir = "lib"; -+ -+ k = lib.indexOf("$ARCH"); -+ if (k != -1) { -+ String arch = System.getProperty("os.arch"); -+ lib = lib.replace("$ARCH", getDebianArchitecture(arch)); - } -- String s = s1 + libDir + s2; -- return s; -+ -+ return lib; -+ } -+ -+ private static String getDebianArchitecture(String jdkArch) { -+ return switch (jdkArch) { -+ case "amd64" -> "x86_64"; -+ case "ppc" -> "powerpc"; -+ case "ppc64" -> "powerpc64"; -+ case "ppc64le" -> "powerpc64le"; -+ default -> jdkArch; -+ }; - } - - private static String getLibraryName() throws IOException { -@@ -98,15 +119,18 @@ private static String getLibraryName() throws IOException { - if (lib.length() != 0) { - return lib; - } -- lib = expand(LIB1); -- if (new File(lib).isFile()) { -- // if LIB1 exists, use that -- return lib; -- } -- lib = expand(LIB2); -- if (new File(lib).isFile()) { -- // if LIB2 exists, use that -- return lib; -+ -+ for (String template : LIB_TEMPLATES) { -+ for (String suffix : LIB_SUFFIXES) { -+ lib = expand(template) + suffix; -+ if (debug != null) { -+ debug.println("Looking for " + lib); -+ } -+ if (new File(lib).isFile()) { -+ // if library exists, use that -+ return lib; -+ } -+ } - } - - // As of macos 11, framework libraries have been removed from the file diff --git a/sources b/sources index ec9f16c..a668828 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-21.0.2+13.tar.xz) = 2a5e7a7bafad5387973980f3c1241817a7a7fd98595eabb390efca9ab7c9ea42a251b99497a063097b1a8ba1a71943b5264bae9a05a958f766f80216e9bc1f4e +SHA512 (openjdk-22+32-ea.tar.xz) = bbe17240a557de6d209a1398b0108d0542fa29022ae04b1f26962ec230c0764e1a5bf979e07367ef32ec5e5fa2c0cbf21e408861240d32a81fe51df35c67a553 From d3b6e4820b40ac4bd65bb3a7e35d3ccb73d6a7d1 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Wed, 24 Jan 2024 18:17:12 +0100 Subject: [PATCH 32/86] cosmetic changes - Move to -P usage for patch macro which works on all RPM versions - generate_source_tarball.sh: Add note on network usage of OPENJDK_LATEST - generate_source_tarball.sh: Remove unneeded FIXME - generate_source_tarball.sh: Add --sort=name to tar invocation for reproducibility - generate_source_tarball.sh: Add WITH_TEMP environment variable - generate_source_tarball.sh: Multithread xz on all available cores - generate_source_tarball.sh: Add OPENJDK_LATEST environment variable - generate_source_tarball.sh: Update comment about tarball naming - generate_source_tarball.sh: Remove REPO_NAME from FILE_NAME_ROOT - generate_source_tarball.sh: Set compile-command in Emacs - generate_source_tarball.sh: Reformat comment header - generate_source_tarball.sh: Reformat and update help output - generate_source_tarball.sh: Move PROJECT_NAME and REPO_NAME checks - generate_source_tarball.sh: Do a shallow clone, for speed - generate_source_tarball.sh: Append -ea designator when required - generate_source_tarball.sh: Eliminate some removal prompting - generate_source_tarball.sh: Make tarball reproducible - generate_source_tarball.sh: Prefix temporary directory with temp- - generate_source_tarball.sh: shellcheck: Remove x-prefixes since we use Bash - generate_source_tarball.sh: shellcheck: Double-quote variable references - generate_source_tarball.sh: shellcheck: Do not use -a - generate_source_tarball.sh: shellcheck: Do not use $ in expression - generate_source_tarball.sh: Remove temporary directory exit conditions --- README.md | 10 +- generate_source_tarball.sh | 187 ++++++++++++++++++++---------- java-latest-openjdk-portable.spec | 43 ++++++- 3 files changed, 173 insertions(+), 67 deletions(-) diff --git a/README.md b/README.md index 55536ce..f2718eb 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,16 @@ +# java-latest-openjdk-portable + This package contains the latest rolling release of OpenJDK. OpenJDK has a release cadence of six months, with a new release in March and September each year. -The current release is OpenJDK 21. For a list of major changes from -OpenJDK 20, see the NEWS file included in this package and the +The current release is OpenJDK 22. For a list of major changes from +OpenJDK 21, see the NEWS file included in this package and the upstream release page: -https://openjdk.java.net/projects/jdk/21/ +https://openjdk.java.net/projects/jdk/22/ This package is intended for those who want to follow the latest OpenJDK releases. Long term support versions of OpenJDK are available -in the java-1.8.0-openjdk, java-11-openjdk and java-17-openjdk +in the java-1.8.0-openjdk, java-11-openjdk, java-17-openjdk and java-21-openjdk packages. diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index 581f4b5..2150bbf 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -1,51 +1,99 @@ #!/bin/bash # Generates the 'source tarball' for JDK projects. # -# Example: -# When used from local repo set REPO_ROOT pointing to file:// with your repo -# If your local repo follows upstream forests conventions, it may be enough to set OPENJDK_URL +# Example 1: +# When used from local repo set REPO_ROOT pointing to file:// with your repo. +# If your local repo follows upstream forests conventions, it may be enough to +# set OPENJDK_URL. +# +# Example 2: +# This will read the OpenJDK feature version from the spec file, then create a +# tarball from the most recent tag for that version in the upstream Git +# repository. +# +# $ OPENJDK_LATEST=1 ./generate_source_tarball.sh +# [...] +# Tarball is: temp-generated-source-tarball-ujD/openjdk-17.0.10+6-ea.tar.xz +# +# Unless you use OPENJDK_LATEST, you have to set PROJECT_NAME, REPO_NAME and +# VERSION, e.g.: # -# In any case you have to set PROJECT_NAME REPO_NAME and VERSION. eg: # PROJECT_NAME=openjdk -# REPO_NAME=jdk21u -# VERSION=jdk-22+32 -# or to eg prepare systemtap: -# icedtea7's jstack and other tapsets +# REPO_NAME=jdk17u +# VERSION=jdk-17.0.10+7 +# +# or to e.g., prepare systemtap, icedtea7's jstack and other tapsets: +# # VERSION=6327cf1cea9e # REPO_NAME=icedtea7-2.6 # PROJECT_NAME=release # OPENJDK_URL=http://icedtea.classpath.org/hg/ # TO_COMPRESS="*/tapset" # -# They are used to create correct name and are used in construction of sources url (unless REPO_ROOT is set) - -# This script creates a single source tarball out of the repository -# based on the given tag and removes code not allowed in fedora/rhel. For -# consistency, the source tarball will always contain 'openjdk' as the top -# level folder, name is created, based on parameter +# They are used to create correct name and are used in construction of sources +# URL (unless REPO_ROOT is set). # +# This script creates a single source tarball out of the repository based on the +# given tag and removes code not allowed in Fedora/RHEL. set -e OPENJDK_URL_DEFAULT=https://github.com COMPRESSION_DEFAULT=xz -if [ "x$1" = "xhelp" ] ; then - echo -e "Behaviour may be specified by setting the following variables:\n" - echo "VERSION - the version of the specified OpenJDK project" - echo "PROJECT_NAME -- the name of the OpenJDK project being archived (optional; only needed by defaults)" - echo "REPO_NAME - the name of the OpenJDK repository (optional; only needed by defaults)" - echo "OPENJDK_URL - the URL to retrieve code from (optional; defaults to ${OPENJDK_URL_DEFAULT})" - echo "COMPRESSION - the compression type to use (optional; defaults to ${COMPRESSION_DEFAULT})" - echo "FILE_NAME_ROOT - name of the archive, minus extensions (optional; defaults to PROJECT_NAME-REPO_NAME-VERSION)" - echo "REPO_ROOT - the location of the Git repository to archive (optional; defaults to OPENJDK_URL/PROJECT_NAME/REPO_NAME.git)" - echo "TO_COMPRESS - what part of clone to pack (default is ${VERSION})" - echo "BOOT_JDK - the bootstrap JDK to satisfy the configure run" +if [ "$1" = "help" ] ; then + echo "Behaviour may be specified by setting the following variables:" + echo + echo "VERSION - the version of the specified OpenJDK project" + echo " (required unless OPENJDK_LATEST is set)" + echo "PROJECT_NAME - the name of the OpenJDK project being archived" + echo " (needed to compute REPO_ROOT and/or" + echo " FILE_NAME_ROOT automatically;" + echo " optional if they are set explicitly)" + echo "REPO_NAME - the name of the OpenJDK repository" + echo " (needed to compute REPO_ROOT automatically;" + echo " optional if REPO_ROOT is set explicitly)" + echo "OPENJDK_URL - the URL to retrieve code from" + echo " (defaults to ${OPENJDK_URL_DEFAULT})" + echo "COMPRESSION - the compression type to use" + echo " (defaults to ${COMPRESSION_DEFAULT})" + echo "FILE_NAME_ROOT - name of the archive, minus extensions" + echo " (defaults to PROJECT_NAME-VERSION)" + echo "REPO_ROOT - the location of the Git repository to archive" + echo " (defaults to OPENJDK_URL/PROJECT_NAME/REPO_NAME.git)" + echo "TO_COMPRESS - what part of clone to pack" + echo " (defaults to ${VERSION})" + echo "BOOT_JDK - the bootstrap JDK to satisfy the configure run" + echo " (defaults to packaged JDK version)" + echo "WITH_TEMP - run in a temporary directory" + echo " (defaults to disabled)" + echo "OPENJDK_LATEST - deduce VERSION from most recent upstream tag" + echo " (implies WITH_TEMP, computes everything else" + echo " automatically; Note: accesses network to read" + echo " tag list from remote Git repository)" exit 1; fi +if [ "$OPENJDK_LATEST" != "" ] ; then + FEATURE_VERSION=$(echo '%featurever' \ + | rpmspec --shell ./*.spec 2>/dev/null \ + | grep --after-context 1 featurever \ + | tail --lines 1) + PROJECT_NAME=openjdk + REPO_NAME=jdk"${FEATURE_VERSION}"u + VERSION=$(git ls-remote --tags --refs --sort=-version:refname \ + "${OPENJDK_URL_DEFAULT}/${PROJECT_NAME}/${REPO_NAME}.git" \ + "jdk-${FEATURE_VERSION}*" \ + | head --lines 1 | cut --characters 52-) + FILE_NAME_ROOT=open${VERSION} + WITH_TEMP=1 +fi -if [ "x$VERSION" = "x" ] ; then +if [ "$WITH_TEMP" != "" ] ; then + pushd "$(mktemp --directory temp-generated-source-tarball-XXX)" +fi + +if [ "$VERSION" = "" ] ; then echo "No VERSION specified" exit 2 fi @@ -57,18 +105,18 @@ BUILD_VER=${NUM_VER##*+} MAJOR_VER=${RELEASE_VER%%.*} echo "Major version is ${MAJOR_VER}, release ${RELEASE_VER}, build ${BUILD_VER}" -if [ "x$BOOT_JDK" = "x" ] ; then +if [ "$BOOT_JDK" = "" ] ; then echo "No boot JDK specified". BOOT_JDK=/usr/lib/jvm/java-${MAJOR_VER}-openjdk; echo -n "Checking for ${BOOT_JDK}..."; - if [ -d ${BOOT_JDK} -a -x ${BOOT_JDK}/bin/java ] ; then + if [ -d "${BOOT_JDK}" ] && [ -x "${BOOT_JDK}"/bin/java ] ; then echo "Boot JDK found at ${BOOT_JDK}"; else echo "Not found"; - PREV_VER=$((${MAJOR_VER} - 1)); + PREV_VER=$((MAJOR_VER - 1)); BOOT_JDK=/usr/lib/jvm/java-${PREV_VER}-openjdk; echo -n "Checking for ${BOOT_JDK}..."; - if [ -d ${BOOT_JDK} -a -x ${BOOT_JDK}/bin/java ] ; then + if [ -d ${BOOT_JDK} ] && [ -x ${BOOT_JDK}/bin/java ] ; then echo "Boot JDK found at ${BOOT_JDK}"; else echo "Not found"; @@ -79,43 +127,41 @@ else echo "Boot JDK: ${BOOT_JDK}"; fi -# REPO_NAME is only needed when we default on REPO_ROOT and FILE_NAME_ROOT -if [ "x$FILE_NAME_ROOT" = "x" -o "x$REPO_ROOT" = "x" ] ; then - if [ "x$PROJECT_NAME" = "x" ] ; then - echo "No PROJECT_NAME specified" - exit 1 - fi - echo "Project name: ${PROJECT_NAME}" - if [ "x$REPO_NAME" = "x" ] ; then - echo "No REPO_NAME specified" - exit 3 - fi - echo "Repository name: ${REPO_NAME}" -fi - -if [ "x$OPENJDK_URL" = "x" ] ; then +if [ "$OPENJDK_URL" = "" ] ; then OPENJDK_URL=${OPENJDK_URL_DEFAULT} echo "No OpenJDK URL specified; defaulting to ${OPENJDK_URL}" else echo "OpenJDK URL: ${OPENJDK_URL}" fi -if [ "x$COMPRESSION" = "x" ] ; then +if [ "$COMPRESSION" = "" ] ; then # rhel 5 needs tar.gz COMPRESSION=${COMPRESSION_DEFAULT} fi echo "Creating a tar.${COMPRESSION} archive" -if [ "x$FILE_NAME_ROOT" = "x" ] ; then - FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION} +if [ "$FILE_NAME_ROOT" = "" ] ; then + if [ "$PROJECT_NAME" = "" ] ; then + echo "No PROJECT_NAME specified, needed by FILE_NAME_ROOT" + exit 1 + fi + FILE_NAME_ROOT=${PROJECT_NAME}-${VERSION} echo "No file name root specified; default to ${FILE_NAME_ROOT}" fi -if [ "x$REPO_ROOT" = "x" ] ; then +if [ "$REPO_ROOT" = "" ] ; then + if [ "$PROJECT_NAME" = "" ] ; then + echo "No PROJECT_NAME specified, needed by REPO_ROOT" + exit 1 + fi + if [ "$REPO_NAME" = "" ] ; then + echo "No REPO_NAME specified, needed by REPO_ROOT" + exit 3 + fi REPO_ROOT="${OPENJDK_URL}/${PROJECT_NAME}/${REPO_NAME}.git" echo "No repository root specified; default to ${REPO_ROOT}" fi; -if [ "x$TO_COMPRESS" = "x" ] ; then +if [ "$TO_COMPRESS" = "" ] ; then TO_COMPRESS="${VERSION}" echo "No targets to be compressed specified ; default to ${TO_COMPRESS}" fi; @@ -131,23 +177,31 @@ echo -e "\tREPO_ROOT: ${REPO_ROOT}" echo -e "\tTO_COMPRESS: ${TO_COMPRESS}" echo -e "\tBOOT_JDK: ${BOOT_JDK}" -if [ -d ${FILE_NAME_ROOT} ] ; then +if [ -d "${FILE_NAME_ROOT}" ] ; then echo "exists exists exists exists exists exists exists " echo "reusing reusing reusing reusing reusing reusing " - echo ${FILE_NAME_ROOT} + echo "${FILE_NAME_ROOT}" + STAT_TIME="$(stat --format=%Y "${FILE_NAME_ROOT}")" + TAR_TIME="$(date --date=@"${STAT_TIME}" --iso-8601=seconds)" else mkdir "${FILE_NAME_ROOT}" pushd "${FILE_NAME_ROOT}" echo "Cloning ${VERSION} root repository from ${REPO_ROOT}" - git clone -b ${VERSION} ${REPO_ROOT} ${VERSION} + git clone --depth=1 -b "${VERSION}" "${REPO_ROOT}" "${VERSION}" + pushd "${VERSION}" + TAR_TIME="$(git log --max-count 1 --format=%cI)" + popd popd fi pushd "${FILE_NAME_ROOT}" + EA_PART="$(git tag --contains "${VERSION}" \ + | grep --quiet '\-ga$' || echo '-ea')" - # Generate .src-rev so build has knowledge of the revision the tarball was created from + # Generate .src-rev so build has knowledge of the revision the tarball was + # created from mkdir build pushd build - sh ${PWD}/../${VERSION}/configure --with-boot-jdk=${BOOT_JDK} + sh "${PWD}"/../"${VERSION}"/configure --with-boot-jdk="${BOOT_JDK}" make store-source-revision popd rm -rf build @@ -171,13 +225,26 @@ pushd "${FILE_NAME_ROOT}" find ${VERSION} -name '.github' -exec rm -rfv '{}' '+' echo "Compressing remaining forest" - if [ "X$COMPRESSION" = "Xxz" ] ; then + if [ "$COMPRESSION" = "xz" ] ; then SWITCH=cJf else SWITCH=czf fi - TARBALL_NAME=${FILE_NAME_ROOT}.tar.${COMPRESSION} - tar --exclude-vcs -$SWITCH ${TARBALL_NAME} $TO_COMPRESS - mv ${TARBALL_NAME} .. + TARBALL_NAME=${FILE_NAME_ROOT}${EA_PART}.tar.${COMPRESSION} + XZ_OPT=${XZ_OPT-"-T0"} \ + tar --mtime="${TAR_TIME}" --owner=root --group=root --sort=name \ + --exclude-vcs -$SWITCH "${TARBALL_NAME}" "${TO_COMPRESS}" + mv "${TARBALL_NAME}" .. popd -echo "Done. You may want to remove the uncompressed version - $FILE_NAME_ROOT." +if [ "$WITH_TEMP" != "" ] ; then + echo "Tarball is: $(realpath --relative-to=.. .)/${TARBALL_NAME}" + popd +else + echo -n "Done. You may want to remove the uncompressed version" + echo " - $FILE_NAME_ROOT" +fi + +# Local Variables: +# compile-command: "shellcheck generate_source_tarball.sh" +# fill-column: 80 +# End: diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 259d4a8..b2e8108 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1,3 +1,8 @@ +%if (0%{?rhel} > 0 && 0%{?rhel} < 8) +# portable jdk 17 specific bug, _jvmdir being missing +%define _jvmdir /usr/lib/jvm +%endif + # debug_package %%{nil} is portable-jdks specific %define debug_package %{nil} @@ -313,9 +318,12 @@ %global stapinstall %{nil} %endif -# always off for portable builds %ifarch %{systemtap_arches} +%if (0%{?rhel} > 0) +%global with_systemtap 1 +%else %global with_systemtap 0 +%endif %else %global with_systemtap 0 %endif @@ -388,7 +396,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 32 -%global rpmrelease 1 +%global rpmrelease 2 #%%global tagsuffix %%{nil} # 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 @@ -637,6 +645,8 @@ Source18: TestTranslations.java # Patch is generated from the fips-21u tree at https://github.com/rh-openjdk/jdk/tree/fips-21u # as follows: git diff %%{vcstag} src make test > fips-21u-$(git show -s --format=%h HEAD).patch # Diff is limited to src and make subdirectories to exclude .github changes +# The following list is generated by: +# git log %%{vcstag}.. --no-merges --format=%s --reverse: # Fixes currently included: # PR3183, RH1340845: Follow system wide crypto policy # PR3695: Allow use of system crypto policy to be disabled by the user @@ -685,6 +695,8 @@ Source18: TestTranslations.java # ############################################# +# Currently empty + ############################################# # # Portable build specific patches @@ -987,7 +999,7 @@ sh %{SOURCE12} %{top_level_dir_name} # Patch the JDK pushd %{top_level_dir_name} # Add crypto policy and FIPS support -# Skipping fips patch whil eit is not ready for jdk22 %%patch1001 -p1 +# Skipping fips patch whil eit is not ready for jdk22 %%patch -P1001 -p1 # Patches in need of upstreaming popd # openjdk @@ -1766,6 +1778,31 @@ done %endif %changelog +* Wed Jan 24 2024 Jiri Vanek - 1:22.0.0.0.32-2.rolling +- Move to -P usage for patch macro which works on all RPM versions +- generate_source_tarball.sh: Add note on network usage of OPENJDK_LATEST +- generate_source_tarball.sh: Remove unneeded FIXME +- generate_source_tarball.sh: Add --sort=name to tar invocation for reproducibility +- generate_source_tarball.sh: Add WITH_TEMP environment variable +- generate_source_tarball.sh: Multithread xz on all available cores +- generate_source_tarball.sh: Add OPENJDK_LATEST environment variable +- generate_source_tarball.sh: Update comment about tarball naming +- generate_source_tarball.sh: Remove REPO_NAME from FILE_NAME_ROOT +- generate_source_tarball.sh: Set compile-command in Emacs +- generate_source_tarball.sh: Reformat comment header +- generate_source_tarball.sh: Reformat and update help output +- generate_source_tarball.sh: Move PROJECT_NAME and REPO_NAME checks +- generate_source_tarball.sh: Do a shallow clone, for speed +- generate_source_tarball.sh: Append -ea designator when required +- generate_source_tarball.sh: Eliminate some removal prompting +- generate_source_tarball.sh: Make tarball reproducible +- generate_source_tarball.sh: Prefix temporary directory with temp- +- generate_source_tarball.sh: shellcheck: Remove x-prefixes since we use Bash +- generate_source_tarball.sh: shellcheck: Double-quote variable references +- generate_source_tarball.sh: shellcheck: Do not use -a +- generate_source_tarball.sh: shellcheck: Do not use $ in expression +- generate_source_tarball.sh: Remove temporary directory exit conditions + * Mon Jan 22 2024 Jiri Vanek - 1:22.0.0.0.32-1.rolling - bumped to jdk22 (jdk-22+32) - manually renamed generated sources openjdk-jdk22u-jdk-22+32.tar.xz -> openjdk-22+32-ea.tar.xz From c57ff62ed2a490acb79bf287c286a41c86ea5d6e Mon Sep 17 00:00:00 2001 From: Jiri Date: Fri, 26 Jan 2024 15:31:55 +0100 Subject: [PATCH 33/86] Returned bcond_with artifacts --- java-latest-openjdk-portable.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index b2e8108..d7b1190 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -29,6 +29,8 @@ %bcond_without release # Enable static library builds by default. %bcond_without staticlibs +# Remove build artifacts by default +%bcond_with artifacts # Build a fresh libjvm.so for use in a copy of the bootstrap JDK %bcond_without fresh_libjvm # Build with system libraries From 0ef00754c6aca958e3018069c3886496501637ff Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 16 Feb 2024 17:39:03 +0100 Subject: [PATCH 34/86] Added chnagesets from Thomas Fitzimons to tune up generate_source_tarball.sh and openjdk_news.sh --- generate_source_tarball.sh | 98 ++++++++++++++++++++++++-------------- openjdk_news.sh | 6 +-- 2 files changed, 64 insertions(+), 40 deletions(-) diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index 2150bbf..575df62 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -1,4 +1,20 @@ #!/bin/bash + +# Copyright (C) 2024 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + # Generates the 'source tarball' for JDK projects. # # Example 1: @@ -81,9 +97,17 @@ if [ "$OPENJDK_LATEST" != "" ] ; then | tail --lines 1) PROJECT_NAME=openjdk REPO_NAME=jdk"${FEATURE_VERSION}"u + # Skip -ga tags since those are the same as the most recent non-ga tag, and + # the non-ga tag is the one that is used to generated the official source + # tarball. For example: + # ca760c86642aa2e0d9b571aaabac054c0239fbdc refs/tags/jdk-17.0.10-ga^{} + # 25a2e6c20c9a96853714284cabc6b456eb095070 refs/tags/jdk-17.0.10-ga + # ca760c86642aa2e0d9b571aaabac054c0239fbdc refs/tags/jdk-17.0.10+7^{} + # e49c5749b10f3e90274b72e9279f794fdd191d27 refs/tags/jdk-17.0.10+7 VERSION=$(git ls-remote --tags --refs --sort=-version:refname \ "${OPENJDK_URL_DEFAULT}/${PROJECT_NAME}/${REPO_NAME}.git" \ "jdk-${FEATURE_VERSION}*" \ + | grep --invert-match '\-ga$' \ | head --lines 1 | cut --characters 52-) FILE_NAME_ROOT=open${VERSION} WITH_TEMP=1 @@ -178,62 +202,60 @@ echo -e "\tTO_COMPRESS: ${TO_COMPRESS}" echo -e "\tBOOT_JDK: ${BOOT_JDK}" if [ -d "${FILE_NAME_ROOT}" ] ; then - echo "exists exists exists exists exists exists exists " - echo "reusing reusing reusing reusing reusing reusing " - echo "${FILE_NAME_ROOT}" - STAT_TIME="$(stat --format=%Y "${FILE_NAME_ROOT}")" - TAR_TIME="$(date --date=@"${STAT_TIME}" --iso-8601=seconds)" + echo "exists exists exists exists exists exists exists " + echo "reusing reusing reusing reusing reusing reusing " + echo "${FILE_NAME_ROOT}" + STAT_TIME="$(stat --format=%Y "${FILE_NAME_ROOT}")" + TAR_TIME="$(date --date=@"${STAT_TIME}" --iso-8601=seconds)" else - mkdir "${FILE_NAME_ROOT}" - pushd "${FILE_NAME_ROOT}" - echo "Cloning ${VERSION} root repository from ${REPO_ROOT}" - git clone --depth=1 -b "${VERSION}" "${REPO_ROOT}" "${VERSION}" - pushd "${VERSION}" - TAR_TIME="$(git log --max-count 1 --format=%cI)" + mkdir "${FILE_NAME_ROOT}" + pushd "${FILE_NAME_ROOT}" + echo "Cloning ${VERSION} root repository from ${REPO_ROOT}" + git clone --depth=1 -b "${VERSION}" "${REPO_ROOT}" "${VERSION}" + pushd "${VERSION}" + TAR_TIME="$(git log --max-count 1 --format=%cI)" + popd popd - popd fi pushd "${FILE_NAME_ROOT}" - EA_PART="$(git tag --contains "${VERSION}" \ - | grep --quiet '\-ga$' || echo '-ea')" - # Generate .src-rev so build has knowledge of the revision the tarball was # created from mkdir build pushd build - sh "${PWD}"/../"${VERSION}"/configure --with-boot-jdk="${BOOT_JDK}" - make store-source-revision + sh "${PWD}"/../"${VERSION}"/configure --with-boot-jdk="${BOOT_JDK}" + make store-source-revision popd rm -rf build - # Remove commit checks - echo "Removing $(find ${VERSION} -name '.jcheck' -print)" - find ${VERSION} -name '.jcheck' -print0 | xargs -0 rm -r - - # Remove history and GHA - echo "find ${VERSION} -name '.hgtags'" - find ${VERSION} -name '.hgtags' -exec rm -fv '{}' '+' - echo "find ${VERSION} -name '.hgignore'" - find ${VERSION} -name '.hgignore' -exec rm -fv '{}' '+' - echo "find ${VERSION} -name '.gitattributes'" - find ${VERSION} -name '.gitattributes' -exec rm -fv '{}' '+' - echo "find ${VERSION} -name '.gitignore'" - find ${VERSION} -name '.gitignore' -exec rm -fv '{}' '+' - echo "find ${VERSION} -name '.git'" - find ${VERSION} -name '.git' -exec rm -rfv '{}' '+' - echo "find ${VERSION} -name '.github'" - find ${VERSION} -name '.github' -exec rm -rfv '{}' '+' - + EA_PART="$(awk -F= \ + '/^DEFAULT_PROMOTED_VERSION_PRE/ { if ($2) print "-"$2 }' \ + "${VERSION}"/make/conf/version-numbers.conf)" + TARBALL_BASE=${FILE_NAME_ROOT}${EA_PART}.tar + pushd "${VERSION}" + # Omit commit checks, history, and GHA from archive. + for skip in .jcheck .hgtags .hgignore .gitattributes .gitignore .github + do + echo "${skip}"" export-ignore" >> .git/info/attributes + done + # Do not bother with --mtime here; specify it to tar below. + # Unforunately, git-archive sorts added files like .src-rev at the end; + # retar below to use GNU tar --sort=name ordering which sorts .src-rev + # at the start. + git archive --output "${TARBALL_BASE}" --prefix="${VERSION}"/ \ + --add-file=.src-rev --format=tar "${VERSION}" + popd + mv "${VERSION}" "${VERSION}".git + tar xf "${VERSION}".git/"${TARBALL_BASE}" echo "Compressing remaining forest" if [ "$COMPRESSION" = "xz" ] ; then SWITCH=cJf else SWITCH=czf fi - TARBALL_NAME=${FILE_NAME_ROOT}${EA_PART}.tar.${COMPRESSION} + TARBALL_NAME=${TARBALL_BASE}.${COMPRESSION} XZ_OPT=${XZ_OPT-"-T0"} \ tar --mtime="${TAR_TIME}" --owner=root --group=root --sort=name \ - --exclude-vcs -$SWITCH "${TARBALL_NAME}" "${TO_COMPRESS}" + -$SWITCH "${TARBALL_NAME}" "${TO_COMPRESS}" mv "${TARBALL_NAME}" .. popd if [ "$WITH_TEMP" != "" ] ; then @@ -247,4 +269,6 @@ fi # Local Variables: # compile-command: "shellcheck generate_source_tarball.sh" # fill-column: 80 +# indent-tabs-mode: nil +# sh-basic-offset: 4 # End: diff --git a/openjdk_news.sh b/openjdk_news.sh index 386aa53..d1bd061 100755 --- a/openjdk_news.sh +++ b/openjdk_news.sh @@ -58,12 +58,12 @@ for repos in . $(${SCRIPT_DIR}/discover_trees.sh ${REPO}); do if test "x$TYPE" = "xhg"; then hg log -r "tag('$NEW_RELEASE'):tag('$OLD_RELEASE') - tag('$OLD_RELEASE')" -R $REPO/$repos -G -M ${REPO}/${SUBDIR} | \ - egrep '^[o:| ]*summary'|grep -v 'Added tag'|sed -r 's#^[o:| ]*summary:\W*([0-9])# - JDK-\1#'| \ + grep -E '^[o:| ]*summary'|grep -v 'Added tag'|sed -r 's#^[o:| ]*summary:\W*([0-9])# - JDK-\1#'| \ sed 's#^[o:| ]*summary:\W*# - #' >> ${TMPDIR}/fixes2; hg log -v -r "tag('$NEW_RELEASE'):tag('$OLD_RELEASE') - tag('$OLD_RELEASE')" -R $REPO/$repos -G -M ${REPO}/${SUBDIR} | \ - egrep '^[o:| ]*[0-9]{7}'|sed -r 's#^[o:| ]*([0-9]{7})# - JDK-\1#' >> ${TMPDIR}/fixes3; + grep -E '^[o:| ]*[0-9]{7}'|sed -r 's#^[o:| ]*([0-9]{7})# - JDK-\1#' >> ${TMPDIR}/fixes3; else - git -C ${REPO} log --no-merges --pretty=format:%B ${NEW_RELEASE}...${OLD_RELEASE} -- ${SUBDIR} |egrep '^[0-9]{7}' | \ + git -C ${REPO} log --no-merges --pretty=format:%B ${NEW_RELEASE}...${OLD_RELEASE} -- ${SUBDIR} |grep -E '^[0-9]{7}' | \ sed -r 's#^([0-9])# - JDK-\1#' >> ${TMPDIR}/fixes2; touch ${TMPDIR}/fixes3 ; # unused fi From a1b4ddc7978767f971286c691ea5f1723c98e198 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 16 Feb 2024 17:52:24 +0100 Subject: [PATCH 35/86] updated to 22+36 tmp comment out of ea exit 17 --- .gitignore | 1 + generate_source_tarball.sh | 4 ++-- java-latest-openjdk-portable.spec | 12 ++++++++---- sources | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 0d4cc13..2259ed3 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ /openjdk-21.0.2+12.tar.xz /openjdk-21.0.2+13.tar.xz /openjdk-22+32-ea.tar.xz +/openjdk-jdk-22+36-ea.tar.xz diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index 575df62..2913af4 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -35,8 +35,8 @@ # VERSION, e.g.: # # PROJECT_NAME=openjdk -# REPO_NAME=jdk17u -# VERSION=jdk-17.0.10+7 +# REPO_NAME=jdk22u +# VERSION=jdk-22+36 # # or to e.g., prepare systemtap, icedtea7's jstack and other tapsets: # diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index d7b1190..732a91e 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -397,8 +397,8 @@ %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 32 -%global rpmrelease 2 +%global buildver 36 +%global rpmrelease 1 #%%global tagsuffix %%{nil} # 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 @@ -601,7 +601,7 @@ License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv URL: http://openjdk.java.net/ # The source tarball, generated using generate_source_tarball.sh -Source0: https://openjdk-sources.osci.io/openjdk%{featurever}/open%{vcstag}%{ea_designator_zip}.tar.xz +Source0: https://openjdk-sources.osci.io/openjdk%{featurever}/openjdk-%{vcstag}%{ea_designator_zip}.tar.xz # Use 'icedtea_sync.sh' to update the following # They are based on code contained in the IcedTea project (6.x). @@ -1023,7 +1023,7 @@ if [ "x${UPSTREAM_EA_DESIGNATOR}" != "x%{ea_designator}" ] ; then echo "WARNING: Designator mismatch"; echo "Spec file is configured for a %{build_type} build with designator '%{ea_designator}'" echo "Upstream version-pre setting is '${UPSTREAM_EA_DESIGNATOR}'"; - exit 17 + #exit 17 fi # Systemtap is processed in rpms @@ -1780,6 +1780,10 @@ done %endif %changelog +* Fri Feb 16 2024 Jiri Vanek - 1:22.0.0.0.36-1.rolling +- updated to 22+36 +- tmp comment out of ea exit 17 + * Wed Jan 24 2024 Jiri Vanek - 1:22.0.0.0.32-2.rolling - Move to -P usage for patch macro which works on all RPM versions - generate_source_tarball.sh: Add note on network usage of OPENJDK_LATEST diff --git a/sources b/sources index a668828..1f686d2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-22+32-ea.tar.xz) = bbe17240a557de6d209a1398b0108d0542fa29022ae04b1f26962ec230c0764e1a5bf979e07367ef32ec5e5fa2c0cbf21e408861240d32a81fe51df35c67a553 +SHA512 (openjdk-jdk-22+36-ea.tar.xz) = ecc6e6b6fd10eb6c16d9eba03fe4dbf5f5b5406b166e0e24d9d4b8e339d148da4a7b551e5669f7c9327821837988696990886e55f1045ea20b54bb1ac6ef0fc6 From f6de0e71b58419ae2891e86ef444eac4f3fa0770 Mon Sep 17 00:00:00 2001 From: Jiri Date: Sat, 17 Feb 2024 09:22:03 +0100 Subject: [PATCH 36/86] fixed condition for taspets --- java-latest-openjdk-portable.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 732a91e..4b63638 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -321,7 +321,7 @@ %endif %ifarch %{systemtap_arches} -%if (0%{?rhel} > 0) +%if (0%{?rhel} > 0 && !0%{?epel}) %global with_systemtap 1 %else %global with_systemtap 0 @@ -1783,6 +1783,7 @@ done * Fri Feb 16 2024 Jiri Vanek - 1:22.0.0.0.36-1.rolling - updated to 22+36 - tmp comment out of ea exit 17 +- fixed condition for taspets * Wed Jan 24 2024 Jiri Vanek - 1:22.0.0.0.32-2.rolling - Move to -P usage for patch macro which works on all RPM versions From b6281fa0447ca42b71c0e3802f1b2cd806d32d9a Mon Sep 17 00:00:00 2001 From: Jiri Date: Sat, 17 Feb 2024 12:18:12 +0100 Subject: [PATCH 37/86] bumped build jdk to 22 --- java-latest-openjdk-portable.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 4b63638..a7363cd 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -338,7 +338,7 @@ # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, # and this it is better to change it here, on single place -%global buildjdkver 21 +%global buildjdkver 22 # We don't add any LTS designator for STS packages (Fedora and EPEL). # We need to explicitly exclude EPEL as it would have the %%{rhel} macro defined. %if 0%{?rhel} && !0%{?epel} @@ -398,7 +398,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 36 -%global rpmrelease 1 +%global rpmrelease 2 #%%global tagsuffix %%{nil} # 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 @@ -1780,6 +1780,9 @@ done %endif %changelog +* Fri Feb 16 2024 Jiri Vanek - 1:22.0.0.0.36-2.rolling +- bumped build jdk to 22 + * Fri Feb 16 2024 Jiri Vanek - 1:22.0.0.0.36-1.rolling - updated to 22+36 - tmp comment out of ea exit 17 From 32252741f89bed50477bdc7d331d4d32a800b3dc Mon Sep 17 00:00:00 2001 From: Songsong Zhang Date: Wed, 21 Feb 2024 02:27:52 +0000 Subject: [PATCH 38/86] Add riscv64 support --- java-latest-openjdk-portable.spec | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index a7363cd..34a0bda 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -131,7 +131,7 @@ # Set of architectures for which we build fastdebug builds %global fastdebug_arches x86_64 ppc64le aarch64 # Set of architectures with a Just-In-Time (JIT) compiler -%global jit_arches %{arm} %{aarch64} %{ix86} %{power64} s390x sparcv9 sparc64 x86_64 +%global jit_arches %{arm} %{aarch64} %{ix86} %{power64} s390x sparcv9 sparc64 x86_64 riscv64 # Set of architectures which use the Zero assembler port (!jit_arches) %global zero_arches ppc s390 # Set of architectures which run a full bootstrap cycle @@ -141,7 +141,7 @@ # Set of architectures with a Ahead-Of-Time (AOT) compiler %global aot_arches x86_64 %{aarch64} # Set of architectures which support the serviceability agent -%global sa_arches %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} %{arm} +%global sa_arches %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} %{arm} riscv64 # Set of architectures which support class data sharing # As of JDK-8005165 in OpenJDK 10, class sharing is not arch-specific # However, it does segfault on the Zero assembler port, so currently JIT only @@ -149,7 +149,7 @@ # Set of architectures for which we build the Shenandoah garbage collector %global shenandoah_arches x86_64 %{aarch64} # Set of architectures for which we build the Z garbage collector -%global zgc_arches x86_64 +%global zgc_arches x86_64 riscv64 # Set of architectures for which alt-java has SSB mitigation %global ssbd_arches x86_64 # Set of architectures for which java has short vector math library (libjsvml.so) @@ -304,6 +304,10 @@ %global archinstall aarch64 %global stapinstall arm64 %endif +%ifarch riscv64 +%global archinstall riscv64 +%global stapinstall %{_target_cpu} +%endif # 32 bit sparc, optimized for v9 %ifarch sparcv9 %global archinstall sparc @@ -398,7 +402,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 36 -%global rpmrelease 2 +%global rpmrelease 3 #%%global tagsuffix %%{nil} # 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 @@ -1041,7 +1045,7 @@ export NUM_PROC=${NUM_PROC:-1} [ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max} %endif -%ifarch s390x sparc64 alpha %{power64} %{aarch64} +%ifarch s390x sparc64 alpha %{power64} %{aarch64} riscv64 export ARCH_DATA_MODEL=64 %endif %ifarch alpha @@ -1780,6 +1784,9 @@ done %endif %changelog +* Wed Feb 21 2024 Songsong Zhang - 1:22.0.0.0.36-3.rolling +- Add riscv64 support + * Fri Feb 16 2024 Jiri Vanek - 1:22.0.0.0.36-2.rolling - bumped build jdk to 22 From 0d5cc81b89331950f1f78b9f1970a7af96239444 Mon Sep 17 00:00:00 2001 From: Jiri Date: Tue, 30 Apr 2024 11:25:53 +0200 Subject: [PATCH 39/86] April CPU --- .gitignore | 1 + NEWS | 976 +++--------------------------- generate_source_tarball.sh | 2 +- java-latest-openjdk-portable.spec | 11 +- sources | 2 +- 5 files changed, 82 insertions(+), 910 deletions(-) diff --git a/.gitignore b/.gitignore index 2259ed3..0b3e031 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ /openjdk-21.0.2+13.tar.xz /openjdk-22+32-ea.tar.xz /openjdk-jdk-22+36-ea.tar.xz +/openjdk-jdk-22.0.1+8.tar.xz diff --git a/NEWS b/NEWS index 24382b1..8ceb10c 100644 --- a/NEWS +++ b/NEWS @@ -3,909 +3,77 @@ Key: JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY -New in release OpenJDK 21.0.2 (2024-01-16): +New in release OpenJDK 22.0.1 (2024-04-16): =========================================== -* CVEs - - CVE-2024-20918 - - CVE-2024-20919 - - CVE-2024-20921 - - CVE-2024-20945 - - CVE-2024-20952 -* Security fixes - - JDK-8308204: Enhanced certificate processing - - JDK-8314295: Enhance verification of verifier - - JDK-8314307: Improve loop handling - - JDK-8314468: Improve Compiler loops - - JDK-8316976: Improve signature handling - - JDK-8317547: Enhance TLS connection support -* Other changes - - JDK-8038244: (fs) Check return value of malloc in Java_sun_nio_fs_AixNativeDispatcher_getmntctl() - - JDK-8161536: sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java fails with ProviderException - - JDK-8219652: [aix] Tests failing with JNI attach problems. - - JDK-8225377: type annotations are not visible to javac plugins across compilation boundaries - - JDK-8232839: JDI AfterThreadDeathTest.java failed due to "FAILED: Did not get expected IllegalThreadStateException on a StepRequest.enable()" - - JDK-8267502: JDK-8246677 caused 16x performance regression in SynchronousQueue - - JDK-8267509: Improve IllegalAccessException message to include the cause of the exception - - JDK-8268916: Tests for AffirmTrust roots - - JDK-8286757: adlc tries to build with /pathmap but without /experimental:deterministic - - JDK-8294156: Allow PassFailJFrame.Builder to create test UI - - JDK-8294158: HTML formatting for PassFailJFrame instructions - - JDK-8294427: Check boxes and radio buttons have rendering issues on Windows in High DPI env - - JDK-8294535: Add screen capture functionality to PassFailJFrame - - JDK-8295068: SSLEngine throws NPE parsing CertificateRequests - - JDK-8295555: Primitive wrapper caches could be `@Stable` - - JDK-8299614: Shenandoah: STW mark should keep nmethod/oops referenced from stack chunk alive - - JDK-8300663: java/util/concurrent/SynchronousQueue/Fairness.java failed with "Error: fair=true i=0 j=1" - - JDK-8301247: JPackage app-image exe launches multiple exe's in JDK 17+ - - JDK-8301341: LinkedTransferQueue does not respect timeout for poll() - - JDK-8301457: Code in SendPortZero.java is uncommented even after JDK-8236852 was fixed - - JDK-8301489: C1: ShortLoopOptimizer might lift instructions before their inputs - - JDK-8301846: Invalid TargetDataLine after screen lock when using JFileChooser or COM library - - JDK-8303737: C2: Load can bypass subtype check that enforces it's from the right object type - - JDK-8306561: Possible out of bounds access in print_pointer_information - - JDK-8308103: Massive (up to ~30x) increase in C2 compilation time since JDK 17 - - JDK-8308452: Extend internal Architecture enum with byte order and address size - - JDK-8308479: [s390x] Implement alternative fast-locking scheme - - JDK-8308592: Framework for CA interoperability testing - - JDK-8308593: Add KEEPALIVE Extended Socket Options Support for Windows - - JDK-8309209: C2 failed "assert(_stack_guard_state == stack_guard_reserved_disabled) failed: inconsistent state" - - JDK-8309305: sun/security/ssl/SSLSocketImpl/BlockedAsyncClose.java fails with jtreg test timeout - - JDK-8309545: Thread.interrupted from virtual thread needlessly resets interrupt status - - JDK-8309663: test fails "assert(check_alignment(result)) failed: address not aligned: 0x00000008baadbabe" - - JDK-8309778: java/nio/file/Files/CopyAndMove.java fails when using second test directory - - JDK-8309974: some JVMCI tests fail when VM options include -XX:+EnableJVMCI - - JDK-8310239: Add missing cross modifying fence in nmethod entry barriers - - JDK-8310512: Cleanup indentation in jfc files - - JDK-8310596: Utilize existing method frame::interpreter_frame_monitor_size_in_bytes() - - JDK-8310982: jdk/internal/util/ArchTest.java fails after JDK-8308452 failed with Method isARM() - - JDK-8311261: [AIX] TestAlwaysPreTouchStacks.java fails due to java.lang.RuntimeException: Did not find expected NMT output - - JDK-8311514: Incorrect regex in TestMetaSpaceLog.java - - JDK-8311585: Add JRadioButtonMenuItem to bug8031573.java - - JDK-8311591: Add SystemModulesPlugin test case that splits module descriptors with new local variables defined by DedupSetBuilder - - JDK-8311630: [s390] Implementation of Foreign Function & Memory API (Preview) - - JDK-8311631: When multiple users run tools/jpackage/share/LicenseTest.java, Permission denied for writing /var/tmp/*.files - - JDK-8311680: Update the release version after forking Oct CPU23_10 - - JDK-8311681: Update the Jan CPU24_01 release date in master branch after forking Oct CPU23_10 - - JDK-8311813: C1: Uninitialized PhiResolver::_loop field - - JDK-8311938: Add default cups include location for configure on AIX - - JDK-8312078: [PPC] JcmdScale.java Failing on AIX - - JDK-8312126: NullPointerException in CertStore.getCRLs after 8297955 - - JDK-8312166: (dc) DatagramChannel's socket adaptor does not release carrier thread when blocking in receive - - JDK-8312174: missing JVMTI events from vthreads parked during JVMTI attach - - JDK-8312191: ColorConvertOp.filter for the default destination is too slow - - JDK-8312433: HttpClient request fails due to connection being considered idle and closed - - JDK-8312434: SPECjvm2008/xml.transform with CDS fails with "can't seal package nu.xom" - - JDK-8312440: assert(cast != nullptr) failed: must have added a cast to pin the node - - JDK-8312466: /bin/nm usage in AIX makes needs -X64 flag - - JDK-8312467: relax the builddir check in make/autoconf/basic.m4 - - JDK-8312592: New parentheses warnings after HarfBuzz 7.2.0 update - - JDK-8312612: handle WideCharToMultiByte return values - - JDK-8313164: src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels adjust releasing of resources - - JDK-8313167: Update to use jtreg 7.3 - - JDK-8313206: PKCS11 tests silently skip execution - - JDK-8313244: NM flags handling in configure process - - JDK-8313252: Java_sun_awt_windows_ThemeReader_paintBackground release resources in early returns - - JDK-8313322: RISC-V: implement MD5 intrinsic - - JDK-8313368: (fc) FileChannel.size returns 0 on block special files - - JDK-8313575: Refactor PKCS11Test tests - - JDK-8313616: support loading library members on AIX in os::dll_load - - JDK-8313643: Update HarfBuzz to 8.2.2 - - JDK-8313656: assert(!JvmtiExport::can_support_virtual_threads()) with -XX:-DoJVMTIVirtualThreadTransitions - - JDK-8313756: [BACKOUT] 8308682: Enhance AES performance - - JDK-8313760: [REDO] Enhance AES performance - - JDK-8313779: RISC-V: use andn / orn in the MD5 instrinsic - - JDK-8313781: Add regression tests for large page logging and user-facing error messages - - JDK-8313782: Add user-facing warning if THPs are enabled but cannot be used - - JDK-8313792: Verify 4th party information in src/jdk.internal.le/share/legal/jline.md - - JDK-8313873: java/nio/channels/DatagramChannel/SendReceiveMaxSize.java fails on AIX due to small default RCVBUF size and different IPv6 Header interpretation - - JDK-8314045: ArithmeticException in GaloisCounterMode - - JDK-8314094: java/lang/ProcessHandle/InfoTest.java fails on Windows when run as user with Administrator privileges - - JDK-8314120: Add tests for FileDescriptor.sync - - JDK-8314121: test tools/jpackage/share/RuntimePackageTest.java#id0 fails on RHEL8 - - JDK-8314191: C2 compilation fails with "bad AD file" - - JDK-8314226: Series of colon-style fallthrough switch cases with guards compiled incorrectly - - JDK-8314242: Update applications/scimark/Scimark.java to accept VM flags - - JDK-8314246: javax/swing/JToolBar/4529206/bug4529206.java fails intermittently on Linux - - JDK-8314263: Signed jars triggering Logger finder recursion and StackOverflowError - - JDK-8314330: java/foreign tests should respect vm flags when start new processes - - JDK-8314476: TestJstatdPortAndServer.java failed with "java.rmi.NoSuchObjectException: no such object in table" - - JDK-8314495: Update to use jtreg 7.3.1 - - JDK-8314551: More generic way to handshake GC threads with monitor deflation - - JDK-8314580: PhaseIdealLoop::transform_long_range_checks fails with assert "was tested before" - - JDK-8314632: Intra-case dominance check fails in the presence of a guard - - JDK-8314759: VirtualThread.parkNanos timeout adjustment when pinned should be replaced - - JDK-8314883: Java_java_util_prefs_FileSystemPreferences_lockFile0 write result errno in missing case - - JDK-8314935: Shenandoah: Unable to throw OOME on back-to-back Full GCs - - JDK-8315026: ProcessHandle implementation listing processes on AIX should use getprocs64 - - JDK-8315062: [GHA] get-bootjdk action should return the abolute path - - JDK-8315082: [REDO] Generational ZGC: Tests crash with assert(index == 0 || is_power_of_2(index)) - - JDK-8315088: C2: assert(wq.size() - before == EMPTY_LOOP_SIZE) failed: expect the EMPTY_LOOP_SIZE nodes of this body if empty - - JDK-8315195: RISC-V: Update hwprobe query for new extensions - - JDK-8315206: RISC-V: hwprobe query is_set return wrong value - - JDK-8315213: java/lang/ProcessHandle/TreeTest.java test enhance output of children - - JDK-8315214: Do not run sun/tools/jhsdb tests concurrently - - JDK-8315362: NMT: summary diff reports threads count incorrectly - - JDK-8315377: C2: assert(u->find_out_with(Op_AddP) == nullptr) failed: more than 2 chained AddP nodes? - - JDK-8315383: jlink SystemModulesPlugin incorrectly parses the options - - JDK-8315415: OutputAnalyzer.shouldMatchByLine() fails in some cases - - JDK-8315437: Enable parallelism in vmTestbase/nsk/monitoring/stress/classload tests - - JDK-8315442: Enable parallelism in vmTestbase/nsk/monitoring/stress/thread tests - - JDK-8315452: Erroneous AST missing modifiers for partial input - - JDK-8315499: build using devkit on Linux ppc64le RHEL puts path to devkit into libsplashscreen - - JDK-8315545: C1: x86 cmove can use short branches - - JDK-8315549: CITime misreports code/total nmethod sizes - - JDK-8315554: C1: Replace "cmp reg, 0" with "test reg, reg" on x86 - - JDK-8315578: PPC builds are broken after JDK-8304913 - - JDK-8315579: SPARC64 builds are broken after JDK-8304913 - - JDK-8315606: Open source few swing text/html tests - - JDK-8315612: RISC-V: intrinsic for unsignedMultiplyHigh - - JDK-8315644: increase timeout of sun/security/tools/jarsigner/Warning.java - - JDK-8315651: Stop hiding AIX specific multicast socket errors via NetworkConfiguration (aix) - - JDK-8315683: Parallelize java/util/concurrent/tck/JSR166TestCase.java - - JDK-8315684: Parallelize sun/security/util/math/TestIntegerModuloP.java - - JDK-8315688: Update jdk21u fix version to 21.0.2 - - JDK-8315692: Parallelize gc/stress/TestStressRSetCoarsening.java test - - JDK-8315696: SignedLoggerFinderTest.java test failed - - JDK-8315702: jcmd Thread.dump_to_file slow with millions of virtual threads - - JDK-8315706: com/sun/tools/attach/warnings/DynamicLoadWarningTest.java real fix for failure on AIX - - JDK-8315735: VerifyError when switch statement used with synchronized block - - JDK-8315751: RandomTestBsi1999 fails often with timeouts on Linux ppc64le - - JDK-8315766: Parallelize gc/stress/TestStressIHOPMultiThread.java test - - JDK-8315770: serviceability/sa/TestJmapCoreMetaspace.java should run with -XX:-VerifyDependencies - - JDK-8315774: Enable parallelism in vmTestbase/gc/g1/unloading tests - - JDK-8315863: [GHA] Update checkout action to use v4 - - JDK-8315869: UseHeavyMonitors not used - - JDK-8315920: C2: "control input must dominate current control" assert failure - - JDK-8315931: RISC-V: xxxMaxVectorTestsSmokeTest fails when using RVV - - JDK-8315936: Parallelize gc/stress/TestStressG1Humongous.java test - - JDK-8315937: Enable parallelism in vmTestbase/nsk/stress/numeric tests - - JDK-8315942: Sort platform enums and definitions after JDK-8304913 follow-ups - - JDK-8315960: test/jdk/java/io/File/TempDirDoesNotExist.java leaves test files behind - - JDK-8315971: ProblemList containers/docker/TestMemoryAwareness.java on linux-all - - JDK-8316003: Update FileChooserSymLinkTest.java to HTML instructions - - JDK-8316017: Refactor timeout handler in PassFailJFrame - - JDK-8316025: Use testUI() method of PassFailJFrame.Builder in FileChooserSymLinkTest.java - - JDK-8316030: Update Libpng to 1.6.40 - - JDK-8316031: SSLFlowDelegate should not log from synchronized block - - JDK-8316060: test/hotspot/jtreg/runtime/reflect/ReflectOutOfMemoryError.java may fail if heap is huge - - JDK-8316087: Test SignedLoggerFinderTest.java is still failing - - JDK-8316113: Infinite permission checking loop in java/net/spi/InetAddressResolverProvider/RuntimePermissionTest - - JDK-8316123: ProblemList serviceability/dcmd/gc/RunFinalizationTest.java on AIX - - JDK-8316130: Incorrect control in LibraryCallKit::inline_native_notify_jvmti_funcs - - JDK-8316142: Enable parallelism in vmTestbase/nsk/monitoring/stress/lowmem tests - - JDK-8316156: ByteArrayInputStream.transferTo causes MaxDirectMemorySize overflow - - JDK-8316178: Better diagnostic header for CodeBlobs - - JDK-8316179: Use consistent naming for lightweight locking in MacroAssembler - - JDK-8316181: Move the fast locking implementation out of the .ad files - - JDK-8316199: Remove sun/tools/jstatd/TestJstatd* tests from problemlist for Windows. - - JDK-8316206: Test StretchedFontTest.java fails for Baekmuk font - - JDK-8316304: (fs) Add support for BasicFileAttributes.creationTime() for Linux - - JDK-8316337: (bf) Concurrency issue in DirectByteBuffer.Deallocator - - JDK-8316341: sun/security/pkcs11/PKCS11Test.java needs adjustment on Linux ppc64le Ubuntu 22 - - JDK-8316387: Exclude more failing multicast tests on AIX after JDK-8315651 - - JDK-8316396: Endless loop in C2 compilation triggered by AddNode::IdealIL - - JDK-8316399: Exclude java/net/MulticastSocket/Promiscuous.java on AIX - - JDK-8316400: Exclude jdk/jfr/event/runtime/TestResidentSetSizeEvent.java on AIX - - JDK-8316401: sun/tools/jhsdb/JStackStressTest.java failed with "InternalError: We should have found a thread that owns the anonymous lock" - - JDK-8316411: compiler/compilercontrol/TestConflictInlineCommands.java fails intermittent with force inline by CompileCommand missing - - JDK-8316414: C2: large byte array clone triggers "failed: malformed control flow" assertion failure on linux-x86 - - JDK-8316415: Parallelize sun/security/rsa/SignedObjectChain.java subtests - - JDK-8316418: containers/docker/TestMemoryWithCgroupV1.java get OOM killed with Parallel GC - - JDK-8316436: ContinuationWrapper uses unhandled nullptr oop - - JDK-8316461: Fix: make test outputs TEST SUCCESS after unsuccessful exit - - JDK-8316468: os::write incorrectly handles partial write - - JDK-8316514: Better diagnostic header for VtableStub - - JDK-8316540: StoreReproducibilityTest fails on some locales - - JDK-8316566: RISC-V: Zero extended narrow oop passed to Atomic::cmpxchg - - JDK-8316581: Improve performance of Symbol::print_value_on() - - JDK-8316585: [REDO] runtime/InvocationTests spend a lot of time on dependency verification - - JDK-8316645: RISC-V: Remove dependency on libatomic by adding cmpxchg 1b - - JDK-8316648: jrt-fs.jar classes not reproducible between standard and bootcycle builds - - JDK-8316659: assert(LockingMode != LM_LIGHTWEIGHT || flag == CCR0) failed: bad condition register - - JDK-8316671: sun/security/ssl/SSLSocketImpl/SSLSocketCloseHang.java test fails intermittent with Read timed out - - JDK-8316679: C2 SuperWord: wrong result, load should not be moved before store if not comparable - - JDK-8316710: Exclude java/awt/font/Rotate/RotatedTextTest.java - - JDK-8316719: C2 compilation still fails with "bad AD file" - - JDK-8316735: Print LockStack in hs_err files - - JDK-8316741: BasicStroke.createStrokedShape miter-limits failing on small shapes - - JDK-8316743: RISC-V: Change UseVectorizedMismatchIntrinsic option result to warning - - JDK-8316746: Top of lock-stack does not match the unlocked object - - JDK-8316778: test hprof lib: invalid array element type from JavaValueArray.elementSize - - JDK-8316859: RISC-V: Disable detection of V through HWCAP - - JDK-8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 - - JDK-8316880: AArch64: "stop: Header is not fast-locked" with -XX:-UseLSE since JDK-8315880 - - JDK-8316894: make test TEST="jtreg:test/jdk/..." fails on AIX - - JDK-8316906: Clarify TLABWasteTargetPercent flag - - JDK-8316929: Shenandoah: Shenandoah degenerated GC and full GC need to cleanup old OopMapCache entries - - JDK-8316933: RISC-V: compiler/vectorapi/VectorCastShape128Test.java fails when using RVV - - JDK-8316935: [s390x] Use consistent naming for lightweight locking in MacroAssembler - - JDK-8316958: Add test for unstructured locking - - JDK-8316967: Correct the scope of vmtimer in UnregisteredClasses::load_class - - JDK-8317039: Enable specifying the JDK used to run jtreg - - JDK-8317136: [AIX] Problem List runtime/jni/terminatedThread/TestTerminatedThread.java - - JDK-8317257: RISC-V: llvm build broken - - JDK-8317262: LockStack::contains(oop) fails "assert(t->is_Java_thread()) failed: incorrect cast to JavaThread" - - JDK-8317294: Classloading throws exceptions over already pending exceptions - - JDK-8317327: Remove JT_JAVA dead code in jib-profiles.js - - JDK-8317331: Solaris build failed with "declaration can not follow a statement (E_DECLARATION_IN_CODE)" - - JDK-8317335: Build on windows fails after 8316645 - - JDK-8317336: Assertion error thrown during 'this' escape analysis - - JDK-8317340: Windows builds are not reproducible if MS VS compiler install path differs - - JDK-8317373: Add Telia Root CA v2 - - JDK-8317374: Add Let's Encrypt ISRG Root X2 - - JDK-8317439: Updating RE Configs for BUILD REQUEST 21.0.2+1 - - JDK-8317507: C2 compilation fails with "Exceeded _node_regs array" - - JDK-8317510: Change Windows debug symbol files naming to avoid losing info when an executable and a library share the same name - - JDK-8317581: [s390x] Multiple test failure with LockingMode=2 - - JDK-8317601: Windows build on WSL broken after JDK-8317340 - - JDK-8317603: Improve exception messages thrown by sun.nio.ch.Net native methods (win) - - JDK-8317692: jcmd GC.heap_dump performance regression after JDK-8292818 - - JDK-8317705: ProblemList sun/tools/jstat/jstatLineCountsX.sh on linux-ppc64le and aix due to JDK-8248691 - - JDK-8317706: Exclude java/awt/Graphics2D/DrawString/RotTransText.java on linux - - JDK-8317711: Exclude gtest/GTestWrapper.java on AIX - - JDK-8317736: Stream::handleReset locks twice - - JDK-8317751: ProblemList ConsumeForModalDialogTest.java, MenuItemActivatedTest.java & MouseModifiersUnitTest_Standard.java for windows - - JDK-8317772: NMT: Make peak values available in release builds - - JDK-8317790: Fix Bug entry for exclusion of runtime/jni/terminatedThread/TestTerminatedThread.java on AIX - - JDK-8317803: Exclude java/net/Socket/asyncClose/Race.java on AIX - - JDK-8317807: JAVA_FLAGS removed from jtreg running in JDK-8317039 - - JDK-8317818: Combinatorial explosion during 'this' escape analysis - - JDK-8317834: java/lang/Thread/IsAlive.java timed out - - JDK-8317839: Exclude java/nio/channels/Channels/SocketChannelStreams.java on AIX - - JDK-8317920: JDWP-agent sends broken exception event with onthrow option - - JDK-8317959: Check return values of malloc in native java.base coding - - JDK-8317964: java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java fails on macosx-all after JDK-8317751 - - JDK-8317967: Enhance test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java to handle default cases - - JDK-8317987: C2 recompilations cause high memory footprint - - JDK-8318078: ADLC: pass ASSERT and PRODUCT flags - - JDK-8318089: Class space not marked as such with NMT when CDS is off - - JDK-8318137: Change milestone to fcs for all releases - - JDK-8318144: Match on enum constants with body compiles but fails with MatchException - - JDK-8318183: C2: VM may crash after hitting node limit - - JDK-8318240: [AIX] Cleaners.java test failure - - JDK-8318415: Adjust describing comment of os_getChildren after 8315026 - - JDK-8318474: Fix memory reporter for thread_count - - JDK-8318525: Atomic gtest should run as TEST_VM to access VM capabilities - - JDK-8318528: Rename TestUnstructuredLocking test - - JDK-8318540: make test cannot run .jasm tests directly - - JDK-8318562: Computational test more than 2x slower when AVX instructions are used - - JDK-8318587: refresh libraries cache on AIX in print_vm_info - - JDK-8318591: avoid leaks in loadlib_aix.cpp reload_table() - - JDK-8318669: Target OS detection in 'test-prebuilt' makefile target is incorrect when running on MSYS2 - - JDK-8318705: [macos] ProblemList java/rmi/registry/multipleRegistries/MultipleRegistries.java - - JDK-8318736: com/sun/jdi/JdwpOnThrowTest.java failed with "transport error 202: bind failed: Address already in use" - - JDK-8318759: Add four DigiCert root certificates - - JDK-8318889: C2: add bailout after assert Bad graph detected in build_loop_late - - JDK-8318895: Deoptimization results in incorrect lightweight locking stack - - JDK-8318951: Additional negative value check in JPEG decoding - - JDK-8318953: RISC-V: Small refactoring for MacroAssembler::test_bit - - JDK-8318955: Add ReleaseIntArrayElements in Java_sun_awt_X11_XlibWrapper_SetBitmapShape XlbWrapper.c to early return - - JDK-8318957: enhance agentlib:jdwp help output by info about allow option - - JDK-8318961: increase javacserver connection timeout values and max retry attempts - - JDK-8318981: compiler/compilercontrol/TestConflictInlineCommands.java fails intermittent with 'disallowed by CompileCommand' missing from stdout/stderr - - JDK-8319104: GtestWrapper crashes with SIGILL in AsyncLogTest::test_asynclog_raw on AIX opt - - JDK-8319120: Unbound ScopedValue.get() throws the wrong exception - - JDK-8319184: RISC-V: improve MD5 intrinsic - - JDK-8319187: Add three eMudhra emSign roots - - JDK-8319195: Move most tier 1 vector API regression tests to tier 3 - - JDK-8319268: Build failure with GCC8.3.1 after 8313643 - - JDK-8319339: Internal error on spurious markup in a hybrid snippet - - JDK-8319436: Proxy.newProxyInstance throws NPE if loader is null and interface not visible from class loader - - JDK-8319525: RISC-V: Rename *_riscv64.ad files to *_riscv.ad under riscv/gc - - JDK-8319532: jshell - Non-sealed declarations sometimes break a snippet evaluation - - JDK-8319542: Fix boundaries of region to be tested with os::is_readable_range - - JDK-8319700: [AArch64] C2 compilation fails with "Field too big for insn" - - JDK-8319828: runtime/NMT/VirtualAllocCommitMerge.java may fail if mixing interpreted and compiled native invocations - - JDK-8319922: libCreationTimeHelper.so fails to link in JDK 21 - - JDK-8319958: test/jdk/java/io/File/libGetXSpace.c does not compile on Windows 32-bit - - JDK-8319961: JvmtiEnvBase doesn't zero _ext_event_callbacks - - JDK-8320001: javac crashes while adding type annotations to the return type of a constructor - - JDK-8320053: GHA: Cross-compile gtest code - - JDK-8320209: VectorMaskGen clobbers rflags on x86_64 - - JDK-8320280: RISC-V: Avoid passing t0 as temp register to MacroAssembler::lightweight_lock/unlock - - JDK-8320363: ppc64 TypeEntries::type_unknown logic looks wrong, missed optimization opportunity - - JDK-8320597: RSA signature verification fails on signed data that does not encode params correctly - - JDK-8320601: ProblemList java/lang/invoke/lambda/LambdaFileEncodingSerialization.java on linux-all - - JDK-8321067: Unlock experimental options in EATests.java - - JDK-8322883: [BACKOUT] 8225377: type annotations are not visible to javac plugins across compilation boundaries - - JDK-8322985: [BACKOUT] 8318562: Computational test more than 2x slower when AVX instructions are used - -Notes on individual issues: -=========================== - -core-libs/java.net: - -JDK-8308593: Add KEEPALIVE Extended Socket Options Support for Windows -====================================================================== -On Windows 10 version 1709 and above, TCP_KEEPIDLE and -TCP_KEEPINTERVAL are now supported in the -java.net.ExtendedSocketOptions class. Similarly, on Windows 10 -version 1703 and above, TCP_KEEPCOUNT is now supported. - -hotspot/compiler: - -JDK-8315082: [REDO] Generational ZGC: Tests crash with assert(index == 0 || is_power_of_2(index)) -================================================================================================= -In the initial release of JDK 21, running the JVM with -XX:+UseZGC and -a non-default value of -XX:ObjectAlignmentInBytes could lead to JVM -crashes or incorrect execution. This issue should now be resolved and -it should be possible to use these options again. - -hotspot/runtime: - -JDK-8317772: NMT: Make peak values available in release builds -============================================================== -The peak value is the highest value for committed memory in a given -Native Memory Tracking (NMT) category over the lifetime of the JVM -process. NMT reports will now show the peak value for all categories. - -If the committed memory for a category is at its peak, NMT will -print "at peak". Otherwise, it prints the peak value. - -For example, "Compiler (arena=196KB #4) (peak=6126KB #16)" shows that -compiler arena memory peaked above 6 MB, but now hovers around 200KB. - -JDK-8313782: Add user-facing warning if THPs are enabled but cannot be used -=========================================================================== -On Linux, the JVM will now print the following message to standard -output if Transparent Huge Pages (THPs) are requested, but are not -supported on the operating system: - -"UseTransparentHugePages disabled; transparent huge pages are not -supported by the operating system." - -security-libs/java.security: - -JDK-8317374: Added ISRG Root X2 CA Certificate from Let's Encrypt -================================================================= -The following root certificate has been added to the cacerts -truststore: - -Name: Let's Encrypt -Alias Name: letsencryptisrgx2 -Distinguished Name: CN=ISRG Root X2, O=Internet Security Research Group, C=US - -JDK-8318759: Added Four Root Certificates from DigiCert, Inc. -============================================================= -The following root certificates have been added to the cacerts -truststore: - -Name: DigiCert, Inc. -Alias Name: digicertcseccrootg5 -Distinguished Name: CN=DigiCert CS ECC P384 Root G5, O="DigiCert, Inc.", C=US - -Name: DigiCert, Inc. -Alias Name: digicertcsrsarootg5 -Distinguished Name: CN=DigiCert CS RSA4096 Root G5, O="DigiCert, Inc.", C=US - -Name: DigiCert, Inc. -Alias Name: digicerttlseccrootg5 -Distinguished Name: CN=DigiCert TLS ECC P384 Root G5, O="DigiCert, Inc.", C=US - -Name: DigiCert, Inc. -Alias Name: digicerttlsrsarootg5 -Distinguished Name: CN=DigiCert TLS RSA4096 Root G5, O="DigiCert, Inc.", C=US - -JDK-8319187: Added Three Root Certificates from eMudhra Technologies Limited -============================================================================ -The following root certificates have been added to the cacerts -truststore: - -Name: eMudhra Technologies Limited -Alias Name: emsignrootcag1 -Distinguished Name: CN=emSign Root CA - G1, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN - -Name: eMudhra Technologies Limited -Alias Name: emsigneccrootcag3 -Distinguished Name: CN=emSign ECC Root CA - G3, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN - -Name: eMudhra Technologies Limited -Alias Name: emsignrootcag2 -Distinguished Name: CN=emSign Root CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN - -JDK-8317373: Added Telia Root CA v2 Certificate -=============================================== -The following root certificate has been added to the cacerts -truststore: - -Name: Telia Root CA v2 -Alias Name: teliarootcav2 -Distinguished Name: CN=Telia Root CA v2, O=Telia Finland Oyj, C=FI ``` - -New in release OpenJDK 21.0.1 (2023-10-17): -=========================================== - -* CVEs - - CVE-2023-22081 - - CVE-2023-22025 -* Security fixes - - JDK-8286503, JDK-8312367: Enhance security classes - - JDK-8296581: Better system proxy support - - JDK-8297856: Improve handling of Bidi characters - - JDK-8309966: Enhanced TLS connections - - JDK-8312248: Enhanced archival support redux - - JDK-8314649: Enhanced archival support redux - - JDK-8317121: vector_masked_load instruction is moved too early after JDK-8286941 -* Other changes - - JDK-8240567: MethodTooLargeException thrown while creating a jlink image - - JDK-8284772: GHA: Use GCC Major Version Dependencies Only - - JDK-8293114: JVM should trim the native heap - - JDK-8299658: C1 compilation crashes in LinearScan::resolve_exception_edge - - JDK-8302017: Allocate BadPaddingException only if it will be thrown - - JDK-8303815: Improve Metaspace test speed - - JDK-8304954: SegmentedCodeCache fails when using large pages - - JDK-8307766: Linux: Provide the option to override the timer slack - - JDK-8308042: [macos] Developer ID Application Certificate not picked up by jpackage if it contains UNICODE characters - - JDK-8308047: java/util/concurrent/ScheduledThreadPoolExecutor/BasicCancelTest.java timed out and also had jcmd pipe errors - - JDK-8308184: Launching java with large number of jars in classpath with java.protocol.handler.pkgs system property set can lead to StackOverflowError - - JDK-8308474: DSA does not reset SecureRandom when initSign is called again - - JDK-8308609: java/lang/ScopedValue/StressStackOverflow.java fails with "-XX:-VMContinuations" - - JDK-8309032: jpackage does not work for module projects unless --module-path is specified - - JDK-8309088: security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java fails - - JDK-8309214: sun/security/pkcs11/KeyStore/CertChainRemoval.java fails after 8301154 - - JDK-8309475: Test java/foreign/TestByteBuffer.java fails: a problem with msync (aix) - - JDK-8309502: RISC-V: String.indexOf intrinsic may produce misaligned memory loads - - JDK-8309591: Socket.setOption(TCP_QUICKACK) uses wrong level - - JDK-8309746: Reconfigure check should include make/conf/version-numbers.conf - - JDK-8309889: [s390] Missing return statement after calling jump_to_native_invoker method in generate_method_handle_dispatch. - - JDK-8310106: sun.security.ssl.SSLHandshake.getHandshakeProducer() incorrectly checks handshakeConsumers - - JDK-8310171: Bump version numbers for 21.0.1 - - JDK-8310211: serviceability/jvmti/thread/GetStackTrace/getstacktr03/getstacktr03.java failing - - JDK-8310233: Fix THP detection on Linux - - JDK-8310268: RISC-V: misaligned memory access in String.Compare intrinsic - - JDK-8310321: make JDKOPT_CHECK_CODESIGN_PARAMS more verbose - - JDK-8310586: ProblemList java/lang/ScopedValue/StressStackOverflow.java#default with virtual threads on linux-all - - JDK-8310687: JDK-8303215 is incomplete - - JDK-8310873: Re-enable locked_create_entry symbol check in runtime/NMT/CheckForProperDetailStackTrace.java for RISC-V - - JDK-8311026: Some G1 specific tests do not set -XX:+UseG1GC - - JDK-8311033: [macos] PrinterJob does not take into account Sides attribute - - JDK-8311160: [macOS, Accessibility] VoiceOver: No announcements on JRadioButtonMenuItem and JCheckBoxMenuItem - - JDK-8311249: Remove unused MemAllocator::obj_memory_range - - JDK-8311285: report some fontconfig related environment variables in hs_err file - - JDK-8311511: Improve description of NativeLibrary JFR event - - JDK-8311592: ECKeySizeParameterSpec causes too many exceptions on third party providers - - JDK-8311682: Change milestone to fcs for all releases - - JDK-8311862: RISC-V: small improvements to shift immediate instructions - - JDK-8311917: MAP_FAILED definition seems to be obsolete in src/java.desktop/unix/native/common/awt/fontpath.c - - JDK-8311921: Inform about MaxExpectedDataSegmentSize in case of pthread_create failures on AIX - - JDK-8311923: TestIRMatching.java fails on RISC-V - - JDK-8311926: java/lang/ScopedValue/StressStackOverflow.java takes 9mins in tier1 - - JDK-8311955: c++filt is now ibm-llvm-cxxfilt when using xlc17 / clang on AIX - - JDK-8311981: Test gc/stringdedup/TestStringDeduplicationAgeThreshold.java#ZGenerational timed out - - JDK-8312127: FileDescriptor.sync should temporarily increase parallelism - - JDK-8312180: (bf) MappedMemoryUtils passes incorrect arguments to msync (aix) - - JDK-8312182: THPs cause huge RSS due to thread start timing issue - - JDK-8312394: [linux] SIGSEGV if kernel was built without hugepage support - - JDK-8312395: Improve assertions in growableArray - - JDK-8312401: SymbolTable::do_add_if_needed hangs when called in InstanceKlass::add_initialization_error path with requesting length exceeds max_symbol_length - - JDK-8312489: Increase jdk.jar.maxSignatureFileSize default which is too low for JARs such as WhiteSource/Mend unified agent jar - - JDK-8312525: New test runtime/os/TestTrimNative.java#trimNative is failing: did not see the expected RSS reduction - - JDK-8312535: MidiSystem.getSoundbank() throws unexpected SecurityException - - JDK-8312555: Ideographic characters aren't stretched by AffineTransform.scale(2, 1) - - JDK-8312573: Failure during CompileOnly parsing leads to ShouldNotReachHere - - JDK-8312585: Rename DisableTHPStackMitigation flag to THPStackMitigation - - JDK-8312591: GCC 6 build failure after JDK-8280982 - - JDK-8312619: Strange error message when switching over long - - JDK-8312620: WSL Linux build crashes after JDK-8310233 - - JDK-8312625: Test serviceability/dcmd/vm/TrimLibcHeapTest.java failed: RSS use increased - - JDK-8312909: C1 should not inline through interface calls with non-subtype receiver - - JDK-8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match - - JDK-8312984: javac may crash on a record pattern with too few components - - JDK-8313081: MonitoringSupport_lock should be unconditionally initialized after 8304074 - - JDK-8313248: C2: setScopedValueCache intrinsic exposes nullptr pre-values to store barriers - - JDK-8313262: C2: Sinking node may cause required cast to be dropped - - JDK-8313307: java/util/Formatter/Padding.java fails on some Locales - - JDK-8313312: Add missing classpath exception copyright header - - JDK-8313323: javac -g on a java file which uses unnamed variable leads to ClassFormatError when launching that class - - JDK-8313402: C1: Incorrect LoadIndexed value numbering - - JDK-8313428: GHA: Bump GCC versions for July 2023 updates - - JDK-8313576: GCC 7 reports compiler warning in bundled freetype 2.13.0 - - JDK-8313602: increase timeout for jdk/classfile/CorpusTest.java - - JDK-8313626: C2 crash due to unexpected exception control flow - - JDK-8313657: com.sun.jndi.ldap.Connection.cleanup does not close connections on SocketTimeoutErrors - - JDK-8313676: Amend TestLoadIndexedMismatch test to target intrinsic directly - - JDK-8313678: SymbolTable can leak Symbols during cleanup - - JDK-8313691: use close after failing os::fdopen in vmError and ciEnv - - JDK-8313701: GHA: RISC-V should use the official repository for bootstrap - - JDK-8313707: GHA: Bootstrap sysroots with --variant=minbase - - JDK-8313752: InstanceKlassFlags::print_on doesn't print the flag names - - JDK-8313765: Invalid CEN header (invalid zip64 extra data field size) - - JDK-8313796: AsyncGetCallTrace crash on unreadable interpreter method pointer - - JDK-8313874: JNI NewWeakGlobalRef throws exception for null arg - - JDK-8313901: [TESTBUG] test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java fails with java.lang.VirtualMachineError - - JDK-8313904: [macos] All signing tests which verifies unsigned app images are failing - - JDK-8314020: Print instruction blocks in byte units - - JDK-8314024: SIGSEGV in PhaseIdealLoop::build_loop_late_post_work due to bad immediate dominator info - - JDK-8314063: The socket is not closed in Connection::createSocket when the handshake failed for LDAP connection - - JDK-8314117: RISC-V: Incorrect VMReg encoding in RISCV64Frame.java - - JDK-8314118: Update JMH devkit to 1.37 - - JDK-8314139: TEST_BUG: runtime/os/THPsInThreadStackPreventionTest.java could fail on machine with large number of cores - - JDK-8314144: gc/g1/ihop/TestIHOPStatic.java fails due to extra concurrent mark with -Xcomp - - JDK-8314216: Case enumConstant, pattern compilation fails - - JDK-8314262: GHA: Cut down cross-compilation sysroots deeper - - JDK-8314423: Multiple patterns without unnamed variables - - JDK-8314426: runtime/os/TestTrimNative.java is failing on slow machines - - JDK-8314501: Shenandoah: sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java fails - - JDK-8314517: some tests fail in case ipv6 is disabled on the machine - - JDK-8314618: RISC-V: -XX:MaxVectorSize does not work as expected - - JDK-8314656: GHA: No need for Debian ports keyring installation after JDK-8313701 - - JDK-8314679: SA fails to properly attach to JVM after having just detached from a different JVM - - JDK-8314730: GHA: Drop libfreetype6-dev transitional package in favor of libfreetype-dev - - JDK-8314850: SharedRuntime::handle_wrong_method() gets called too often when resolving Continuation.enter - - JDK-8314960: Add Certigna Root CA - 2 - - JDK-8315020: The macro definition for LoongArch64 zero build is not accurate. - - JDK-8315051: jdk/jfr/jvm/TestGetEventWriter.java fails with non-JVMCI GCs - - JDK-8315534: Incorrect warnings about implicit annotation processing - -Notes on individual issues: -=========================== - -core-libs/java.util.jar: - -JDK-8313765: Invalid CEN header (invalid zip64 extra data field size) -===================================================================== -Additional validity checks in the handling of Zip64 files, -JDK-8302483, introduced in 21.0.0, caused the use of some valid zip -files to now fail with the error, `Invalid CEN header (invalid zip64 -extra data field size)` - -This release, 21.0.1, allows for zero length headers and additional -padding produced by some Zip64 creation tools. - -The following third party tools have also released patches to better -adhere to the ZIP File Format Specification: - -* Apache Commons Compress fix for Empty CEN Zip64 Extra Headers fixed in Commons Compress release 1.11 -* Apache Ant fix for Empty CEN Zip64 Extra Headers fixed in Ant 1.10.14 -* BND issue with writing invalid Extra Headers fixed in BND 5.3 - -The maven-bundle-plugin 5.1.5 includes the BND 5.3 patch. - -If these improved validation checks cause issues for deployed zip or -jar files, check how the file was created and whether patches are -available from the generating software to resolve the issue. With -both JDK releases, the checks can be disabled by setting the new -system property, `jdk.util.zip.disableZip64ExtraFieldValidation` to -`true`. - -hotspot/runtime: - -JDK-8311981: JVM May Hang When Using Generational ZGC if a VM Handshake Stalls on Memory -======================================================================================== -The JVM can hang under an uncommon condition that involves the JVM -running out of heap memory, the GC just starting a relocation phase to -reclaim memory, and a JVM thread-local Handshake asking to relocate an -object. This potential deadlock should now be avoided in this -release. - -core-libs/java.util.regex: - -JDK-8312976: `java.util.regex.MatchResult` Might Throw `StringIndexOutOfBoundsException` on Regex Patterns Containing Lookaheads and Lookbehinds -================================================================================================================================================ -JDK-8132995 introduced an unintended regression when using instances -returned by `java.util.regex.Matcher.toMatchResult()`. - -This regression happens with a `java.util.regex.Pattern`s containing -lookaheads and lookbehinds that, in turn, contain groups. If these are -located outside the match, a `StringIndexOutOfBoundsException` is -thrown when accessing these groups. See JDK-8312976 for an example. - -The issue is resolved in this release by calculating a minimum start -location as part of the match result and using this in constructing -String objects, rather than the location of the first match. - -JDK-8314960: Added Certigna Root CA Certificate -=============================================== -The following root certificate has been added to the cacerts -truststore: - -Name: Certigna (Dhimyotis) -Alias Name: certignarootca -Distinguished Name: CN=Certigna Root CA, OU=0002 48146308100036, O=Dhimyotis, C=FR - -JDK-8312489: Increase Default Value of the System Property `jdk.jar.maxSignatureFileSize` -========================================================================================= -A maximum signature file size property, jdk.jar.maxSignatureFileSize, -was introduced in the 21.0.0 release of OpenJDK by JDK-8300596 to -control the maximum size of signature files in a signed JAR. The -default value of 8MB proved to be too small for some JAR files. This -release, 21.0.1, increases it to 16MB. - -New in release OpenJDK 21.0.0 (2023-09-XX): -=========================================== -Major changes are listed below. Some changes may have been backported -to earlier releases following their first appearance in OpenJDK 18 -through to 21. - -NEW FEATURES -============ - -Language Features -================= - -Pattern Matching for switch -=========================== -https://openjdk.org/jeps/406 -https://openjdk.org/jeps/420 -https://openjdk.org/jeps/427 -https://openjdk.org/jeps/433 -https://openjdk.org/jeps/441 - -Enhance the Java programming language with pattern matching for -`switch` expressions and statements, along with extensions to the -language of patterns. Extending pattern matching to `switch` allows an -expression to be tested against a number of patterns, each with a -specific action, so that complex data-oriented queries can be -expressed concisely and safely. - -This was a preview feature (http://openjdk.java.net/jeps/12) -introduced in OpenJDK 17 (JEP 406), which saw a second preview in -OpenJDK 18 (JEP 420), a third in OpenJDK 19 (JEP 427) and a fourth -(JEP 427) in OpenJDK 20. It became final with OpenJDK 21 (JEP 441). - -Record Patterns -=============== -https://openjdk.org/jeps/405 -https://openjdk.org/jeps/432 -https://openjdk.org/jeps/440 - -Enhance the Java programming language with record patterns to -deconstruct record values. Record patterns and type patterns can be -nested to enable a powerful, declarative, and composable form of data -navigation and processing. - -This was a preview feature (http://openjdk.java.net/jeps/12) introduced -in OpenJDK 19 (JEP 405) with a second preview (JEP 432) in OpenJDK 20. -It became final with OpenJDK 21 (JEP 440). - -String Templates -================ -https://openjdk.org/jeps/430 - -Enhance the Java programming language with string templates. String -templates complement Java's existing string literals and text blocks -by coupling literal text with embedded expressions and template -processors to produce specialized results. - -This is a preview feature (http://openjdk.java.net/jeps/12) introduced -in OpenJDK 21 (JEP 430). - -Unnamed Patterns and Variables -============================== -https://openjdk.org/jeps/443 - -Enhance the Java language with unnamed patterns, which match a record -component without stating the component's name or type, and unnamed -variables, which can be initialized but not used. Both are denoted by -an underscore character, _. - -This is a preview feature (http://openjdk.java.net/jeps/12) introduced -in OpenJDK 21 (JEP 443). - -Unnamed Classes and Instance Main Methods (Preview) -=================================================== -https://openjdk.org/jeps/445 - -Evolve the Java language so that students can write their first -programs without needing to understand language features designed for -large programs. Far from using a separate dialect of Java, students -can write streamlined declarations for single-class programs and then -seamlessly expand their programs to use more advanced features as -their skills grow. - -This is a preview feature (http://openjdk.java.net/jeps/12) introduced -in OpenJDK 21 (JEP 445). - -Library Features -================ - -UTF-8 by Default -================ -https://openjdk.org/jeps/400 - -Specify UTF-8 as the default charset of the standard Java APIs. With -this change, APIs that depend upon the default charset will behave -consistently across all implementations, operating systems, locales, -and configurations. - -Reimplement Core Reflection with Method Handles -=============================================== -https://openjdk.org/jeps/416 - -Reimplement java.lang.reflect.Method, Constructor, and Field on top of -java.lang.invoke method handles. Making method handles the underlying -mechanism for reflection will reduce the maintenance and development -cost of both the java.lang.reflect and java.lang.invoke APIs. - -Vector API -========== -https://openjdk.org/jeps/338 -https://openjdk.org/jeps/414 -https://openjdk.org/jeps/417 -https://openjdk.org/jeps/426 -https://openjdk.org/jeps/438 -https://openjdk.org/jeps/448 - -Introduce an API to express vector computations that reliably compile -at runtime to optimal vector hardware instructions on supported CPU -architectures and thus achieve superior performance to equivalent -scalar computations. - -This is an incubation feature (https://openjdk.java.net/jeps/11) -introduced in OpenJDK 16 (JEP 338). A second round of incubation took -place in OpenJDK 17 (JEP 414), OpenJDK 18 (JEP 417) saw a third, -OpenJDK 19 a fourth (JEP 426), OpenJDK 20 (JEP 438) a fifth and -OpenJDK 21 a sixth (JEP 448). - -Internet-Address Resolution SPI -=============================== -https://openjdk.org/jeps/418 - -Define a service-provider interface (SPI) for host name and address -resolution, so that java.net.InetAddress can make use of resolvers -other than the platform's built-in resolver. - -Foreign Function & Memory API -============================= -https://openjdk.org/jeps/412 -https://openjdk.org/jeps/419 -https://openjdk.org/jeps/424 -https://openjdk.org/jeps/434 -https://openjdk.org/jeps/442 - -Introduce an API by which Java programs can interoperate with code and -data outside of the Java runtime. By efficiently invoking foreign -functions (i.e., code outside the JVM), and by safely accessing -foreign memory (i.e., memory not managed by the JVM), the API enables -Java programs to call native libraries and process native data without -the brittleness and danger of JNI. - -This API is now a preview feature (http://openjdk.java.net/jeps/12). -It was first introduced in incubation -(https://openjdk.java.net/jeps/11) in OpenJDK 17 (JEP 412), and is an -evolution of the Foreign Memory Access API (OpenJDK 14 through 16) and -Foreign Linker API (OpenJDK 16) (see release notes for -java-17-openjdk). OpenJDK 18 saw a second round of incubation (JEP -419) before its inclusion as a preview in OpenJDK 19 (JEP 424) and a -second in OpenJDK 20 (JEP 434). It reaches a third preview in OpenJDK -21 (JEP 442). - -Virtual Threads -=============== -https://openjdk.org/jeps/425 -https://openjdk.org/jeps/436 -https://openjdk.org/jeps/444 - -Introduce virtual threads to the Java Platform. Virtual threads are -lightweight threads that dramatically reduce the effort of writing, -maintaining, and observing high-throughput concurrent applications. - -This was a preview feature (http://openjdk.java.net/jeps/12) -introduced in OpenJDK 19 (JEP 425) and reaching its second preview in -OpenJDK 20 (JEP 436). It became final with OpenJDK 21 (JEP 444). - -Structured Concurrency -====================== -https://openjdk.org/jeps/428 -https://openjdk.org/jeps/437 -https://openjdk.org/jeps/453 - -Simplify multithreaded programming by introducing an API for -structured concurrency. Structured concurrency treats multiple tasks -running in different threads as a single unit of work, thereby -streamlining error handling and cancellation, improving reliability, -and enhancing observability. - -This API is now a preview feature (http://openjdk.java.net/jeps/12) in -OpenJDK 21 (JEP 453). It was first introduced in incubation -(https://openjdk.java.net/jeps/11) in OpenJDK 19 (JEP 428) and had a -second round of incubation in OpenJDK 20 (JEP 437). - -Scoped Values -============= -https://openjdk.org/jeps/429 - -Introduce scoped values, which enable the sharing of immutable data -within and across threads. They are preferred to thread-local -variables, especially when using large numbers of virtual threads. - -This API is now a preview feature (http://openjdk.java.net/jeps/12) -in OpenJDK 21 (JEP 429). It was first introduced in incubation -(https://openjdk.java.net/jeps/11) in OpenJDK 20 (JEP 429). - -Sequenced Collections -===================== -https://openjdk.org/jeps/431 - -Introduce new interfaces to represent collections with a defined -encounter order. Each such collection has a well-defined first -element, second element, and so forth, up to the last element. It also -provides uniform APIs for accessing its first and last elements, and -for processing its elements in reverse order. - -Key Encapsulation Mechanism API -=============================== -https://openjdk.org/jeps/452 - -Introduce an API for key encapsulation mechanisms (KEMs), an -encryption technique for securing symmetric keys using public key -cryptography. - -Virtual Machine Enhancements -============================ - -Generational ZGC -================ -https://openjdk.org/jeps/439 - -Improve application performance by extending the Z Garbage Collector -(ZGC) to maintain separate generations for young and old objects. This -will allow ZGC to collect young objects — which tend to die young — -more frequently. - -Tools -===== - -Simple Web Server -================= -https://openjdk.org/jeps/408 - -Provide a command-line tool, `jwebserver`, to start a minimal web -server that serves static files only. No CGI or servlet-like -functionality is available. This tool will be useful for prototyping, -ad-hoc coding, and testing purposes, particularly in educational -contexts. - -Code Snippets in Java API Documentation -======================================= -https://openjdk.org/jeps/413 - -Introduce an @snippet tag for JavaDoc's Standard Doclet, to simplify -the inclusion of example source code in API documentation. - -Ports -===== - -Linux/RISC-V Port -================= -https://openjdk.org/jeps/422 - -RISC-V is a free and open-source RISC instruction set architecture -(ISA) designed originally at the University of California, Berkeley, -and now developed collaboratively under the sponsorship of RISC-V -International. It is already supported by a wide range of language -toolchains. With the increasing availability of RISC-V hardware, a -port of the JDK would be valuable. - -DEPRECATIONS -============ - -Deprecate Finalization for Removal -================================== -https://openjdk.org/jeps/421 - -Deprecate finalization for removal in a future release. Finalization -remains enabled by default for now, but can be disabled to facilitate -early testing. In a future release it will be disabled by default, and -in a later release it will be removed. Maintainers of libraries and -applications that rely upon finalization should consider migrating to -other resource management techniques such as the try-with-resources -statement and cleaners. - -Deprecate the Windows 32-bit x86 Port for Removal -================================================= -https://openjdk.org/jeps/449 - -Deprecate the Windows 32-bit x86 port, with the intent to remove it in -a future release. - -Prepare to Disallow the Dynamic Loading of Agents -================================================= -https://openjdk.org/jeps/451 - -Issue warnings when agents are loaded dynamically into a running -JVM. These warnings aim to prepare users for a future release which -disallows the dynamic loading of agents by default in order to improve -integrity by default. Serviceability tools that load agents at startup -will not cause warnings to be issued in any release. + - JDK-8314164: java/net/HttpURLConnection/HttpURLConnectionExpectContinueTest.java fails intermittently in timeout + - JDK-8314275: Incorrect stepping in switch + - JDK-8315708: Enhance HTTP/2 client usage + - JDK-8317299: safepoint scalarization doesn't keep track of the depth of the JVM state + - JDK-8317804: com/sun/jdi/JdwpAllowTest.java fails on Alpine 3.17 / 3.18 + - JDK-8318158: RISC-V: implement roundD/roundF intrinsics + - JDK-8318340: Improve RSA key implementations + - JDK-8318603: Parallelize sun/java2d/marlin/ClipShapeTest.java + - JDK-8318696: Do not use LFS64 symbols on Linux + - JDK-8319382: com/sun/jdi/JdwpAllowTest.java shows failures on AIX if prefixLen of mask is larger than 32 in IPv6 case + - JDK-8319851: Improve exception logging + - JDK-8320890: [AIX] Find a better way to mimic dl handle equality + - JDK-8321151: JDK-8294427 breaks Windows L&F on all older Windows versions + - JDK-8321374: Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll + - JDK-8321408: Add Certainly roots R1 and E1 + - JDK-8321480: ISO 4217 Amendment 176 Update + - JDK-8321489: Update LCMS to 2.16 + - JDK-8321815: Shenandoah: gc state should be synchronized to java threads only once per safepoint + - JDK-8321972: test runtime/Unsafe/InternalErrorTest.java timeout on linux-riscv64 platform + - JDK-8322092: Bump version numbers for 22.0.1 + - JDK-8322098: os::Linux::print_system_memory_info enhance the THP output with /sys/kernel/mm/transparent_hugepage/hpage_pmd_size + - JDK-8322122: Enhance generation of addresses + - JDK-8322159: ThisEscapeAnalyzer crashes for erroneous code + - JDK-8322163: runtime/Unsafe/InternalErrorTest.java fails on Alpine after JDK-8320886 + - JDK-8322417: Console read line with zero out should zero out when throwing exception + - JDK-8322725: (tz) Update Timezone Data to 2023d + - JDK-8322772: Clean up code after JDK-8322417 + - JDK-8322783: prioritize /etc/os-release over /etc/SuSE-release in hs_err/info output + - JDK-8322790: RISC-V: Tune costs for shuffles with no conversion + - JDK-8322945: Problemlist runtime/CompressedOops/CompressedClassPointers.java on AIX + - JDK-8323021: Shenandoah: Encountered reference count always attributed to first worker thread + - JDK-8323065: Unneccesary CodeBlob lookup in CompiledIC::internal_set_ic_destination + - JDK-8323086: Shenandoah: Heap could be corrupted by oom during evacuation + - JDK-8323154: C2: assert(cmp != nullptr && cmp->Opcode() == Op_Cmp(bt)) failed: no exit test + - JDK-8323170: j2dbench is using outdated javac source/target to be able to build by itself + - JDK-8323210: Update the usage of cmsFLAGS_COPY_ALPHA + - JDK-8323331: fix typo hpage_pdm_size + - JDK-8323428: Shenandoah: Unused memory in regions compacted during a full GC should be mangled + - JDK-8323515: Create test alias "all" for all test roots + - JDK-8323637: Capture hotspot replay files in GHA + - JDK-8323657: Compilation of snippet results in VerifyError at runtime with --release 9 (and above) + - JDK-8323664: java/awt/font/JNICheck/FreeTypeScalerJNICheck.java still fails with JNI warning on some Windows configurations + - JDK-8323675: Race in jdk.javadoc-gendata + - JDK-8323920: Change milestone to fcs for all releases + - JDK-8323964: runtime/Thread/ThreadCountLimit.java fails intermittently on AIX + - JDK-8324041: ModuleOption.java failed with update release versioning scheme + - JDK-8324050: Issue store-store barrier after re-materializing objects during deoptimization + - JDK-8324280: RISC-V: Incorrect implementation in VM_Version::parse_satp_mode + - JDK-8324347: Enable "maybe-uninitialized" warning for FreeType 2.13.1 + - JDK-8324598: use mem_unit when working with sysinfo memory and swap related information + - JDK-8324637: [aix] Implement support for reporting swap space in jdk.management + - JDK-8324647: Invalid test group of lib-test after JDK-8323515 + - JDK-8324659: GHA: Generic jtreg errors are not reported + - JDK-8324753: [AIX] adjust os_posix after JDK-8318696 + - JDK-8324937: GHA: Avoid multiple test suites per job + - JDK-8325074: ZGC fails assert(index == 0 || is_power_of_2(index)) failed: Incorrect load shift: 11 + - JDK-8325150: (tz) Update Timezone Data to 2024a + - JDK-8325203: System.exit(0) kills the launched 3rd party application + - JDK-8325213: Flags introduced by configure script are not passed to ADLC build + - JDK-8325313: Header format error in TestIntrinsicBailOut after JDK-8317299 + - JDK-8325326: [PPC64] Don't relocate in case of allocation failure + - JDK-8325470: [AIX] use fclose after fopen in read_psinfo + - JDK-8325496: Make TrimNativeHeapInterval a product switch + - JDK-8325590: Regression in round-tripping UTF-16 strings after JDK-8311906 + - JDK-8325672: C2: allocate PhaseIdealLoop::_loop_or_ctrl from C->comp_arena() + - JDK-8325876: crashes in docker container tests on Linuxppc64le Power8 machines + - JDK-8326000: Remove obsolete comments for class sun.security.ssl.SunJSSE + - JDK-8326101: [PPC64] Need to bailout cleanly if creation of stubs fails when code cache is out of space + - JDK-8326360: Update the Zlib version in open/src/java.base/share/legal/zlib.md to 1.3 + - JDK-8326638: Crash in PhaseIdealLoop::remix_address_expressions due to unexpected Region instead of Loop + - JDK-8327391: Add SipHash attribution file diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index 2913af4..b811818 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -36,7 +36,7 @@ # # PROJECT_NAME=openjdk # REPO_NAME=jdk22u -# VERSION=jdk-22+36 +# VERSION=jdk-22.0.1+8 # # or to e.g., prepare systemtap, icedtea7's jstack and other tapsets: # diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 34a0bda..eb543f5 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -337,7 +337,7 @@ # New Version-String scheme-style defines %global featurever 22 %global interimver 0 -%global updatever 0 +%global updatever 1 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, @@ -401,8 +401,8 @@ %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 36 -%global rpmrelease 3 +%global buildver 8 +%global rpmrelease 1 #%%global tagsuffix %%{nil} # 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 @@ -421,7 +421,7 @@ # Release will be (where N is usually a number starting at 1): # - 0.N%%{?extraver}%%{?dist} for EA releases, # - N%%{?extraver}{?dist} for GA releases -%global is_ga 0 +%global is_ga 1 %if %{is_ga} %global build_type GA %global ea_designator "" @@ -1784,6 +1784,9 @@ done %endif %changelog +* Tue Apr 30 2024 Jiri Vanek - 1:22.0.1.8-1.rolling +- April CPU + * Wed Feb 21 2024 Songsong Zhang - 1:22.0.0.0.36-3.rolling - Add riscv64 support diff --git a/sources b/sources index 1f686d2..7888a92 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-jdk-22+36-ea.tar.xz) = ecc6e6b6fd10eb6c16d9eba03fe4dbf5f5b5406b166e0e24d9d4b8e339d148da4a7b551e5669f7c9327821837988696990886e55f1045ea20b54bb1ac6ef0fc6 +SHA512 (openjdk-jdk-22.0.1+8.tar.xz) = 80107b40720a551db70c6719131234cfc2d7b257c0e147897c66fb1c6331e0294e98e0ce3646ddacc9d8c860e1cb55970eaec2f76763f9fd0a9aa15859e066b1 From 9d54a548115774711b1197bd417f497e072036fe Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 10:51:39 +0000 Subject: [PATCH 40/86] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- java-latest-openjdk-portable.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index eb543f5..8eefb5d 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -569,7 +569,7 @@ Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as # java-X-openjdk. See: https://bugzilla.redhat.com/show_bug.cgi?id=1647298 -Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist} +Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist}.1 # 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 # also included the epoch in their virtual provides. This created a @@ -1784,6 +1784,9 @@ done %endif %changelog +* Thu Jul 18 2024 Fedora Release Engineering - 1:22.0.1.0.8-1.rolling.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Tue Apr 30 2024 Jiri Vanek - 1:22.0.1.8-1.rolling - April CPU From 886f9e259aab386b2678e21e857496707ccdcf48 Mon Sep 17 00:00:00 2001 From: Jiri Date: Sat, 20 Jul 2024 16:53:14 +0200 Subject: [PATCH 41/86] Revert "Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild" This reverts commit 9d54a548115774711b1197bd417f497e072036fe. --- java-latest-openjdk-portable.spec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 8eefb5d..eb543f5 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -569,7 +569,7 @@ Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as # java-X-openjdk. See: https://bugzilla.redhat.com/show_bug.cgi?id=1647298 -Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist}.1 +Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist} # 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 # also included the epoch in their virtual provides. This created a @@ -1784,9 +1784,6 @@ done %endif %changelog -* Thu Jul 18 2024 Fedora Release Engineering - 1:22.0.1.0.8-1.rolling.1 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - * Tue Apr 30 2024 Jiri Vanek - 1:22.0.1.8-1.rolling - April CPU From c8b2b4b72b82db3ce3817102d29c672c4d1a4895 Mon Sep 17 00:00:00 2001 From: Jiri Date: Sat, 20 Jul 2024 17:01:48 +0200 Subject: [PATCH 42/86] July CPU --- .gitignore | 1 + generate_source_tarball.sh | 2 +- java-latest-openjdk-portable.spec | 8 ++++++-- sources | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 0b3e031..d103240 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ /openjdk-22+32-ea.tar.xz /openjdk-jdk-22+36-ea.tar.xz /openjdk-jdk-22.0.1+8.tar.xz +/openjdk-jdk-22.0.2+9.tar.xz diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index b811818..850f4e6 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -36,7 +36,7 @@ # # PROJECT_NAME=openjdk # REPO_NAME=jdk22u -# VERSION=jdk-22.0.1+8 +# VERSION=jdk-22.0.2+9 # # or to e.g., prepare systemtap, icedtea7's jstack and other tapsets: # diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index eb543f5..98ef584 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -337,7 +337,7 @@ # New Version-String scheme-style defines %global featurever 22 %global interimver 0 -%global updatever 1 +%global updatever 2 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, @@ -401,7 +401,7 @@ %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 8 +%global buildver 9 %global rpmrelease 1 #%%global tagsuffix %%{nil} # 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 @@ -1784,6 +1784,10 @@ done %endif %changelog +* Sat Jul 20 2024 Jiri Vanek - 1:22.0.2.9-1.rolling +- July CPU +- todo, NEWS + * Tue Apr 30 2024 Jiri Vanek - 1:22.0.1.8-1.rolling - April CPU diff --git a/sources b/sources index 7888a92..ab99f52 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-jdk-22.0.1+8.tar.xz) = 80107b40720a551db70c6719131234cfc2d7b257c0e147897c66fb1c6331e0294e98e0ce3646ddacc9d8c860e1cb55970eaec2f76763f9fd0a9aa15859e066b1 +SHA512 (openjdk-jdk-22.0.2+9.tar.xz) = 960746381f56cb516a2298f75dbf877554b59e73752dc29b040b8629b153174d2ea2f612d3479b511aaac293e4d336c798a58fd1ba4d2b9d5933899f64d04313 From c6f995895733e3a0f58d368f16596c9fa7ee317f Mon Sep 17 00:00:00 2001 From: Jiri Date: Sat, 20 Jul 2024 17:07:58 +0200 Subject: [PATCH 43/86] Updated news --- NEWS | 231 +++++++++++++++++++++--------- java-latest-openjdk-portable.spec | 6 +- 2 files changed, 165 insertions(+), 72 deletions(-) diff --git a/NEWS b/NEWS index 8ceb10c..9952b88 100644 --- a/NEWS +++ b/NEWS @@ -3,77 +3,170 @@ Key: JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY -New in release OpenJDK 22.0.1 (2024-04-16): +New in release OpenJDK 22.0.1 (2024-07-17): =========================================== - - - JDK-8314164: java/net/HttpURLConnection/HttpURLConnectionExpectContinueTest.java fails intermittently in timeout - - JDK-8314275: Incorrect stepping in switch + - JDK-8185862: AWT Assertion Failure in ::GetDIBits(hBMDC, hBM, 0, 1, 0, gpBitmapInfo, 0) 'awt_Win32GraphicsDevice.cpp', at line 185 + - JDK-8187759: Background not refreshed when painting over a transparent JFrame + - JDK-8238169: BasicDirectoryModel getDirectories and DoChangeContents.run can deadlock + - JDK-8261433: Better pkcs11 performance for libpkcs11:C_EncryptInit/libpkcs11:C_DecryptInit + - JDK-8295111: dpkg appears to have problems resolving symbolically linked native libraries + - JDK-8305072: Win32ShellFolder2.compareTo is inconsistent + - JDK-8309218: java/util/concurrent/locks/Lock/OOMEInAQS.java still times out with ZGC, Generational ZGC, and SerialGC + - JDK-8310072: JComboBox/DisabledComboBoxFontTestAuto: Enabled and disabled ComboBox does not match in these LAFs: GTK+ + - JDK-8310513: [s390x] Intrinsify recursive ObjectMonitor locking + - JDK-8312383: Log X509ExtendedKeyManager implementation class name in TLS/SSL connection + - JDK-8314794: Improve UTF8 String supports - JDK-8315708: Enhance HTTP/2 client usage - - JDK-8317299: safepoint scalarization doesn't keep track of the depth of the JVM state - - JDK-8317804: com/sun/jdi/JdwpAllowTest.java fails on Alpine 3.17 / 3.18 - - JDK-8318158: RISC-V: implement roundD/roundF intrinsics - - JDK-8318340: Improve RSA key implementations - - JDK-8318603: Parallelize sun/java2d/marlin/ClipShapeTest.java - - JDK-8318696: Do not use LFS64 symbols on Linux - - JDK-8319382: com/sun/jdi/JdwpAllowTest.java shows failures on AIX if prefixLen of mask is larger than 32 in IPv6 case - - JDK-8319851: Improve exception logging - - JDK-8320890: [AIX] Find a better way to mimic dl handle equality - - JDK-8321151: JDK-8294427 breaks Windows L&F on all older Windows versions - - JDK-8321374: Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll - - JDK-8321408: Add Certainly roots R1 and E1 - - JDK-8321480: ISO 4217 Amendment 176 Update - - JDK-8321489: Update LCMS to 2.16 - - JDK-8321815: Shenandoah: gc state should be synchronized to java threads only once per safepoint - - JDK-8321972: test runtime/Unsafe/InternalErrorTest.java timeout on linux-riscv64 platform - - JDK-8322092: Bump version numbers for 22.0.1 - - JDK-8322098: os::Linux::print_system_memory_info enhance the THP output with /sys/kernel/mm/transparent_hugepage/hpage_pmd_size + - JDK-8316138: Add GlobalSign 2 TLS root certificates + - JDK-8316328: Test jdk/jfr/event/oldobject/TestSanityDefault.java times out for some heap sizes + - JDK-8319548: Unexpected internal name for Filler array klass causes error in VisualVM + - JDK-8319859: Better symbol storage + - JDK-8320005: Allow loading of shared objects with .a extension on AIX + - JDK-8320097: Improve Image transformations + - JDK-8320548: Improved loop handling + - JDK-8320692: Null icon returned for .exe without custom icon + - JDK-8320707: Virtual thread test updates + - JDK-8321075: RISC-V: UseSystemMemoryBarrier lacking proper OS support + - JDK-8322078: ZipSourceCache.testKeySourceMapping() test fails with The process cannot access the file because it is being used by another process - JDK-8322122: Enhance generation of addresses - - JDK-8322159: ThisEscapeAnalyzer crashes for erroneous code - - JDK-8322163: runtime/Unsafe/InternalErrorTest.java fails on Alpine after JDK-8320886 - - JDK-8322417: Console read line with zero out should zero out when throwing exception - - JDK-8322725: (tz) Update Timezone Data to 2023d - - JDK-8322772: Clean up code after JDK-8322417 - - JDK-8322783: prioritize /etc/os-release over /etc/SuSE-release in hs_err/info output - - JDK-8322790: RISC-V: Tune costs for shuffles with no conversion - - JDK-8322945: Problemlist runtime/CompressedOops/CompressedClassPointers.java on AIX - - JDK-8323021: Shenandoah: Encountered reference count always attributed to first worker thread - - JDK-8323065: Unneccesary CodeBlob lookup in CompiledIC::internal_set_ic_destination - - JDK-8323086: Shenandoah: Heap could be corrupted by oom during evacuation - - JDK-8323154: C2: assert(cmp != nullptr && cmp->Opcode() == Op_Cmp(bt)) failed: no exit test - - JDK-8323170: j2dbench is using outdated javac source/target to be able to build by itself - - JDK-8323210: Update the usage of cmsFLAGS_COPY_ALPHA - - JDK-8323331: fix typo hpage_pdm_size - - JDK-8323428: Shenandoah: Unused memory in regions compacted during a full GC should be mangled - - JDK-8323515: Create test alias "all" for all test roots - - JDK-8323637: Capture hotspot replay files in GHA - - JDK-8323657: Compilation of snippet results in VerifyError at runtime with --release 9 (and above) - - JDK-8323664: java/awt/font/JNICheck/FreeTypeScalerJNICheck.java still fails with JNI warning on some Windows configurations - - JDK-8323675: Race in jdk.javadoc-gendata - - JDK-8323920: Change milestone to fcs for all releases - - JDK-8323964: runtime/Thread/ThreadCountLimit.java fails intermittently on AIX - - JDK-8324041: ModuleOption.java failed with update release versioning scheme - - JDK-8324050: Issue store-store barrier after re-materializing objects during deoptimization - - JDK-8324280: RISC-V: Incorrect implementation in VM_Version::parse_satp_mode - - JDK-8324347: Enable "maybe-uninitialized" warning for FreeType 2.13.1 - - JDK-8324598: use mem_unit when working with sysinfo memory and swap related information - - JDK-8324637: [aix] Implement support for reporting swap space in jdk.management - - JDK-8324647: Invalid test group of lib-test after JDK-8323515 - - JDK-8324659: GHA: Generic jtreg errors are not reported - - JDK-8324753: [AIX] adjust os_posix after JDK-8318696 - - JDK-8324937: GHA: Avoid multiple test suites per job - - JDK-8325074: ZGC fails assert(index == 0 || is_power_of_2(index)) failed: Incorrect load shift: 11 - - JDK-8325150: (tz) Update Timezone Data to 2024a - - JDK-8325203: System.exit(0) kills the launched 3rd party application - - JDK-8325213: Flags introduced by configure script are not passed to ADLC build + - JDK-8322484: 22-b26 Regression in J2dBench-bimg_misc-G1 (and more) on Windows-x64 and macOS-x64 + - JDK-8322503: Shenandoah: Clarify gc state usage + - JDK-8322726: C2: Unloaded signature class kills argument value + - JDK-8322943: runtime/CompressedOops/CompressedClassPointers.java fails on AIX + - JDK-8322962: Upcall stub might go undetected when freezing frames + - JDK-8323231: Improve array management + - JDK-8323390: Enhance mask blit functionality + - JDK-8323519: Add applications/ctw/modules to Hotspot tiered testing + - JDK-8323552: AbstractMemorySegmentImpl#mismatch returns -1 when comparing distinct areas of the same instance of MemorySegment + - JDK-8323670: A few client tests intermittently throw ConcurrentModificationException + - JDK-8323685: PrintSystemDictionaryAtExit has mutex rank assert + - JDK-8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin + - JDK-8323801: tag doesn't strikethrough the text + - JDK-8323918: Update the release version after forking Apr CPU24_04 + - JDK-8323919: Update the Jul CPU24_07 release date in master branch after forking Apr CPU24_04 + - JDK-8323994: gtest runner repeats test name for every single gtest assertion + - JDK-8324121: SIGFPE in PhaseIdealLoop::extract_long_range_checks + - JDK-8324243: Compilation failures in java.desktop module with gcc 14 + - JDK-8324559: Improve 2D image handling + - JDK-8324632: Update Zlib Data Compression Library to Version 1.3.1 + - JDK-8324646: Avoid Class.forName in SecureRandom constructor + - JDK-8324648: Avoid NoSuchMethodError when instantiating NativePRNG + - JDK-8324733: [macos14] Problem list tests which fail due to macOS bug described in JDK-8322653 + - JDK-8324834: Use _LARGE_FILES on AIX + - JDK-8324874: AArch64: crypto pmull based CRC32/CRC32C intrinsics clobber V8-V15 registers + - JDK-8324933: ConcurrentHashTable::statistics_calculate synchronization is expensive + - JDK-8325028: (ch) Pipe channels should lazily set socket to non-blocking mode on first use by virtual thread + - JDK-8325095: C2: bailout message broken: ResourceArea allocated string used after free + - JDK-8325179: Race in BasicDirectoryModel.validateFileCache + - JDK-8325255: jdk.internal.util.ReferencedKeySet::add using wrong test - JDK-8325313: Header format error in TestIntrinsicBailOut after JDK-8317299 - - JDK-8325326: [PPC64] Don't relocate in case of allocation failure - - JDK-8325470: [AIX] use fclose after fopen in read_psinfo - - JDK-8325496: Make TrimNativeHeapInterval a product switch - - JDK-8325590: Regression in round-tripping UTF-16 strings after JDK-8311906 - - JDK-8325672: C2: allocate PhaseIdealLoop::_loop_or_ctrl from C->comp_arena() - - JDK-8325876: crashes in docker container tests on Linuxppc64le Power8 machines - - JDK-8326000: Remove obsolete comments for class sun.security.ssl.SunJSSE - - JDK-8326101: [PPC64] Need to bailout cleanly if creation of stubs fails when code cache is out of space - - JDK-8326360: Update the Zlib version in open/src/java.base/share/legal/zlib.md to 1.3 - - JDK-8326638: Crash in PhaseIdealLoop::remix_address_expressions due to unexpected Region instead of Loop + - JDK-8325432: enhance assert message "relocation addr must be in this section" + - JDK-8325567: jspawnhelper without args fails with segfault + - JDK-8325579: Inconsistent behavior in com.sun.jndi.ldap.Connection::createSocket + - JDK-8325587: Shenandoah: ShenandoahLock should allow blocking in VM + - JDK-8325600: Better symbol storage + - JDK-8325613: CTW: Stale method cleanup requires GC after Sweeper removal + - JDK-8325621: Improve jspawnhelper version checks + - JDK-8325730: StringBuilder.toString allocation for the empty String + - JDK-8325743: test/jdk/java/nio/channels/unixdomain/SocketOptions.java enhance user name output in error case + - JDK-8325763: Revert properties: vm.opt.x.* + - JDK-8325862: set -XX:+ErrorFileToStderr when executing java in containers for some container related jtreg tests + - JDK-8326006: Allow TEST_VM_FLAGLESS to set flagless mode + - JDK-8326106: Write and clear stack trace table outside of safepoint + - JDK-8326140: src/jdk.accessibility/windows/native/libjavaaccessbridge/AccessBridgeJavaEntryPoints.cpp ReleaseStringChars might be missing in early returns + - JDK-8326201: [S390] Need to bailout cleanly if creation of stubs fails when code cache is out of space + - JDK-8326351: Update the Zlib version in open/src/java.base/share/legal/zlib.md to 1.3.1 + - JDK-8326446: The User and System of jdk.CPULoad on Apple M1 are inaccurate + - JDK-8326496: [test] checkHsErrFileContent support printing hserr in error case + - JDK-8326521: JFR: CompilerPhase event test fails on windows 32 bit + - JDK-8326529: JFR: Test for CompilerCompile events fails due to time out + - JDK-8326643: JDK server does not send a dummy change_cipher_spec record after HelloRetryRequest message + - JDK-8326891: Prefer RPATH over RUNPATH for $ORIGIN rpaths in internal JDK binaries + - JDK-8326936: RISC-V: Shenandoah GC crashes due to incorrect atomic memory operations + - JDK-8326960: GHA: RISC-V sysroot cannot be debootstrapped due to ongoing Debian t64 transition + - JDK-8326974: ODR violation in macroAssembler_aarch64.cpp + - JDK-8327040: Problemlist ActionListenerCalledTwiceTest.java test failing in macos14 + - JDK-8327059: os::Linux::print_proc_sys_info add swappiness information + - JDK-8327137: Add test for ConcurrentModificationException in BasicDirectoryModel - JDK-8327391: Add SipHash attribution file + - JDK-8327413: Enhance compilation efficiency + - JDK-8327467: Bump version numbers for 22.0.2 + - JDK-8327468: Do not restart close if errno is EINTR [macOS/linux] + - JDK-8327501: Common ForkJoinPool prevents class unloading in some cases + - JDK-8327631: Update IANA Language Subtag Registry to Version 2024-03-07 + - JDK-8327990: [macosx-aarch64] Various tests fail with -XX:+AssertWXAtThreadSync + - JDK-8328066: WhiteBoxResizeTest failure on linux-x86: Could not reserve enough space for 2097152KB object heap + - JDK-8328075: Shenandoah: Avoid forwarding when objects don't move in full-GC + - JDK-8328165: improve assert(idx < _maxlrg) failed: oob + - JDK-8328166: Epsilon: 'EpsilonHeap::allocate_work' misuses the parameter 'size' as size in bytes + - JDK-8328168: Epsilon: Premature OOM when allocating object larger than uncommitted heap size + - JDK-8328316: Finisher cannot emit if stream is sequential and integrator returned false + - JDK-8328366: Thread.setContextClassloader from thread in FJP commonPool task no longer works after JDK-8327501 + - JDK-8328524: [x86] StringRepeat.java failure on linux-x86: Could not reserve enough space for 2097152KB object heap + - JDK-8328589: unify os::breakpoint among posix platforms + - JDK-8328604: remove on_aix() function + - JDK-8328638: Fallback option for POST-only OCSP requests + - JDK-8328702: C2: Crash during parsing because sub type check is not folded + - JDK-8328703: Illegal accesses in Java_jdk_internal_org_jline_terminal_impl_jna_linux_CLibraryImpl_ioctl0 + - JDK-8328705: GHA: Cross-compilation jobs do not require build JDK + - JDK-8328709: AIX os::get_summary_cpu_info support Power 10 + - JDK-8328744: Parallel: Parallel GC throws OOM before heap is fully expanded + - JDK-8328776: [AIX] remove checked_vmgetinfo, use vmgetinfo directly + - JDK-8328812: Update and move siphash license + - JDK-8328822: C2: "negative trip count?" assert failure in profile predicate code + - JDK-8328825: Google CAInterop test failures + - JDK-8328948: GHA: Restoring sysroot from cache skips the build after JDK-8326960 + - JDK-8328953: JEditorPane.read throws ChangedCharSetException + - JDK-8328988: [macos14] Problem list LightweightEventTest.java which fails due to macOS bug described in JDK-8322653 + - JDK-8328989: Incorrect milestone for release JDK 22.0.2 + - JDK-8328997: Remove unnecessary template parameter lists in GrowableArray + - JDK-8329013: StackOverflowError when starting Apache Tomcat with signed jar + - JDK-8329109: Threads::print_on() tries to print CPU time for terminated GC threads + - JDK-8329134: Reconsider TLAB zapping + - JDK-8329163: C2: possible overflow in PhaseIdealLoop::extract_long_range_checks() + - JDK-8329213: Better validation for com.sun.security.ocsp.useget option + - JDK-8329223: Parallel: Parallel GC resizes heap even if -Xms = -Xmx + - JDK-8329510: Update ProblemList for JFileChooser/8194044/FileSystemRootTest.java + - JDK-8329528: G1 does not update TAMS correctly when dropping retained regions during Concurrent Start pause + - JDK-8329545: [s390x] Fix garbage value being passed in Argument Register + - JDK-8329570: G1: Excessive is_obj_dead_cond calls in verification + - JDK-8329605: hs errfile generic events - move memory protections and nmethod flushes to separate sections + - JDK-8329656: assertion failed in MAP_ARCHIVE_MMAP_FAILURE path: Invalid immediate -5 0 + - JDK-8329663: hs_err file event log entry for thread adding/removing should print current thread + - JDK-8329823: RISC-V: Need to sync CPU features with related JVM flags + - JDK-8329840: Fix ZPhysicalMemorySegment::_end type + - JDK-8329850: [AIX] Allow loading of different members of same shared library archive + - JDK-8329862: libjli GetApplicationHome cleanups and enhance jli tracing + - JDK-8329958: Windows x86 build fails: downcallLinker.cpp(36) redefinition + - JDK-8329961: Buffer overflow in os::Linux::kernel_version + - JDK-8330011: [s390x] update block-comments to make code consistent + - JDK-8330027: Identity hashes of archived objects must be based on a reproducible random seed + - JDK-8330094: RISC-V: Save and restore FRM in the call stub + - JDK-8330156: RISC-V: Range check auipc + signed 12 imm instruction + - JDK-8330232: Change milestone to fcs for all releases + - JDK-8330242: RISC-V: Simplify and remove CORRECT_COMPILER_ATOMIC_SUPPORT in atomic_linux_riscv.hpp + - JDK-8330275: Crash in XMark::follow_array + - JDK-8330464: hserr generic events - add entry for the before_exit calls + - JDK-8330523: Reduce runtime and improve efficiency of KeepAliveTest + - JDK-8330524: Linux ppc64le compile warning with clang in os_linux_ppc.cpp + - JDK-8330576: ZYoungCompactionLimit should have range check + - JDK-8330615: avoid signed integer overflows in zip_util.c readCen / hashN + - JDK-8330748: ByteArrayOutputStream.writeTo(OutputStream) pins carrier + - JDK-8330814: Cleanups for KeepAliveCache tests + - JDK-8330815: Use pattern matching for instanceof in KeepAliveCache + - JDK-8331031: unify os::dont_yield and os::naked_yield across Posix platforms + - JDK-8331164: createJMHBundle.sh download jars fail when url needed to be redirected + - JDK-8331167: UBSan enabled build fails in adlc on macOS + - JDK-8331298: avoid alignment checks in UBSAN enabled build + - JDK-8331331: :tier1 target explanation in doc/testing.md is incorrect + - JDK-8331344: No compiler replay file with CompilerCommand MemLimit + - JDK-8331352: error: template-id not allowed for constructor/destructor in C++20 + - JDK-8331466: Problemlist serviceability/dcmd/gc/RunFinalizationTest.java on generic-all + - JDK-8331589: The DEFAULT_PROMOTED_VERSION_PRE not correct for RDP2 CPU24_07 + - JDK-8331714: Make OopMapCache installation lock-free + - JDK-8331746: Create a test to verify that the cmm id is not ignored + - JDK-8331885: C2: meet between unloaded and speculative types is not symmetric + - JDK-8331894: [jdk22] compiler/print/CompileCommandMemLimit.java fails after backporting JDK-8325095 + - JDK-8331942: On Linux aarch64, CDS archives should be using 64K alignment by default + - JDK-8332253: Linux arm32 build fails after 8292591 + - JDK-8332490: JMH org.openjdk.bench.java.util.zip.InflaterInputStreams.inflaterInputStreamRead OOM diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 98ef584..53b2407 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -402,7 +402,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 9 -%global rpmrelease 1 +%global rpmrelease 2 #%%global tagsuffix %%{nil} # 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 @@ -1784,9 +1784,9 @@ done %endif %changelog -* Sat Jul 20 2024 Jiri Vanek - 1:22.0.2.9-1.rolling +* Sat Jul 20 2024 Jiri Vanek - 1:22.0.2.9-2.rolling - July CPU -- todo, NEWS +- updated NEWS * Tue Apr 30 2024 Jiri Vanek - 1:22.0.1.8-1.rolling - April CPU From 87d4598cb051fb4999e2a23e642d672e794acc71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Mon, 2 Sep 2024 09:00:37 +0200 Subject: [PATCH 44/86] convert license to SPDX This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- java-latest-openjdk-portable.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 53b2407..6011894 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -569,7 +569,7 @@ Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as # java-X-openjdk. See: https://bugzilla.redhat.com/show_bug.cgi?id=1647298 -Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist} +Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist}.1 # 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 # also included the epoch in their virtual provides. This created a @@ -601,7 +601,8 @@ Group: Development/Languages # The test code includes copies of NSS under the Mozilla Public License v2.0 # The PCSClite headers are under a BSD with advertising license # The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version -License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA +# Automatically converted from old format: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA - review is highly recommended. +License: Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA URL: http://openjdk.java.net/ # The source tarball, generated using generate_source_tarball.sh @@ -1784,6 +1785,9 @@ done %endif %changelog +* Mon Sep 02 2024 Miroslav Suchý - 1:22.0.2.0.9-2.rolling.1 +- convert license to SPDX + * Sat Jul 20 2024 Jiri Vanek - 1:22.0.2.9-2.rolling - July CPU - updated NEWS From bf3bbaef3b9903b62cc0664c56387311b36861b0 Mon Sep 17 00:00:00 2001 From: Jiri Date: Tue, 24 Sep 2024 18:49:28 +0200 Subject: [PATCH 45/86] updated to jdk23 udpated NEWS (for JEPS) and README.md for 23 links --- .gitignore | 1 + NEWS | 16 ++++++++++++++++ README.md | 4 ++-- generate_source_tarball.sh | 4 ++-- java-latest-openjdk-portable.spec | 12 ++++++++---- sources | 2 +- 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index d103240..16b8360 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ /openjdk-jdk-22+36-ea.tar.xz /openjdk-jdk-22.0.1+8.tar.xz /openjdk-jdk-22.0.2+9.tar.xz +/openjdk-jdk-23+37.tar.xz diff --git a/NEWS b/NEWS index 9952b88..6d25da7 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,22 @@ Key: JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY +JEP-XYZ: https://openjdk.org/jeps/XYZ + +New in release OpenJDK 23.0.0+37 (2024-09-17): +=========================================== + - JEP-455: Primitive Types in Patterns, instanceof, and switch (Preview) + - JEP-466: Class-File API (Second Preview) + - JEP-467: Markdown Documentation Comments + - JEP-469: Vector API (Eighth Incubator) + - JEP-473: Stream Gatherers (Second Preview) + - JEP-471: Deprecate the Memory-Access Methods in sun.misc.Unsafe for Removal + - JEP-474: ZGC: Generational Mode by Default + - JEP-476: Module Import Declarations (Preview) + - JEP-477: Implicitly Declared Classes and Instance Main Methods (Third Preview) + - JEP-480: Structured Concurrency (Third Preview) + - JEP-481: Scoped Values (Third Preview) + - JEP-482: Flexible Constructor Bodies (Second Preview) New in release OpenJDK 22.0.1 (2024-07-17): =========================================== diff --git a/README.md b/README.md index f2718eb..34d9d78 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ This package contains the latest rolling release of OpenJDK. OpenJDK has a release cadence of six months, with a new release in March and September each year. -The current release is OpenJDK 22. For a list of major changes from +The current release is OpenJDK 23. For a list of major changes from OpenJDK 21, see the NEWS file included in this package and the upstream release page: -https://openjdk.java.net/projects/jdk/22/ +https://openjdk.org/projects/jdk/23/ This package is intended for those who want to follow the latest OpenJDK releases. Long term support versions of OpenJDK are available diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index 850f4e6..5eb89f6 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -35,8 +35,8 @@ # VERSION, e.g.: # # PROJECT_NAME=openjdk -# REPO_NAME=jdk22u -# VERSION=jdk-22.0.2+9 +# REPO_NAME=jdk23u +# VERSION=jdk-23+37 # # or to e.g., prepare systemtap, icedtea7's jstack and other tapsets: # diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 6011894..c6e5736 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -335,9 +335,9 @@ %endif # New Version-String scheme-style defines -%global featurever 22 +%global featurever 23 %global interimver 0 -%global updatever 2 +%global updatever 0 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, @@ -401,8 +401,8 @@ %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 9 -%global rpmrelease 2 +%global buildver 37 +%global rpmrelease 1 #%%global tagsuffix %%{nil} # 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 @@ -1785,6 +1785,10 @@ done %endif %changelog +* Tue Sep 24 2024 Jiri Vanek - 1:23.0.0.37-1.rolling +- updated to jdk23 +- udpated NEWS (for JEPS) and README.md for 23 links + * Mon Sep 02 2024 Miroslav Suchý - 1:22.0.2.0.9-2.rolling.1 - convert license to SPDX diff --git a/sources b/sources index ab99f52..49e3788 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-jdk-22.0.2+9.tar.xz) = 960746381f56cb516a2298f75dbf877554b59e73752dc29b040b8629b153174d2ea2f612d3479b511aaac293e4d336c798a58fd1ba4d2b9d5933899f64d04313 +SHA512 (openjdk-jdk-23+37.tar.xz) = b76de2d7a7d5b400d29af5233e91f629c55d38dd987bb0fe4d8d3ac7c41f70112e302e74cc85183883202be6a8ede55133f7d2b4fbf4b6537f31d95b0a38670b From 25a204173d7045b7e02a40dbdf73718eab23b709 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Wed, 25 Sep 2024 09:35:09 +0200 Subject: [PATCH 46/86] Fixed release --- java-latest-openjdk-portable.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index c6e5736..2d93685 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -402,7 +402,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 37 -%global rpmrelease 1 +%global rpmrelease 2 #%%global tagsuffix %%{nil} # 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 @@ -569,7 +569,7 @@ Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as # java-X-openjdk. See: https://bugzilla.redhat.com/show_bug.cgi?id=1647298 -Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist}.1 +Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist} # 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 # also included the epoch in their virtual provides. This created a From 484457e91e8af2bca1dd6fa9bf2c24a19a78bfe4 Mon Sep 17 00:00:00 2001 From: Jiri Date: Sun, 20 Oct 2024 14:55:24 +0200 Subject: [PATCH 47/86] Bumped to build by itself (23) --- java-latest-openjdk-portable.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 2d93685..d545b0b 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -342,7 +342,7 @@ # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, # and this it is better to change it here, on single place -%global buildjdkver 22 +%global buildjdkver 23 # We don't add any LTS designator for STS packages (Fedora and EPEL). # We need to explicitly exclude EPEL as it would have the %%{rhel} macro defined. %if 0%{?rhel} && !0%{?epel} From d5bdb1494083db5bff448230a6a6396fd19fdbf6 Mon Sep 17 00:00:00 2001 From: Jiri Date: Sun, 20 Oct 2024 14:56:51 +0200 Subject: [PATCH 48/86] Moved to autorelease and autochagelog --- java-latest-openjdk-portable.spec | 227 +----------------------------- 1 file changed, 2 insertions(+), 225 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index d545b0b..e55fc43 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -402,7 +402,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 37 -%global rpmrelease 2 +%global rpmrelease %(echo "%autorelease" | sed 's;%{?dist};;') #%%global tagsuffix %%{nil} # 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 @@ -1785,227 +1785,4 @@ done %endif %changelog -* Tue Sep 24 2024 Jiri Vanek - 1:23.0.0.37-1.rolling -- updated to jdk23 -- udpated NEWS (for JEPS) and README.md for 23 links - -* Mon Sep 02 2024 Miroslav Suchý - 1:22.0.2.0.9-2.rolling.1 -- convert license to SPDX - -* Sat Jul 20 2024 Jiri Vanek - 1:22.0.2.9-2.rolling -- July CPU -- updated NEWS - -* Tue Apr 30 2024 Jiri Vanek - 1:22.0.1.8-1.rolling -- April CPU - -* Wed Feb 21 2024 Songsong Zhang - 1:22.0.0.0.36-3.rolling -- Add riscv64 support - -* Fri Feb 16 2024 Jiri Vanek - 1:22.0.0.0.36-2.rolling -- bumped build jdk to 22 - -* Fri Feb 16 2024 Jiri Vanek - 1:22.0.0.0.36-1.rolling -- updated to 22+36 -- tmp comment out of ea exit 17 -- fixed condition for taspets - -* Wed Jan 24 2024 Jiri Vanek - 1:22.0.0.0.32-2.rolling -- Move to -P usage for patch macro which works on all RPM versions -- generate_source_tarball.sh: Add note on network usage of OPENJDK_LATEST -- generate_source_tarball.sh: Remove unneeded FIXME -- generate_source_tarball.sh: Add --sort=name to tar invocation for reproducibility -- generate_source_tarball.sh: Add WITH_TEMP environment variable -- generate_source_tarball.sh: Multithread xz on all available cores -- generate_source_tarball.sh: Add OPENJDK_LATEST environment variable -- generate_source_tarball.sh: Update comment about tarball naming -- generate_source_tarball.sh: Remove REPO_NAME from FILE_NAME_ROOT -- generate_source_tarball.sh: Set compile-command in Emacs -- generate_source_tarball.sh: Reformat comment header -- generate_source_tarball.sh: Reformat and update help output -- generate_source_tarball.sh: Move PROJECT_NAME and REPO_NAME checks -- generate_source_tarball.sh: Do a shallow clone, for speed -- generate_source_tarball.sh: Append -ea designator when required -- generate_source_tarball.sh: Eliminate some removal prompting -- generate_source_tarball.sh: Make tarball reproducible -- generate_source_tarball.sh: Prefix temporary directory with temp- -- generate_source_tarball.sh: shellcheck: Remove x-prefixes since we use Bash -- generate_source_tarball.sh: shellcheck: Double-quote variable references -- generate_source_tarball.sh: shellcheck: Do not use -a -- generate_source_tarball.sh: shellcheck: Do not use $ in expression -- generate_source_tarball.sh: Remove temporary directory exit conditions - -* Mon Jan 22 2024 Jiri Vanek - 1:22.0.0.0.32-1.rolling -- bumped to jdk22 (jdk-22+32) -- manually renamed generated sources openjdk-jdk22u-jdk-22+32.tar.xz -> openjdk-22+32-ea.tar.xz -- disabled patch 10001 fips patch for a short timebeing --- removed --disable-sysconf-nss v acordingly -- removed patch6 jdk8009550-rh910107-fail_to_load_pcsc_library.patch; upstreamed -- removed incorrect versioned java-devel requirements -- disabled locales tests, as they currenlty (correctly fails) - -* Tue Jan 09 2024 Andrew Hughes - 1:21.0.2.0.13-1 -- Update to jdk-21.0.2+13 (GA) -- Update release notes to 21.0.2+13 -- Drop no longer needed local patch to fix versioning -- ** This tarball is embargoed until 2024-01-16 @ 1pm PT. ** - -* Wed Dec 13 2023 Jiri Vanek - 1:21.0.1.0.12-3.rolling -- packing generated sources - -* Wed Nov 22 2023 Jiri Vanek - 1:21.0.1.0.12-2.rolling -- updated to OpenJDK 21.0.1 (2023-10-17) -- adjsuted generate_source_tarball -- removed icedtea_sync -- dropped standalone licenses -- added usntripped subpkg -- added docs subpkg -- adjsuted versions of bundled libraries -- build refactored to several solid methods following gnu_andrew -- removed no longer needed jdk8296108-tzdata2022f.patch, jdk8296715-cldr2022f.patch, rh1648644-java_access_bridge_privileged_security.patch -- added jdk8311630-s390_ffmapi.patch to support virtual threads on s390x -- aligned fips-21u-75ffdc48eda.patch (gnu_andrew) -- fixed '--without release' build-ability by moving docs and misc to if-release only - -* Wed Sep 20 2023 Jiri Vanek - 1:21.0.0.0.35-4.rolling -- removed %{1} from miscportablename - -* Fri Sep 15 2023 Andrew Hughes - 1:21.0.0.0.35-3.rolling -- Update documentation (README.md, add missing JEP to release notes) -- Replace alt-java patch with a binary separate from the JDK -- Drop stale patches that are of little use any more: -- * nss.cfg has been disabled since early PKCS11 work and long superseded by FIPS work -- * No accessibility subpackage to warrant RH1648242 patch any more -- * No use of system libjpeg turbo to warrant RH649512 patch any more -- Replace RH1684077 pcsc-lite-libs patch with better JDK-8009550 fix being upstreamed -- Update generate_tarball.sh to sync with upstream vanilla script -- Change top_level_dir_name to use the VCS tag, matching new upstream release style tarball -- Use upstream release URL for OpenJDK source -- Port misc tarball from RHEL to house alt-java outside the JDK tree -- Port improved tarball creation and checking from RHEL so tarballs are verified - -* Thu Sep 14 2023 Andrew Hughes - 1:21.0.0.0.35-2.rolling -- Bump buildjdkver now that java-21-openjdk is available in the buildroot - -* Tue Aug 08 2023 Petra Alice Mikova 1:21.0.0.0.35-1.rolling -- updated to jdk-21+35, which is no longer EA - -* Tue Aug 08 2023 Petra Alice Mikova 1:21.0.0.0.34-0.1.ea.rolling -- initial update to jdk21 -- commented out fips patches -- updated to jdk21 ea -- updated patch 1001 - rh1648249-add_commented_out_nss_cfg_provider_to_java_security -- replace smoketests in staticlibs test, as the previous files used were removed by a patch in JDK -- require tzdata 2023c -- Update FIPS support to bring in latest changes -- * RH2048582: Support PKCS#12 keystores -- * RH2020290: Support TLS 1.3 in FIPS mode -- * Add nss.fips.cfg support to OpenJDK tree -- * RH2117972: Extend the support for NSS DBs (PKCS11) in FIPS mode -- * Remove forgotten dead code from RH2020290 and RH2104724 -- * OJ1357: Fix issue on FIPS with a SecurityManager in place -- * RH2134669: Add missing attributes when registering services in FIPS mode. -- * test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java: fixed jtreg main class -- * RH1940064: Enable XML Signature provider in FIPS mode -- * Remove GCC minor versioning (JDK-8284772) to unbreak testing -- Drop local nss.fips.cfg.in handling now this is handled in the patched OpenJDK build - -* Thu Aug 03 2023 Jiri Vanek - 1:20.0.2.0.9-1.rolling -- Update to jdk-20.0.2+9 -- Update release notes to 20.0.2+9 - -* Thu Jul 20 2023 Fedora Release Engineering - 1:20.0.1.0.9-5.rolling.1 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Tue Jun 27 2023 Kalev Lember - 1:20.0.1.0.9-5.rolling -- Simplify portable archive name macros - -* Mon May 15 2023 Jiri Vanek - 1:20.0.1.0.9-4.rolling -- Redeclared ForFiles release sections as %%nil no longer works with %%1 -- RPM 4.19 no longer accept our double percentaged %%{nil} passed to %%{1} -- so we have to pass in "" but evaluate it, otherwise files record will include it - -* Mon May 15 2023 Jiri Vanek - 1:20.0.1.0.9-3.rolling -- no longer using system cacerts during build -- they are already mv-ed as .upstream in rpms - -* Wed May 10 2023 Jiri Vanek - 1:20.0.1.0.9-2.rolling -- enabled all crypto - -* Wed Apr 26 2023 Andrew Hughes - 1:20.0.1.0.9-1.rolling -- Update to jdk-20.0.1+9 -- Update release notes to 20.0.1+9 - -* Fri Apr 14 2023 Jiri Vanek - 1:20.0.0.0.36-3.rolling -- introduced archfull src archive -- replaced nasty handling of icons. -- needed for icons and src reference for rpms (debuginfo, src subpkg) -- licences moved to proper sharable noarch - -* Mon Apr 10 2023 Andrew Hughes - 1:20.0.0.0.36-2.rolling -- Complete update to OpenJDK 20 -- Update NEWS -- Update system crypto policy & FIPS patch from new fips-20u tree -- * RH2104724: Avoid import/export of DH private keys -- * RH2092507: P11Key.getEncoded does not work for DH keys in FIPS mode -- * Build the systemconf library on all platforms -- Update generate_tarball.sh ICEDTEA_VERSION and add support for passing a boot JDK to the configure run -- Revert changes to generate_tarball.sh which break error handling -- Add POSIX-friendly error codes to generate_tarball.sh and fix whitespace -- Remove .jcheck and GitHub support when generating tarballs, as done in upstream release tarballs -- Revert changes to patch macro which break on older versions of rpm (4.16) -- Revert changes to configure run -- Revert RH1648429 patch changes -- Update CLDR reference data following update to 42 (Rocky Mountain-Normalzeit => Rocky-Mountain-Normalzeit) -- Re-enable disabled translation test -- Automatically turn off building a fresh HotSpot first, if the bootstrap JDK is not the same major version as that being built - -* Tue Mar 28 2023 Jiri Vanek - 1:20.0.0.0.36-1.rolling -- moved to jdk20 -- remvoed already upstreamed patches patch2006,2007,2008,2009 -- commented out not yet adapted patch1001 - fips support -- removed --disable-sysconf-nss due to missing patch 1001 from configure --- todo return both patch1001 and disable-sysconf-nss! -- adapted rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch and rh1750419-redhat_alt_java.patch patches -- inverted fresh_libjvm behavior to be disabled by default. fails: --- See: https://koji.fedoraproject.org/koji/taskinfo?taskID=99242677 -- commented out tzdata tests -- moved from deprecated patchN to patch N - -* Tue Feb 07 2023 Jiri Vanel - 1:19.0.2.0.7-2.rolling -- added png icons from x11 source package, so they can be reused by rpms - - * Thu Jan 26 2023 Andrew Hughes - 1:19.0.2.0.7-1.rolling -- Update to jdk-19.0.2 release -- Update release notes to 19.0.2 -- Drop JDK-8293834 (CLDR update for Kyiv) which is now upstream -- Drop JDK-8294357 (tzdata2022d), JDK-8295173 (tzdata2022e) & JDK-8296108 (tzdata2022f) local patches which are now upstream -- Drop JDK-8296715 (CLDR update for 2022f) which is now upstream -- Add local patch JDK-8295447 (javac NPE) which was accepted into 19u upstream but not in the GA tag -- Add local patches for JDK-8296239 & JDK-8299439 (Croatia Euro update) which are present in 8u, 11u & 17u releases - -* Thu Jan 19 2023 Andrew Hughes - 1:19.0.1.0.10-3.rolling - - Update in-tree tzdata & CLDR to 2022g with JDK-8296108, JDK-8296715 & JDK-8297804 - - Update TestTranslations.java to test the new America/Ciudad_Juarez zone - -* Thu Jan 19 2023 Stephan Bergmann - 1:19.0.1.0.10-3.rolling - - Fix flatpak builds by disabling TestTranslations test due to missing tzdb.dat - -* Thu Jan 19 2023 Fedora Release Engineering - 1:19.0.1.0.10-3.rolling.1 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Thu Jan 12 2023 Jiri Vanel - 1:19.0.1.0.10-3.rolling -- keep system crypto policy honoring disabled (test adapted) -- keep upstream cacerts -- call installjdk also for jreimage. -- add alt-java man page conditionaly (se install openjdk for jre above) -- convert man pages to utf8 (conditionally, man pages are not in jre) -- stabilised permissions as was in rpms -- use NEWS both in tarball and outside -- for release sdk use javadoc archive. -- remove STRIP_KEEP_SYMTAB=libjvm* and all todo as it is going to continue in rpms only - (hopefully) - -* Thu Dec 01 2022 Petra Alice Mikova - 1:19.0.1.0.10-2.rolling -- initial import - +%autochangelog From 552d7c1901352d022ac57c71771cf1cd7baa8933 Mon Sep 17 00:00:00 2001 From: Jiri Date: Sun, 20 Oct 2024 15:27:14 +0200 Subject: [PATCH 49/86] October CPU --- .gitignore | 1 + NEWS | 34 +++++++++++++++++++++++++++++++ generate_source_tarball.sh | 2 +- java-latest-openjdk-portable.spec | 4 ++-- sources | 2 +- 5 files changed, 39 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 16b8360..b780ca0 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ /openjdk-jdk-22.0.1+8.tar.xz /openjdk-jdk-22.0.2+9.tar.xz /openjdk-jdk-23+37.tar.xz +/openjdk-jdk-23.0.1+11.tar.xz diff --git a/NEWS b/NEWS index 6d25da7..8159c68 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,40 @@ JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY JEP-XYZ: https://openjdk.org/jeps/XYZ +New in release OpenJDK 23.0.1+11 (2024-10-15): +=========================================== + - JDK-6967482: TAB-key does not work in JTables after selecting details-view in JFileChooser + - JDK-8166352: FilePane.createDetailsView() removes JTable TAB, SHIFT-TAB functionality + - JDK-8299813: java/nio/channels/DatagramChannel/Disconnect.java fails with jtreg test timeout due to lost datagram + - JDK-8307383: Enhance DTLS connections + - JDK-8311208: Improve CDS Support + - JDK-8325525: Create jtreg test case for JDK-8325203 + - JDK-8328286: Enhance HTTP client + - JDK-8328544: Improve handling of vectorization + - JDK-8328726: Better Kerberos support + - JDK-8331411: Shenandoah: Reconsider spinning duration in ShenandoahLock + - JDK-8331446: Improve deserialization support + - JDK-8332524: Instead of printing "TLSv1.3," it is showing "TLS13" + - JDK-8332644: Improve graph optimizations + - JDK-8332818: ubsan: archiveHeapLoader.cpp:70:27: runtime error: applying non-zero offset 18446744073707454464 to null pointer + - JDK-8333652: RISC-V: compiler/vectorapi/VectorGatherMaskFoldingTest.java fails when using RVV + - JDK-8333716: Shenandoah: Check for disarmed method before taking the nmethod lock + - JDK-8333887: ubsan: unsafe.cpp:247:13: runtime error: store to null pointer of type 'volatile int' + - JDK-8334041: Bump version numbers for 23.0.1 + - JDK-8334123: log the opening of Type 1 fonts + - JDK-8334239: Introduce macro for ubsan method/function exclusions + - JDK-8334653: ISO 4217 Amendment 177 Update + - JDK-8335536: Fix assertion failure in IdealGraphPrinter when append is true + - JDK-8335713: Enhance vectorization analysis + - JDK-8335775: Remove extraneous 's' in comment of rawmonitor.cpp test file + - JDK-8336301: test/jdk/java/nio/channels/AsyncCloseAndInterrupt.java leaves around a FIFO file upon test completion + - JDK-8336366: Change milestone to fcs for all releases + - JDK-8337103: The change for RDP2 CPU24_10 has corrupted line endings in the file version-numbers.conf. + - JDK-8337664: Distrust TLS server certificates issued after Oct 2024 and anchored by Entrust Root CAs + - JDK-8338696: (fs) BasicFileAttributes.creationTime() falls back to epoch if birth time is unavailable (Linux) + - JDK-8341057: Add 2 SSL.com TLS roots + - JDK-8341059: Change Entrust TLS distrust date to November 12, 2024 + New in release OpenJDK 23.0.0+37 (2024-09-17): =========================================== - JEP-455: Primitive Types in Patterns, instanceof, and switch (Preview) diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index 5eb89f6..c62430a 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -36,7 +36,7 @@ # # PROJECT_NAME=openjdk # REPO_NAME=jdk23u -# VERSION=jdk-23+37 +# VERSION=jdk-23.0.1+11 # # or to e.g., prepare systemtap, icedtea7's jstack and other tapsets: # diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index e55fc43..622cbf0 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -337,7 +337,7 @@ # New Version-String scheme-style defines %global featurever 23 %global interimver 0 -%global updatever 0 +%global updatever 1 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, @@ -401,7 +401,7 @@ %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 37 +%global buildver 11 %global rpmrelease %(echo "%autorelease" | sed 's;%{?dist};;') #%%global tagsuffix %%{nil} # 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 diff --git a/sources b/sources index 49e3788..d7639bc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-jdk-23+37.tar.xz) = b76de2d7a7d5b400d29af5233e91f629c55d38dd987bb0fe4d8d3ac7c41f70112e302e74cc85183883202be6a8ede55133f7d2b4fbf4b6537f31d95b0a38670b +SHA512 (openjdk-jdk-23.0.1+11.tar.xz) = cb7e679c4fca057f3631117bec02e4e361d104936c50f40b6d26860f3f93f7a98fd000916feea3df5b5b61ff1eafb9c502f08694e0e49d84e31778b5e9c3f7f1 From c469f03058e533987aef39bd6891f742278d604d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 07:41:46 +0000 Subject: [PATCH 50/86] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- java-latest-openjdk-portable.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 622cbf0..7966f83 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -569,7 +569,7 @@ Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as # java-X-openjdk. See: https://bugzilla.redhat.com/show_bug.cgi?id=1647298 -Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist} +Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist}.1 # 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 # also included the epoch in their virtual provides. This created a @@ -1785,4 +1785,7 @@ done %endif %changelog +* Fri Jan 17 2025 Fedora Release Engineering - 1:23.0.1.0.11-.rolling.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + %autochangelog From 8aeb686da386ec1b9a0be9f2b170304de82d69f7 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 27 Jan 2025 16:16:34 +0100 Subject: [PATCH 51/86] January CPU 2025 --- .gitignore | 1 + generate_source_tarball.sh | 4 ++-- java-latest-openjdk-portable.spec | 6 +++--- sources | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index b780ca0..8691373 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ /openjdk-jdk-22.0.2+9.tar.xz /openjdk-jdk-23+37.tar.xz /openjdk-jdk-23.0.1+11.tar.xz +/openjdk-23.0.2+7.tar.xz diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index c62430a..9ec0b79 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -36,7 +36,7 @@ # # PROJECT_NAME=openjdk # REPO_NAME=jdk23u -# VERSION=jdk-23.0.1+11 +# VERSION=jdk-23.0.2+7 # # or to e.g., prepare systemtap, icedtea7's jstack and other tapsets: # @@ -252,7 +252,7 @@ pushd "${FILE_NAME_ROOT}" else SWITCH=czf fi - TARBALL_NAME=${TARBALL_BASE}.${COMPRESSION} + TARBALL_NAME=`echo ${TARBALL_BASE}.${COMPRESSION} | sed "s/-jdk-/-/g"` XZ_OPT=${XZ_OPT-"-T0"} \ tar --mtime="${TAR_TIME}" --owner=root --group=root --sort=name \ -$SWITCH "${TARBALL_NAME}" "${TO_COMPRESS}" diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 7966f83..2efe938 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -337,7 +337,7 @@ # New Version-String scheme-style defines %global featurever 23 %global interimver 0 -%global updatever 1 +%global updatever 2 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, @@ -401,7 +401,7 @@ %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 11 +%global buildver 7 %global rpmrelease %(echo "%autorelease" | sed 's;%{?dist};;') #%%global tagsuffix %%{nil} # 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 @@ -606,7 +606,7 @@ License: Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-C URL: http://openjdk.java.net/ # The source tarball, generated using generate_source_tarball.sh -Source0: https://openjdk-sources.osci.io/openjdk%{featurever}/openjdk-%{vcstag}%{ea_designator_zip}.tar.xz +Source0: https://openjdk-sources.osci.io/openjdk%{featurever}/open%{vcstag}%{ea_designator_zip}.tar.xz # Use 'icedtea_sync.sh' to update the following # They are based on code contained in the IcedTea project (6.x). diff --git a/sources b/sources index d7639bc..9a5c086 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-jdk-23.0.1+11.tar.xz) = cb7e679c4fca057f3631117bec02e4e361d104936c50f40b6d26860f3f93f7a98fd000916feea3df5b5b61ff1eafb9c502f08694e0e49d84e31778b5e9c3f7f1 +SHA512 (openjdk-23.0.2+7.tar.xz) = 6cab15914f7c61acd905347b7d6e4fe682401248294afcd972b2b576c69ae0d06b2a335089a57329e78962b83fabbc08d3463994bfdcd28dec5a1c3c5167d660 From b131ab378deb7bb1d5e3a91acc7e906588b76ec7 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 27 Jan 2025 16:17:12 +0100 Subject: [PATCH 52/86] Revert "Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild" This reverts commit c469f03058e533987aef39bd6891f742278d604d. --- java-latest-openjdk-portable.spec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 2efe938..76cc915 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -569,7 +569,7 @@ Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as # java-X-openjdk. See: https://bugzilla.redhat.com/show_bug.cgi?id=1647298 -Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist}.1 +Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist} # 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 # also included the epoch in their virtual provides. This created a @@ -1785,7 +1785,4 @@ done %endif %changelog -* Fri Jan 17 2025 Fedora Release Engineering - 1:23.0.1.0.11-.rolling.1 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - %autochangelog From 5b0be33c4f5c1eb45c0237f04b3ca488ba9a8de4 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 27 Jan 2025 17:34:38 +0100 Subject: [PATCH 53/86] NEWS --- NEWS | 193 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) diff --git a/NEWS b/NEWS index 8159c68..be3a762 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,199 @@ JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY JEP-XYZ: https://openjdk.org/jeps/XYZ +New in release OpenJDK 23.0.2+7 (2025-01-22): +=========================================== + - JDK-8028127: Regtest java/security/Security/SynchronizedAccess.java is incorrect + - JDK-8302111: Serialization considerations + - JDK-8317116: Provide layouts for multiple test UI in PassFailJFrame + - JDK-8319933: Disable tests for JDK-8280481 on Graal + - JDK-8321509: False positive in get_trampoline fast path causes crash + - JDK-8323688: C2: Fix UB of jlong overflow in PhaseIdealLoop::is_counted_loop() + - JDK-8324672: Update jdk/java/time/tck/java/time/TCKInstant.java now() to be more robust + - JDK-8325937: runtime/handshake/HandshakeDirectTest.java causes "monitor end should be strictly below the frame pointer" assertion failure on AArch64 + - JDK-8326616: tools/javac/patterns/Exhaustiveness.java intermittently Timeout signalled after 480 seconds + - JDK-8328723: IP Address error when client enables HTTPS endpoint check on server socket + - JDK-8330045: Enhance array handling + - JDK-8330702: Update failure handler to don't generate Error message if cores actions are empty + - JDK-8331391: Enhance the keytool code by invoking the buildTrustedCerts method for essential options + - JDK-8332113: Update nsk.share.Log to be always verbose + - JDK-8332461: ubsan : dependencies.cpp:906:3: runtime error: load of value 4294967295, which is not a valid value for type 'DepType' + - JDK-8332697: ubsan: shenandoahSimpleBitMap.inline.hpp:68:23: runtime error: signed integer overflow: -9223372036854775808 - 1 cannot be represented in type 'long int' + - JDK-8332699: ubsan: jfrEventSetting.inline.hpp:31:43: runtime error: index 163 out of bounds for type 'jfrNativeEventSetting [162]' + - JDK-8332901: Select{Current,New}ItemTest.java for Choice don't open popup on macOS + - JDK-8332903: ubsan: opto/output.cpp:1002:18: runtime error: load of value 171, which is not a valid value for type 'bool' + - JDK-8333088: ubsan: shenandoahAdaptiveHeuristics.cpp:245:44: runtime error: division by zero + - JDK-8333098: ubsan: bytecodeInfo.cpp:318:59: runtime error: division by zero + - JDK-8333248: VectorGatherMaskFoldingTest.java failed when maximum vector bits is 64 + - JDK-8333277: ubsan: mlib_ImageScanPoly.c:292:43: runtime error: division by zero + - JDK-8333306: gc/arguments/TestParallelGCErgo.java fails when largepage are enabled + - JDK-8333317: Test sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java failed with: Invalid ECDH ServerKeyExchange signature + - JDK-8333354: ubsan: frame.inline.hpp:91:25: and src/hotspot/share/runtime/frame.inline.hpp:88:29: runtime error: member call on null pointer of type 'const struct SmallRegisterMap' + - JDK-8333361: ubsan,test : libHeapMonitorTest.cpp:518:9: runtime error: null pointer passed as argument 2, which is declared to never be null + - JDK-8333363: ubsan: instanceKlass.cpp: runtime error: member call on null pointer of type 'struct AnnotationArray' + - JDK-8333391: Test com/sun/jdi/InterruptHangTest.java failed: Thread was never interrupted during sleep + - JDK-8333522: JFR SwapSpace event might read wrong free swap space size + - JDK-8333639: ubsan: cppVtables.cpp:81:55: runtime error: index 14 out of bounds for type 'long int [1]' + - JDK-8333728: ubsan: shenandoahFreeSet.cpp:1347:24: runtime error: division by zero + - JDK-8333730: ubsan: FieldIndices/libFieldIndicesTest.cpp:276:11: runtime error: null pointer passed as argument 2, which is declared to never be null + - JDK-8333754: Add a Test against ECDSA and ECDH NIST Test vector + - JDK-8333791: Fix memory barriers for @Stable fields + - JDK-8333824: Unused ClassValue in VarHandles + - JDK-8334057: JLinkReproducibleTest.java support receive test.tool.vm.opts + - JDK-8334147: Shenandoah: Avoid taking lock for disabled free set logging + - JDK-8334166: Enable binary check + - JDK-8334229: Optimize InterpreterOopMap layout + - JDK-8334405: java/nio/channels/Selector/SelectWithConsumer.java#id0 failed in testWakeupDuringSelect + - JDK-8334482: Shenandoah: Deadlock when safepoint is pending during nmethods iteration + - JDK-8334560: [PPC64]: postalloc_expand_java_dynamic_call_sched does not copy all fields + - JDK-8334562: Automate com/sun/security/auth/callback/TextCallbackHandler/Default.java test + - JDK-8334564: VM startup: fatal error: FLAG_SET_ERGO cannot be used to set an invalid value for NonNMethodCodeHeapSize + - JDK-8334567: [test] runtime/os/TestTracePageSizes move ppc handling + - JDK-8334618: ubsan: support setting additional ubsan check options + - JDK-8334769: Shenandoah: Move CodeCache_lock close to its use in ShenandoahConcurrentNMethodIterator + - JDK-8335007: Inline OopMapCache table + - JDK-8335142: compiler/c1/TestTraceLinearScanLevel.java occasionally times out with -Xcomp + - JDK-8335150: Test LogGeneratedClassesTest.java fails on rpmbuild mock enviroment + - JDK-8335172: Add manual steps to run security/auth/callback/TextCallbackHandler/Password.java test + - JDK-8335237: ubsan: vtableStubs.hpp is_vtable_stub exclude from ubsan checks + - JDK-8335267: [XWayland] move screencast tokens from .awt to .java folder + - JDK-8335283: Build failure due to 'no_sanitize' attribute directive ignored + - JDK-8335344: test/jdk/sun/security/tools/keytool/NssTest.java fails to compile + - JDK-8335397: Improve reliability of TestRecursiveMonitorChurn.java + - JDK-8335428: Enhanced Building of Processes + - JDK-8335449: runtime/cds/DeterministicDump.java fails with File content different at byte ... + - JDK-8335493: check_gc_overhead_limit should reset SoftRefPolicy::_should_clear_all_soft_refs + - JDK-8335530: Java file extension missing in AuthenticatorTest + - JDK-8335664: Parsing jsr broken: assert(bci>= 0 && bci < c->method()->code_size()) failed: index out of bounds + - JDK-8335709: C2: assert(!loop->is_member(get_loop(useblock))) failed: must be outside loop + - JDK-8335713: Enhance vectorization analysis + - JDK-8335743: jhsdb jstack cannot print some information on the waiting thread + - JDK-8335789: [TESTBUG] XparColor.java test fails with Error. Parse Exception: Invalid or unrecognized bugid: @ + - JDK-8335904: Fix invalid comment in ShenandoahLock + - JDK-8336148: Test runtime/locking/TestRecursiveMonitorChurn.java failed: Unexpected Inflation + - JDK-8336240: Test com/sun/crypto/provider/Cipher/DES/PerformanceTest.java fails with java.lang.ArithmeticException + - JDK-8336284: Test TestClhsdbJstackLock.java/TestJhsdbJstackLock.java fails with -Xcomp after JDK-8335743 + - JDK-8336315: tools/jpackage/windows/WinChildProcessTest.java Failed: Check is calculator process is alive + - JDK-8336342: Fix known X11 library locations in sysroot + - JDK-8336343: Add more known sysroot library locations for ALSA + - JDK-8336363: Update the release version after forking Oct CPU24_10 + - JDK-8336413: gtk headers : Fix typedef redeclaration of GMainContext and GdkPixbuf + - JDK-8336564: Enhance mask blit functionality redux + - JDK-8336640: Shenandoah: Parallel worker use in parallel_heap_region_iterate + - JDK-8336692: Redo fix for JDK-8284620 + - JDK-8336854: CAInterop.java#actalisauthenticationrootca conflicted with /manual and /timeout + - JDK-8336914: Shenandoah: Missing verification steps after JDK-8255765 + - JDK-8336926: jdk/internal/util/ReferencedKeyTest.java can fail with ConcurrentModificationException + - JDK-8336928: GHA: Bundle artifacts removal broken + - JDK-8336942: Improve test coverage for class loading elements with annotations of different retentions + - JDK-8337024: Bump version numbers for 23.0.2 + - JDK-8337066: Repeated call of StringBuffer.reverse with double byte string returns wrong result + - JDK-8337067: Test runtime/classFileParserBug/Bad_NCDFE_Msg.java won't compile + - JDK-8337283: configure.log is truncated when build dir is on different filesystem + - JDK-8337320: Update ProblemList.txt with tests known to fail on XWayland + - JDK-8337331: crash: pinned virtual thread will lead to jvm crash when running with the javaagent option + - JDK-8337622: IllegalArgumentException in java.lang.reflect.Field.get + - JDK-8337664: Distrust TLS server certificates issued after Oct 2024 and anchored by Entrust Root CAs + - JDK-8337753: Target class of upcall stub may be unloaded + - JDK-8337780: RISC-V: C2: Change C calling convention for sp to NS + - JDK-8337795: Type annotation attached to incorrect type during class reading + - JDK-8337810: ProblemList BasicDirectoryModel/LoaderThreadCount.java on Windows + - JDK-8337819: Update GHA JDKs to 22.0.2 + - JDK-8337876: [IR Framework] Add support for IR tests with @Stable + - JDK-8337886: java/awt/Frame/MaximizeUndecoratedTest.java fails in OEL due to a slight color difference + - JDK-8337958: Out-of-bounds array access in secondary_super_cache + - JDK-8337968: Problem list compiler/vectorapi/VectorRebracket128Test.java + - JDK-8337971: Problem list several jvmci tests on linux-riscv64 until JDK-8331704 is fixed + - JDK-8337998: CompletionFailure in getEnclosingType attaching type annotations + - JDK-8338058: map_or_reserve_memory_aligned Windows enhance remap assertion + - JDK-8338101: remove old remap assertion in map_or_reserve_memory_aligned after JDK-8338058 + - JDK-8338109: java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java duplicate in ProblemList + - JDK-8338110: Exclude Fingerprinter::do_type from ubsan checks + - JDK-8338112: Test testlibrary_tests/ir_framework/tests/TestPrivilegedMode.java fails with release build + - JDK-8338286: GHA: Demote x86_32 to hotspot build only + - JDK-8338380: Update TLSCommon/interop/AbstractServer to specify an interface to listen for connections + - JDK-8338389: [JFR] Long strings should be added to the string pool + - JDK-8338402: GHA: some of bundles may not get removed + - JDK-8338696: (fs) BasicFileAttributes.creationTime() falls back to epoch if birth time is unavailable (Linux) + - JDK-8338751: ConfigureNotify behavior has changed in KWin 6.2 + - JDK-8338759: Add extra diagnostic to java/net/InetAddress/ptr/Lookup.java + - JDK-8338924: C1: assert(0 <= i && i < _len) failed: illegal index 5 for length 5 + - JDK-8339154: Cleanups and JUnit conversion of test/jdk/java/util/zip/Available.java + - JDK-8339180: Enhanced Building of Processes: Follow-on Issue + - JDK-8339248: RISC-V: Remove li64 macro assembler routine and related code + - JDK-8339384: Unintentional IOException in jdk.jdi module when JDWP end of stream occurs + - JDK-8339386: Assertion on AIX - original PC must be in the main code section of the compiled method + - JDK-8339416: [s390x] Provide implementation for resolve_global_jobject + - JDK-8339487: ProcessHandleImpl os_getChildren sysctl call - retry in case of ENOMEM and enhance exception message + - JDK-8339548: GHA: RISC-V: Use Debian snapshot archive for bootstrap + - JDK-8339560: Unaddressed comments during code review of JDK-8337664 + - JDK-8339591: Mark jdk/jshell/ExceptionMessageTest.java intermittent + - JDK-8339637: (tz) Update Timezone Data to 2024b + - JDK-8339644: Improve parsing of Day/Month in tzdata rules + - JDK-8339648: ZGC: Division by zero in rule_major_allocation_rate + - JDK-8339725: Concurrent GC crashed due to GetMethodDeclaringClass + - JDK-8339731: java.desktop/share/classes/javax/swing/text/html/default.css typo in margin settings + - JDK-8339741: RISC-V: C ABI breakage for integer on stack + - JDK-8339787: Add some additional diagnostic output to java/net/ipv6tests/UdpTest.java + - JDK-8339803: Acknowledge case insensitive unambiguous keywords in tzdata files + - JDK-8340007: Refactor KeyEvent/FunctionKeyTest.java + - JDK-8340008: KeyEvent/KeyTyped/Numpad1KeyTyped.java has 15 seconds timeout + - JDK-8340073: Support "%z" time zone abbreviation format in TZ files + - JDK-8340109: Ubsan: ciEnv.cpp:1660:65: runtime error: member call on null pointer of type 'struct CompileTask' + - JDK-8340210: Add positionTestUI() to PassFailJFrame.Builder + - JDK-8340214: C2 compilation asserts with "no node with a side effect" in PhaseIdealLoop::try_sink_out_of_loop + - JDK-8340230: Tests crash: assert(is_in_encoding_range || k->is_interface() || k->is_abstract()) failed: sanity + - JDK-8340306: Add border around instructions in PassFailJFrame + - JDK-8340308: PassFailJFrame: Make rows default to number of lines in instructions + - JDK-8340313: Crash due to invalid oop in nmethod after C1 patching + - JDK-8340365: Position the first window of a window list + - JDK-8340383: VM issues warning failure to find kernel32.dll on Windows nanoserver + - JDK-8340387: Update OS detection code to recognize Windows Server 2025 + - JDK-8340398: [JVMCI] Unintuitive behavior of UseJVMCICompiler option + - JDK-8340418: GHA: MacOS AArch64 bundles can be removed prematurely + - JDK-8340461: Amend description for logArea + - JDK-8340466: Add description for PassFailJFrame constructors + - JDK-8340586: JdkJfrEvent::get_all_klasses stores non-strong oops in JNI handles + - JDK-8340590: RISC-V: C2: Small improvement to vector gather load and scatter store + - JDK-8340657: [PPC64] SA determines wrong unextendedSP + - JDK-8340684: Reading from an input stream backed by a closed ZipFile has no test coverage + - JDK-8340785: Update description of PassFailJFrame and samples + - JDK-8340799: Add border inside instruction frame in PassFailJFrame + - JDK-8340804: doc/building.md update Xcode instructions to note that full install is required + - JDK-8340812: LambdaForm customization via MethodHandle::updateForm is not thread safe + - JDK-8340815: Add SECURITY.md file + - JDK-8340824: C2: Memory for TypeInterfaces not reclaimed by hashcons() + - JDK-8340899: Remove wildcard bound in PositionWindows.positionTestWindows + - JDK-8340923: The class LogSelection copies uninitialized memory + - JDK-8341024: [test] build/AbsPathsInImage.java fails with OOM when using ubsan-enabled binaries + - JDK-8341057: Add 2 SSL.com TLS roots + - JDK-8341059: Change Entrust TLS distrust date to November 12, 2024 + - JDK-8341127: Extra call to MethodHandle::asType from memory segment var handles fails to inline + - JDK-8341146: RISC-V: Unnecessary fences used for load-acquire in template interpreter + - JDK-8341235: Improve default instruction frame title in PassFailJFrame + - JDK-8341261: Tests assume UnlockExperimentalVMOptions is disabled by default + - JDK-8341554: Shenandoah: Missing heap lock when updating usage for soft ref policy + - JDK-8341562: RISC-V: Generate comments in -XX:+PrintInterpreter to link to source code + - JDK-8341658: RISC-V: Test DateFormatProviderTest.java run timeouted + - JDK-8341668: Shenandoah: assert(tail_bits < (idx_t)BitsPerWord) failed: precondition + - JDK-8341688: Aarch64: Generate comments in -XX:+PrintInterpreter to link to source code + - JDK-8341709: Change milestone to ea for JDK23.0.2 + - JDK-8341806: Gcc version detection failure on Alinux3 + - JDK-8341881: [REDO] java/nio/file/attribute/BasicFileAttributeView/CreationTime.java#tmp fails on alinux3 + - JDK-8341966: Broken annotated module may lead to an exception in javac + - JDK-8341997: Tests create files in src tree instead of scratch dir + - JDK-8342014: RISC-V: ZStoreBarrierStubC2 clobbers rflags + - JDK-8342114: Change milestone to fcs for all releases + - JDK-8342145: File libCreationTimeHelper.c compile fails on Alpine + - JDK-8342489: compiler/c2/irTests/TestVectorizationMismatchedAccess.java fails on big-endian platforms + - JDK-8342496: C2/Shenandoah: SEGV in compiled code when running jcstress + - JDK-8342612: Increase memory usage of compiler/c2/TestScalarReplacementMaxLiveNodes.java + - JDK-8342681: TestLoadBypassesNullCheck.java fails improperly specified VM option + - JDK-8342701: [PPC64] TestOSRLotsOfLocals.java crashes + - JDK-8342905: Thread.setContextClassloader from thread in FJP commonPool task no longer works after JDK-8327501 redux + - JDK-8342962: [s390x] TestOSRLotsOfLocals.java crashes + + New in release OpenJDK 23.0.1+11 (2024-10-15): =========================================== - JDK-6967482: TAB-key does not work in JTables after selecting details-view in JFileChooser From 527abd4d5d50de0be99af452936ad6c67d823232 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Sun, 2 Feb 2025 12:19:55 +0100 Subject: [PATCH 54/86] Updated to jdk-24+34-ea --- .gitignore | 1 + generate_source_tarball.sh | 4 ++-- java-latest-openjdk-portable.spec | 8 ++++---- sources | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 8691373..f34dd29 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ /openjdk-jdk-23+37.tar.xz /openjdk-jdk-23.0.1+11.tar.xz /openjdk-23.0.2+7.tar.xz +/openjdk-24+34-ea.tar.xz diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index 9ec0b79..fc15c24 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -35,8 +35,8 @@ # VERSION, e.g.: # # PROJECT_NAME=openjdk -# REPO_NAME=jdk23u -# VERSION=jdk-23.0.2+7 +# REPO_NAME=jdk24u +# VERSION=jdk-24+34 # # or to e.g., prepare systemtap, icedtea7's jstack and other tapsets: # diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 76cc915..be13741 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -335,9 +335,9 @@ %endif # New Version-String scheme-style defines -%global featurever 23 +%global featurever 24 %global interimver 0 -%global updatever 2 +%global updatever 0 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, @@ -401,7 +401,7 @@ %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 7 +%global buildver 34 %global rpmrelease %(echo "%autorelease" | sed 's;%{?dist};;') #%%global tagsuffix %%{nil} # 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 @@ -421,7 +421,7 @@ # Release will be (where N is usually a number starting at 1): # - 0.N%%{?extraver}%%{?dist} for EA releases, # - N%%{?extraver}{?dist} for GA releases -%global is_ga 1 +%global is_ga 0 %if %{is_ga} %global build_type GA %global ea_designator "" diff --git a/sources b/sources index 9a5c086..62218d8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-23.0.2+7.tar.xz) = 6cab15914f7c61acd905347b7d6e4fe682401248294afcd972b2b576c69ae0d06b2a335089a57329e78962b83fabbc08d3463994bfdcd28dec5a1c3c5167d660 +SHA512 (openjdk-24+34-ea.tar.xz) = caaa8e0e6ca515a9fc18ddbcda0fd1e2a4863aee49b2a5dea77a93346112ff5c9147d57088179866fe6b3905dea3a06c225811118edb395746a478a9dd2d0039 From 17dda09e75351b40002ecf5bd9eae8c323082061 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Sun, 2 Feb 2025 12:41:51 +0100 Subject: [PATCH 55/86] Enabled jmod-less jlink capability and kept jmods https://openjdk.org/jeps/493 --- java-latest-openjdk-portable.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index be13741..b256b95 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1135,6 +1135,8 @@ function buildjdk() { --with-debug-level=${debuglevel} \ --with-native-debug-symbols="${debug_symbols}" \ --enable-unlimited-crypto \ + --enable-linkable-runtime \ + --enable-keep-packaged-modules \ --with-zlib=%{link_type} \ --with-freetype=%{link_type} \ --with-libjpeg=${link_opt} \ From 94d10b8b2a34a76ecf58f0ee1de68d5d53525237 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Sun, 2 Feb 2025 12:48:21 +0100 Subject: [PATCH 56/86] Adjsuted NEWS for jdk24 --- NEWS | 433 ++++------------------------------------------------------- 1 file changed, 25 insertions(+), 408 deletions(-) diff --git a/NEWS b/NEWS index be3a762..2eb9bd4 100644 --- a/NEWS +++ b/NEWS @@ -4,412 +4,29 @@ JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY JEP-XYZ: https://openjdk.org/jeps/XYZ -New in release OpenJDK 23.0.2+7 (2025-01-22): +New in release OpenJDK 24.0.0+34 (2025-03-18): =========================================== - - JDK-8028127: Regtest java/security/Security/SynchronizedAccess.java is incorrect - - JDK-8302111: Serialization considerations - - JDK-8317116: Provide layouts for multiple test UI in PassFailJFrame - - JDK-8319933: Disable tests for JDK-8280481 on Graal - - JDK-8321509: False positive in get_trampoline fast path causes crash - - JDK-8323688: C2: Fix UB of jlong overflow in PhaseIdealLoop::is_counted_loop() - - JDK-8324672: Update jdk/java/time/tck/java/time/TCKInstant.java now() to be more robust - - JDK-8325937: runtime/handshake/HandshakeDirectTest.java causes "monitor end should be strictly below the frame pointer" assertion failure on AArch64 - - JDK-8326616: tools/javac/patterns/Exhaustiveness.java intermittently Timeout signalled after 480 seconds - - JDK-8328723: IP Address error when client enables HTTPS endpoint check on server socket - - JDK-8330045: Enhance array handling - - JDK-8330702: Update failure handler to don't generate Error message if cores actions are empty - - JDK-8331391: Enhance the keytool code by invoking the buildTrustedCerts method for essential options - - JDK-8332113: Update nsk.share.Log to be always verbose - - JDK-8332461: ubsan : dependencies.cpp:906:3: runtime error: load of value 4294967295, which is not a valid value for type 'DepType' - - JDK-8332697: ubsan: shenandoahSimpleBitMap.inline.hpp:68:23: runtime error: signed integer overflow: -9223372036854775808 - 1 cannot be represented in type 'long int' - - JDK-8332699: ubsan: jfrEventSetting.inline.hpp:31:43: runtime error: index 163 out of bounds for type 'jfrNativeEventSetting [162]' - - JDK-8332901: Select{Current,New}ItemTest.java for Choice don't open popup on macOS - - JDK-8332903: ubsan: opto/output.cpp:1002:18: runtime error: load of value 171, which is not a valid value for type 'bool' - - JDK-8333088: ubsan: shenandoahAdaptiveHeuristics.cpp:245:44: runtime error: division by zero - - JDK-8333098: ubsan: bytecodeInfo.cpp:318:59: runtime error: division by zero - - JDK-8333248: VectorGatherMaskFoldingTest.java failed when maximum vector bits is 64 - - JDK-8333277: ubsan: mlib_ImageScanPoly.c:292:43: runtime error: division by zero - - JDK-8333306: gc/arguments/TestParallelGCErgo.java fails when largepage are enabled - - JDK-8333317: Test sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java failed with: Invalid ECDH ServerKeyExchange signature - - JDK-8333354: ubsan: frame.inline.hpp:91:25: and src/hotspot/share/runtime/frame.inline.hpp:88:29: runtime error: member call on null pointer of type 'const struct SmallRegisterMap' - - JDK-8333361: ubsan,test : libHeapMonitorTest.cpp:518:9: runtime error: null pointer passed as argument 2, which is declared to never be null - - JDK-8333363: ubsan: instanceKlass.cpp: runtime error: member call on null pointer of type 'struct AnnotationArray' - - JDK-8333391: Test com/sun/jdi/InterruptHangTest.java failed: Thread was never interrupted during sleep - - JDK-8333522: JFR SwapSpace event might read wrong free swap space size - - JDK-8333639: ubsan: cppVtables.cpp:81:55: runtime error: index 14 out of bounds for type 'long int [1]' - - JDK-8333728: ubsan: shenandoahFreeSet.cpp:1347:24: runtime error: division by zero - - JDK-8333730: ubsan: FieldIndices/libFieldIndicesTest.cpp:276:11: runtime error: null pointer passed as argument 2, which is declared to never be null - - JDK-8333754: Add a Test against ECDSA and ECDH NIST Test vector - - JDK-8333791: Fix memory barriers for @Stable fields - - JDK-8333824: Unused ClassValue in VarHandles - - JDK-8334057: JLinkReproducibleTest.java support receive test.tool.vm.opts - - JDK-8334147: Shenandoah: Avoid taking lock for disabled free set logging - - JDK-8334166: Enable binary check - - JDK-8334229: Optimize InterpreterOopMap layout - - JDK-8334405: java/nio/channels/Selector/SelectWithConsumer.java#id0 failed in testWakeupDuringSelect - - JDK-8334482: Shenandoah: Deadlock when safepoint is pending during nmethods iteration - - JDK-8334560: [PPC64]: postalloc_expand_java_dynamic_call_sched does not copy all fields - - JDK-8334562: Automate com/sun/security/auth/callback/TextCallbackHandler/Default.java test - - JDK-8334564: VM startup: fatal error: FLAG_SET_ERGO cannot be used to set an invalid value for NonNMethodCodeHeapSize - - JDK-8334567: [test] runtime/os/TestTracePageSizes move ppc handling - - JDK-8334618: ubsan: support setting additional ubsan check options - - JDK-8334769: Shenandoah: Move CodeCache_lock close to its use in ShenandoahConcurrentNMethodIterator - - JDK-8335007: Inline OopMapCache table - - JDK-8335142: compiler/c1/TestTraceLinearScanLevel.java occasionally times out with -Xcomp - - JDK-8335150: Test LogGeneratedClassesTest.java fails on rpmbuild mock enviroment - - JDK-8335172: Add manual steps to run security/auth/callback/TextCallbackHandler/Password.java test - - JDK-8335237: ubsan: vtableStubs.hpp is_vtable_stub exclude from ubsan checks - - JDK-8335267: [XWayland] move screencast tokens from .awt to .java folder - - JDK-8335283: Build failure due to 'no_sanitize' attribute directive ignored - - JDK-8335344: test/jdk/sun/security/tools/keytool/NssTest.java fails to compile - - JDK-8335397: Improve reliability of TestRecursiveMonitorChurn.java - - JDK-8335428: Enhanced Building of Processes - - JDK-8335449: runtime/cds/DeterministicDump.java fails with File content different at byte ... - - JDK-8335493: check_gc_overhead_limit should reset SoftRefPolicy::_should_clear_all_soft_refs - - JDK-8335530: Java file extension missing in AuthenticatorTest - - JDK-8335664: Parsing jsr broken: assert(bci>= 0 && bci < c->method()->code_size()) failed: index out of bounds - - JDK-8335709: C2: assert(!loop->is_member(get_loop(useblock))) failed: must be outside loop - - JDK-8335713: Enhance vectorization analysis - - JDK-8335743: jhsdb jstack cannot print some information on the waiting thread - - JDK-8335789: [TESTBUG] XparColor.java test fails with Error. Parse Exception: Invalid or unrecognized bugid: @ - - JDK-8335904: Fix invalid comment in ShenandoahLock - - JDK-8336148: Test runtime/locking/TestRecursiveMonitorChurn.java failed: Unexpected Inflation - - JDK-8336240: Test com/sun/crypto/provider/Cipher/DES/PerformanceTest.java fails with java.lang.ArithmeticException - - JDK-8336284: Test TestClhsdbJstackLock.java/TestJhsdbJstackLock.java fails with -Xcomp after JDK-8335743 - - JDK-8336315: tools/jpackage/windows/WinChildProcessTest.java Failed: Check is calculator process is alive - - JDK-8336342: Fix known X11 library locations in sysroot - - JDK-8336343: Add more known sysroot library locations for ALSA - - JDK-8336363: Update the release version after forking Oct CPU24_10 - - JDK-8336413: gtk headers : Fix typedef redeclaration of GMainContext and GdkPixbuf - - JDK-8336564: Enhance mask blit functionality redux - - JDK-8336640: Shenandoah: Parallel worker use in parallel_heap_region_iterate - - JDK-8336692: Redo fix for JDK-8284620 - - JDK-8336854: CAInterop.java#actalisauthenticationrootca conflicted with /manual and /timeout - - JDK-8336914: Shenandoah: Missing verification steps after JDK-8255765 - - JDK-8336926: jdk/internal/util/ReferencedKeyTest.java can fail with ConcurrentModificationException - - JDK-8336928: GHA: Bundle artifacts removal broken - - JDK-8336942: Improve test coverage for class loading elements with annotations of different retentions - - JDK-8337024: Bump version numbers for 23.0.2 - - JDK-8337066: Repeated call of StringBuffer.reverse with double byte string returns wrong result - - JDK-8337067: Test runtime/classFileParserBug/Bad_NCDFE_Msg.java won't compile - - JDK-8337283: configure.log is truncated when build dir is on different filesystem - - JDK-8337320: Update ProblemList.txt with tests known to fail on XWayland - - JDK-8337331: crash: pinned virtual thread will lead to jvm crash when running with the javaagent option - - JDK-8337622: IllegalArgumentException in java.lang.reflect.Field.get - - JDK-8337664: Distrust TLS server certificates issued after Oct 2024 and anchored by Entrust Root CAs - - JDK-8337753: Target class of upcall stub may be unloaded - - JDK-8337780: RISC-V: C2: Change C calling convention for sp to NS - - JDK-8337795: Type annotation attached to incorrect type during class reading - - JDK-8337810: ProblemList BasicDirectoryModel/LoaderThreadCount.java on Windows - - JDK-8337819: Update GHA JDKs to 22.0.2 - - JDK-8337876: [IR Framework] Add support for IR tests with @Stable - - JDK-8337886: java/awt/Frame/MaximizeUndecoratedTest.java fails in OEL due to a slight color difference - - JDK-8337958: Out-of-bounds array access in secondary_super_cache - - JDK-8337968: Problem list compiler/vectorapi/VectorRebracket128Test.java - - JDK-8337971: Problem list several jvmci tests on linux-riscv64 until JDK-8331704 is fixed - - JDK-8337998: CompletionFailure in getEnclosingType attaching type annotations - - JDK-8338058: map_or_reserve_memory_aligned Windows enhance remap assertion - - JDK-8338101: remove old remap assertion in map_or_reserve_memory_aligned after JDK-8338058 - - JDK-8338109: java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java duplicate in ProblemList - - JDK-8338110: Exclude Fingerprinter::do_type from ubsan checks - - JDK-8338112: Test testlibrary_tests/ir_framework/tests/TestPrivilegedMode.java fails with release build - - JDK-8338286: GHA: Demote x86_32 to hotspot build only - - JDK-8338380: Update TLSCommon/interop/AbstractServer to specify an interface to listen for connections - - JDK-8338389: [JFR] Long strings should be added to the string pool - - JDK-8338402: GHA: some of bundles may not get removed - - JDK-8338696: (fs) BasicFileAttributes.creationTime() falls back to epoch if birth time is unavailable (Linux) - - JDK-8338751: ConfigureNotify behavior has changed in KWin 6.2 - - JDK-8338759: Add extra diagnostic to java/net/InetAddress/ptr/Lookup.java - - JDK-8338924: C1: assert(0 <= i && i < _len) failed: illegal index 5 for length 5 - - JDK-8339154: Cleanups and JUnit conversion of test/jdk/java/util/zip/Available.java - - JDK-8339180: Enhanced Building of Processes: Follow-on Issue - - JDK-8339248: RISC-V: Remove li64 macro assembler routine and related code - - JDK-8339384: Unintentional IOException in jdk.jdi module when JDWP end of stream occurs - - JDK-8339386: Assertion on AIX - original PC must be in the main code section of the compiled method - - JDK-8339416: [s390x] Provide implementation for resolve_global_jobject - - JDK-8339487: ProcessHandleImpl os_getChildren sysctl call - retry in case of ENOMEM and enhance exception message - - JDK-8339548: GHA: RISC-V: Use Debian snapshot archive for bootstrap - - JDK-8339560: Unaddressed comments during code review of JDK-8337664 - - JDK-8339591: Mark jdk/jshell/ExceptionMessageTest.java intermittent - - JDK-8339637: (tz) Update Timezone Data to 2024b - - JDK-8339644: Improve parsing of Day/Month in tzdata rules - - JDK-8339648: ZGC: Division by zero in rule_major_allocation_rate - - JDK-8339725: Concurrent GC crashed due to GetMethodDeclaringClass - - JDK-8339731: java.desktop/share/classes/javax/swing/text/html/default.css typo in margin settings - - JDK-8339741: RISC-V: C ABI breakage for integer on stack - - JDK-8339787: Add some additional diagnostic output to java/net/ipv6tests/UdpTest.java - - JDK-8339803: Acknowledge case insensitive unambiguous keywords in tzdata files - - JDK-8340007: Refactor KeyEvent/FunctionKeyTest.java - - JDK-8340008: KeyEvent/KeyTyped/Numpad1KeyTyped.java has 15 seconds timeout - - JDK-8340073: Support "%z" time zone abbreviation format in TZ files - - JDK-8340109: Ubsan: ciEnv.cpp:1660:65: runtime error: member call on null pointer of type 'struct CompileTask' - - JDK-8340210: Add positionTestUI() to PassFailJFrame.Builder - - JDK-8340214: C2 compilation asserts with "no node with a side effect" in PhaseIdealLoop::try_sink_out_of_loop - - JDK-8340230: Tests crash: assert(is_in_encoding_range || k->is_interface() || k->is_abstract()) failed: sanity - - JDK-8340306: Add border around instructions in PassFailJFrame - - JDK-8340308: PassFailJFrame: Make rows default to number of lines in instructions - - JDK-8340313: Crash due to invalid oop in nmethod after C1 patching - - JDK-8340365: Position the first window of a window list - - JDK-8340383: VM issues warning failure to find kernel32.dll on Windows nanoserver - - JDK-8340387: Update OS detection code to recognize Windows Server 2025 - - JDK-8340398: [JVMCI] Unintuitive behavior of UseJVMCICompiler option - - JDK-8340418: GHA: MacOS AArch64 bundles can be removed prematurely - - JDK-8340461: Amend description for logArea - - JDK-8340466: Add description for PassFailJFrame constructors - - JDK-8340586: JdkJfrEvent::get_all_klasses stores non-strong oops in JNI handles - - JDK-8340590: RISC-V: C2: Small improvement to vector gather load and scatter store - - JDK-8340657: [PPC64] SA determines wrong unextendedSP - - JDK-8340684: Reading from an input stream backed by a closed ZipFile has no test coverage - - JDK-8340785: Update description of PassFailJFrame and samples - - JDK-8340799: Add border inside instruction frame in PassFailJFrame - - JDK-8340804: doc/building.md update Xcode instructions to note that full install is required - - JDK-8340812: LambdaForm customization via MethodHandle::updateForm is not thread safe - - JDK-8340815: Add SECURITY.md file - - JDK-8340824: C2: Memory for TypeInterfaces not reclaimed by hashcons() - - JDK-8340899: Remove wildcard bound in PositionWindows.positionTestWindows - - JDK-8340923: The class LogSelection copies uninitialized memory - - JDK-8341024: [test] build/AbsPathsInImage.java fails with OOM when using ubsan-enabled binaries - - JDK-8341057: Add 2 SSL.com TLS roots - - JDK-8341059: Change Entrust TLS distrust date to November 12, 2024 - - JDK-8341127: Extra call to MethodHandle::asType from memory segment var handles fails to inline - - JDK-8341146: RISC-V: Unnecessary fences used for load-acquire in template interpreter - - JDK-8341235: Improve default instruction frame title in PassFailJFrame - - JDK-8341261: Tests assume UnlockExperimentalVMOptions is disabled by default - - JDK-8341554: Shenandoah: Missing heap lock when updating usage for soft ref policy - - JDK-8341562: RISC-V: Generate comments in -XX:+PrintInterpreter to link to source code - - JDK-8341658: RISC-V: Test DateFormatProviderTest.java run timeouted - - JDK-8341668: Shenandoah: assert(tail_bits < (idx_t)BitsPerWord) failed: precondition - - JDK-8341688: Aarch64: Generate comments in -XX:+PrintInterpreter to link to source code - - JDK-8341709: Change milestone to ea for JDK23.0.2 - - JDK-8341806: Gcc version detection failure on Alinux3 - - JDK-8341881: [REDO] java/nio/file/attribute/BasicFileAttributeView/CreationTime.java#tmp fails on alinux3 - - JDK-8341966: Broken annotated module may lead to an exception in javac - - JDK-8341997: Tests create files in src tree instead of scratch dir - - JDK-8342014: RISC-V: ZStoreBarrierStubC2 clobbers rflags - - JDK-8342114: Change milestone to fcs for all releases - - JDK-8342145: File libCreationTimeHelper.c compile fails on Alpine - - JDK-8342489: compiler/c2/irTests/TestVectorizationMismatchedAccess.java fails on big-endian platforms - - JDK-8342496: C2/Shenandoah: SEGV in compiled code when running jcstress - - JDK-8342612: Increase memory usage of compiler/c2/TestScalarReplacementMaxLiveNodes.java - - JDK-8342681: TestLoadBypassesNullCheck.java fails improperly specified VM option - - JDK-8342701: [PPC64] TestOSRLotsOfLocals.java crashes - - JDK-8342905: Thread.setContextClassloader from thread in FJP commonPool task no longer works after JDK-8327501 redux - - JDK-8342962: [s390x] TestOSRLotsOfLocals.java crashes - - -New in release OpenJDK 23.0.1+11 (2024-10-15): -=========================================== - - JDK-6967482: TAB-key does not work in JTables after selecting details-view in JFileChooser - - JDK-8166352: FilePane.createDetailsView() removes JTable TAB, SHIFT-TAB functionality - - JDK-8299813: java/nio/channels/DatagramChannel/Disconnect.java fails with jtreg test timeout due to lost datagram - - JDK-8307383: Enhance DTLS connections - - JDK-8311208: Improve CDS Support - - JDK-8325525: Create jtreg test case for JDK-8325203 - - JDK-8328286: Enhance HTTP client - - JDK-8328544: Improve handling of vectorization - - JDK-8328726: Better Kerberos support - - JDK-8331411: Shenandoah: Reconsider spinning duration in ShenandoahLock - - JDK-8331446: Improve deserialization support - - JDK-8332524: Instead of printing "TLSv1.3," it is showing "TLS13" - - JDK-8332644: Improve graph optimizations - - JDK-8332818: ubsan: archiveHeapLoader.cpp:70:27: runtime error: applying non-zero offset 18446744073707454464 to null pointer - - JDK-8333652: RISC-V: compiler/vectorapi/VectorGatherMaskFoldingTest.java fails when using RVV - - JDK-8333716: Shenandoah: Check for disarmed method before taking the nmethod lock - - JDK-8333887: ubsan: unsafe.cpp:247:13: runtime error: store to null pointer of type 'volatile int' - - JDK-8334041: Bump version numbers for 23.0.1 - - JDK-8334123: log the opening of Type 1 fonts - - JDK-8334239: Introduce macro for ubsan method/function exclusions - - JDK-8334653: ISO 4217 Amendment 177 Update - - JDK-8335536: Fix assertion failure in IdealGraphPrinter when append is true - - JDK-8335713: Enhance vectorization analysis - - JDK-8335775: Remove extraneous 's' in comment of rawmonitor.cpp test file - - JDK-8336301: test/jdk/java/nio/channels/AsyncCloseAndInterrupt.java leaves around a FIFO file upon test completion - - JDK-8336366: Change milestone to fcs for all releases - - JDK-8337103: The change for RDP2 CPU24_10 has corrupted line endings in the file version-numbers.conf. - - JDK-8337664: Distrust TLS server certificates issued after Oct 2024 and anchored by Entrust Root CAs - - JDK-8338696: (fs) BasicFileAttributes.creationTime() falls back to epoch if birth time is unavailable (Linux) - - JDK-8341057: Add 2 SSL.com TLS roots - - JDK-8341059: Change Entrust TLS distrust date to November 12, 2024 - -New in release OpenJDK 23.0.0+37 (2024-09-17): -=========================================== - - JEP-455: Primitive Types in Patterns, instanceof, and switch (Preview) - - JEP-466: Class-File API (Second Preview) - - JEP-467: Markdown Documentation Comments - - JEP-469: Vector API (Eighth Incubator) - - JEP-473: Stream Gatherers (Second Preview) - - JEP-471: Deprecate the Memory-Access Methods in sun.misc.Unsafe for Removal - - JEP-474: ZGC: Generational Mode by Default - - JEP-476: Module Import Declarations (Preview) - - JEP-477: Implicitly Declared Classes and Instance Main Methods (Third Preview) - - JEP-480: Structured Concurrency (Third Preview) - - JEP-481: Scoped Values (Third Preview) - - JEP-482: Flexible Constructor Bodies (Second Preview) - -New in release OpenJDK 22.0.1 (2024-07-17): -=========================================== - - JDK-8185862: AWT Assertion Failure in ::GetDIBits(hBMDC, hBM, 0, 1, 0, gpBitmapInfo, 0) 'awt_Win32GraphicsDevice.cpp', at line 185 - - JDK-8187759: Background not refreshed when painting over a transparent JFrame - - JDK-8238169: BasicDirectoryModel getDirectories and DoChangeContents.run can deadlock - - JDK-8261433: Better pkcs11 performance for libpkcs11:C_EncryptInit/libpkcs11:C_DecryptInit - - JDK-8295111: dpkg appears to have problems resolving symbolically linked native libraries - - JDK-8305072: Win32ShellFolder2.compareTo is inconsistent - - JDK-8309218: java/util/concurrent/locks/Lock/OOMEInAQS.java still times out with ZGC, Generational ZGC, and SerialGC - - JDK-8310072: JComboBox/DisabledComboBoxFontTestAuto: Enabled and disabled ComboBox does not match in these LAFs: GTK+ - - JDK-8310513: [s390x] Intrinsify recursive ObjectMonitor locking - - JDK-8312383: Log X509ExtendedKeyManager implementation class name in TLS/SSL connection - - JDK-8314794: Improve UTF8 String supports - - JDK-8315708: Enhance HTTP/2 client usage - - JDK-8316138: Add GlobalSign 2 TLS root certificates - - JDK-8316328: Test jdk/jfr/event/oldobject/TestSanityDefault.java times out for some heap sizes - - JDK-8319548: Unexpected internal name for Filler array klass causes error in VisualVM - - JDK-8319859: Better symbol storage - - JDK-8320005: Allow loading of shared objects with .a extension on AIX - - JDK-8320097: Improve Image transformations - - JDK-8320548: Improved loop handling - - JDK-8320692: Null icon returned for .exe without custom icon - - JDK-8320707: Virtual thread test updates - - JDK-8321075: RISC-V: UseSystemMemoryBarrier lacking proper OS support - - JDK-8322078: ZipSourceCache.testKeySourceMapping() test fails with The process cannot access the file because it is being used by another process - - JDK-8322122: Enhance generation of addresses - - JDK-8322484: 22-b26 Regression in J2dBench-bimg_misc-G1 (and more) on Windows-x64 and macOS-x64 - - JDK-8322503: Shenandoah: Clarify gc state usage - - JDK-8322726: C2: Unloaded signature class kills argument value - - JDK-8322943: runtime/CompressedOops/CompressedClassPointers.java fails on AIX - - JDK-8322962: Upcall stub might go undetected when freezing frames - - JDK-8323231: Improve array management - - JDK-8323390: Enhance mask blit functionality - - JDK-8323519: Add applications/ctw/modules to Hotspot tiered testing - - JDK-8323552: AbstractMemorySegmentImpl#mismatch returns -1 when comparing distinct areas of the same instance of MemorySegment - - JDK-8323670: A few client tests intermittently throw ConcurrentModificationException - - JDK-8323685: PrintSystemDictionaryAtExit has mutex rank assert - - JDK-8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin - - JDK-8323801: tag doesn't strikethrough the text - - JDK-8323918: Update the release version after forking Apr CPU24_04 - - JDK-8323919: Update the Jul CPU24_07 release date in master branch after forking Apr CPU24_04 - - JDK-8323994: gtest runner repeats test name for every single gtest assertion - - JDK-8324121: SIGFPE in PhaseIdealLoop::extract_long_range_checks - - JDK-8324243: Compilation failures in java.desktop module with gcc 14 - - JDK-8324559: Improve 2D image handling - - JDK-8324632: Update Zlib Data Compression Library to Version 1.3.1 - - JDK-8324646: Avoid Class.forName in SecureRandom constructor - - JDK-8324648: Avoid NoSuchMethodError when instantiating NativePRNG - - JDK-8324733: [macos14] Problem list tests which fail due to macOS bug described in JDK-8322653 - - JDK-8324834: Use _LARGE_FILES on AIX - - JDK-8324874: AArch64: crypto pmull based CRC32/CRC32C intrinsics clobber V8-V15 registers - - JDK-8324933: ConcurrentHashTable::statistics_calculate synchronization is expensive - - JDK-8325028: (ch) Pipe channels should lazily set socket to non-blocking mode on first use by virtual thread - - JDK-8325095: C2: bailout message broken: ResourceArea allocated string used after free - - JDK-8325179: Race in BasicDirectoryModel.validateFileCache - - JDK-8325255: jdk.internal.util.ReferencedKeySet::add using wrong test - - JDK-8325313: Header format error in TestIntrinsicBailOut after JDK-8317299 - - JDK-8325432: enhance assert message "relocation addr must be in this section" - - JDK-8325567: jspawnhelper without args fails with segfault - - JDK-8325579: Inconsistent behavior in com.sun.jndi.ldap.Connection::createSocket - - JDK-8325587: Shenandoah: ShenandoahLock should allow blocking in VM - - JDK-8325600: Better symbol storage - - JDK-8325613: CTW: Stale method cleanup requires GC after Sweeper removal - - JDK-8325621: Improve jspawnhelper version checks - - JDK-8325730: StringBuilder.toString allocation for the empty String - - JDK-8325743: test/jdk/java/nio/channels/unixdomain/SocketOptions.java enhance user name output in error case - - JDK-8325763: Revert properties: vm.opt.x.* - - JDK-8325862: set -XX:+ErrorFileToStderr when executing java in containers for some container related jtreg tests - - JDK-8326006: Allow TEST_VM_FLAGLESS to set flagless mode - - JDK-8326106: Write and clear stack trace table outside of safepoint - - JDK-8326140: src/jdk.accessibility/windows/native/libjavaaccessbridge/AccessBridgeJavaEntryPoints.cpp ReleaseStringChars might be missing in early returns - - JDK-8326201: [S390] Need to bailout cleanly if creation of stubs fails when code cache is out of space - - JDK-8326351: Update the Zlib version in open/src/java.base/share/legal/zlib.md to 1.3.1 - - JDK-8326446: The User and System of jdk.CPULoad on Apple M1 are inaccurate - - JDK-8326496: [test] checkHsErrFileContent support printing hserr in error case - - JDK-8326521: JFR: CompilerPhase event test fails on windows 32 bit - - JDK-8326529: JFR: Test for CompilerCompile events fails due to time out - - JDK-8326643: JDK server does not send a dummy change_cipher_spec record after HelloRetryRequest message - - JDK-8326891: Prefer RPATH over RUNPATH for $ORIGIN rpaths in internal JDK binaries - - JDK-8326936: RISC-V: Shenandoah GC crashes due to incorrect atomic memory operations - - JDK-8326960: GHA: RISC-V sysroot cannot be debootstrapped due to ongoing Debian t64 transition - - JDK-8326974: ODR violation in macroAssembler_aarch64.cpp - - JDK-8327040: Problemlist ActionListenerCalledTwiceTest.java test failing in macos14 - - JDK-8327059: os::Linux::print_proc_sys_info add swappiness information - - JDK-8327137: Add test for ConcurrentModificationException in BasicDirectoryModel - - JDK-8327391: Add SipHash attribution file - - JDK-8327413: Enhance compilation efficiency - - JDK-8327467: Bump version numbers for 22.0.2 - - JDK-8327468: Do not restart close if errno is EINTR [macOS/linux] - - JDK-8327501: Common ForkJoinPool prevents class unloading in some cases - - JDK-8327631: Update IANA Language Subtag Registry to Version 2024-03-07 - - JDK-8327990: [macosx-aarch64] Various tests fail with -XX:+AssertWXAtThreadSync - - JDK-8328066: WhiteBoxResizeTest failure on linux-x86: Could not reserve enough space for 2097152KB object heap - - JDK-8328075: Shenandoah: Avoid forwarding when objects don't move in full-GC - - JDK-8328165: improve assert(idx < _maxlrg) failed: oob - - JDK-8328166: Epsilon: 'EpsilonHeap::allocate_work' misuses the parameter 'size' as size in bytes - - JDK-8328168: Epsilon: Premature OOM when allocating object larger than uncommitted heap size - - JDK-8328316: Finisher cannot emit if stream is sequential and integrator returned false - - JDK-8328366: Thread.setContextClassloader from thread in FJP commonPool task no longer works after JDK-8327501 - - JDK-8328524: [x86] StringRepeat.java failure on linux-x86: Could not reserve enough space for 2097152KB object heap - - JDK-8328589: unify os::breakpoint among posix platforms - - JDK-8328604: remove on_aix() function - - JDK-8328638: Fallback option for POST-only OCSP requests - - JDK-8328702: C2: Crash during parsing because sub type check is not folded - - JDK-8328703: Illegal accesses in Java_jdk_internal_org_jline_terminal_impl_jna_linux_CLibraryImpl_ioctl0 - - JDK-8328705: GHA: Cross-compilation jobs do not require build JDK - - JDK-8328709: AIX os::get_summary_cpu_info support Power 10 - - JDK-8328744: Parallel: Parallel GC throws OOM before heap is fully expanded - - JDK-8328776: [AIX] remove checked_vmgetinfo, use vmgetinfo directly - - JDK-8328812: Update and move siphash license - - JDK-8328822: C2: "negative trip count?" assert failure in profile predicate code - - JDK-8328825: Google CAInterop test failures - - JDK-8328948: GHA: Restoring sysroot from cache skips the build after JDK-8326960 - - JDK-8328953: JEditorPane.read throws ChangedCharSetException - - JDK-8328988: [macos14] Problem list LightweightEventTest.java which fails due to macOS bug described in JDK-8322653 - - JDK-8328989: Incorrect milestone for release JDK 22.0.2 - - JDK-8328997: Remove unnecessary template parameter lists in GrowableArray - - JDK-8329013: StackOverflowError when starting Apache Tomcat with signed jar - - JDK-8329109: Threads::print_on() tries to print CPU time for terminated GC threads - - JDK-8329134: Reconsider TLAB zapping - - JDK-8329163: C2: possible overflow in PhaseIdealLoop::extract_long_range_checks() - - JDK-8329213: Better validation for com.sun.security.ocsp.useget option - - JDK-8329223: Parallel: Parallel GC resizes heap even if -Xms = -Xmx - - JDK-8329510: Update ProblemList for JFileChooser/8194044/FileSystemRootTest.java - - JDK-8329528: G1 does not update TAMS correctly when dropping retained regions during Concurrent Start pause - - JDK-8329545: [s390x] Fix garbage value being passed in Argument Register - - JDK-8329570: G1: Excessive is_obj_dead_cond calls in verification - - JDK-8329605: hs errfile generic events - move memory protections and nmethod flushes to separate sections - - JDK-8329656: assertion failed in MAP_ARCHIVE_MMAP_FAILURE path: Invalid immediate -5 0 - - JDK-8329663: hs_err file event log entry for thread adding/removing should print current thread - - JDK-8329823: RISC-V: Need to sync CPU features with related JVM flags - - JDK-8329840: Fix ZPhysicalMemorySegment::_end type - - JDK-8329850: [AIX] Allow loading of different members of same shared library archive - - JDK-8329862: libjli GetApplicationHome cleanups and enhance jli tracing - - JDK-8329958: Windows x86 build fails: downcallLinker.cpp(36) redefinition - - JDK-8329961: Buffer overflow in os::Linux::kernel_version - - JDK-8330011: [s390x] update block-comments to make code consistent - - JDK-8330027: Identity hashes of archived objects must be based on a reproducible random seed - - JDK-8330094: RISC-V: Save and restore FRM in the call stub - - JDK-8330156: RISC-V: Range check auipc + signed 12 imm instruction - - JDK-8330232: Change milestone to fcs for all releases - - JDK-8330242: RISC-V: Simplify and remove CORRECT_COMPILER_ATOMIC_SUPPORT in atomic_linux_riscv.hpp - - JDK-8330275: Crash in XMark::follow_array - - JDK-8330464: hserr generic events - add entry for the before_exit calls - - JDK-8330523: Reduce runtime and improve efficiency of KeepAliveTest - - JDK-8330524: Linux ppc64le compile warning with clang in os_linux_ppc.cpp - - JDK-8330576: ZYoungCompactionLimit should have range check - - JDK-8330615: avoid signed integer overflows in zip_util.c readCen / hashN - - JDK-8330748: ByteArrayOutputStream.writeTo(OutputStream) pins carrier - - JDK-8330814: Cleanups for KeepAliveCache tests - - JDK-8330815: Use pattern matching for instanceof in KeepAliveCache - - JDK-8331031: unify os::dont_yield and os::naked_yield across Posix platforms - - JDK-8331164: createJMHBundle.sh download jars fail when url needed to be redirected - - JDK-8331167: UBSan enabled build fails in adlc on macOS - - JDK-8331298: avoid alignment checks in UBSAN enabled build - - JDK-8331331: :tier1 target explanation in doc/testing.md is incorrect - - JDK-8331344: No compiler replay file with CompilerCommand MemLimit - - JDK-8331352: error: template-id not allowed for constructor/destructor in C++20 - - JDK-8331466: Problemlist serviceability/dcmd/gc/RunFinalizationTest.java on generic-all - - JDK-8331589: The DEFAULT_PROMOTED_VERSION_PRE not correct for RDP2 CPU24_07 - - JDK-8331714: Make OopMapCache installation lock-free - - JDK-8331746: Create a test to verify that the cmm id is not ignored - - JDK-8331885: C2: meet between unloaded and speculative types is not symmetric - - JDK-8331894: [jdk22] compiler/print/CompileCommandMemLimit.java fails after backporting JDK-8325095 - - JDK-8331942: On Linux aarch64, CDS archives should be using 64K alignment by default - - JDK-8332253: Linux arm32 build fails after 8292591 - - JDK-8332490: JMH org.openjdk.bench.java.util.zip.InflaterInputStreams.inflaterInputStreamRead OOM + - 404: Generational Shenandoah (Experimental) + - 450: Compact Object Headers (Experimental) + - 472: Prepare to Restrict the Use of JNI + - 475: Late Barrier Expansion for G1 + - 478: Key Derivation Function API (Preview) + - 479: Remove the Windows 32-bit x86 Port + - 483: Ahead-of-Time Class Loading & Linking + - 484: Class-File API + - 485: Stream Gatherers + - 486: Permanently Disable the Security Manager + - 487: Scoped Values (Fourth Preview) + - 488: Primitive Types in Patterns, instanceof, and switch (Second Preview) + - 489: Vector API (Ninth Incubator) + - 490: ZGC: Remove the Non-Generational Mode + - 491: Synchronize Virtual Threads without Pinning + - 492: Flexible Constructor Bodies (Third Preview) + - 493: Linking Run-Time Images without JMODs + - 494: Module Import Declarations (Second Preview) + - 495: Simple Source Files and Instance Main Methods (Fourth Preview) + - 496: Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism + - 497: Quantum-Resistant Module-Lattice-Based Digital Signature Algorithm + - 498: Warn upon Use of Memory-Access Methods in sun.misc.Unsafe + - 499: Structured Concurrency (Fourth Preview) + - 501: Deprecate the 32-bit x86 Port for Removal From 3cf747910cce5d49e67182d6ba04fa6d5919230e Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Sun, 2 Feb 2025 12:56:50 +0100 Subject: [PATCH 57/86] Fixed check by javap on classfiles symbols -l without -c no longer prints necessary info --- java-latest-openjdk-portable.spec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index b256b95..3eba57e 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1640,14 +1640,14 @@ grep 'JavaCallWrapper::JavaCallWrapper' gdb.out $JAVA_HOME/bin/jar -tf $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe' # Check class files include useful debugging information -$JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from" -$JAVA_HOME/bin/javap -l java.lang.Object | grep LineNumberTable -$JAVA_HOME/bin/javap -l java.lang.Object | grep LocalVariableTable +$JAVA_HOME/bin/javap -l -c java.lang.Object | grep "Compiled from" +$JAVA_HOME/bin/javap -l -c java.lang.Object | grep LineNumberTable +$JAVA_HOME/bin/javap -l -c java.lang.Object | grep LocalVariableTable # Check generated class files include useful debugging information -$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep "Compiled from" -$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LineNumberTable -$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable +$JAVA_HOME/bin/javap -l -c java.nio.ByteBuffer | grep "Compiled from" +$JAVA_HOME/bin/javap -l -c java.nio.ByteBuffer | grep LineNumberTable +$JAVA_HOME/bin/javap -l -c java.nio.ByteBuffer | grep LocalVariableTable # build cycles check done From 840cb43e58d95bcf925b1f66cfb7bf5d40d7b37e Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 17 Feb 2025 15:52:50 +0100 Subject: [PATCH 58/86] Bumped to 24+36 and built by itself --- .gitignore | 1 + generate_source_tarball.sh | 2 +- java-latest-openjdk-portable.spec | 6 +++--- sources | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f34dd29..58cebdb 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ /openjdk-jdk-23.0.1+11.tar.xz /openjdk-23.0.2+7.tar.xz /openjdk-24+34-ea.tar.xz +/openjdk-24+36.tar.xz diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index fc15c24..69b9dc3 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -36,7 +36,7 @@ # # PROJECT_NAME=openjdk # REPO_NAME=jdk24u -# VERSION=jdk-24+34 +# VERSION=jdk-24+36 # # or to e.g., prepare systemtap, icedtea7's jstack and other tapsets: # diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 3eba57e..5b4be58 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -342,7 +342,7 @@ # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, # and this it is better to change it here, on single place -%global buildjdkver 23 +%global buildjdkver 24 # We don't add any LTS designator for STS packages (Fedora and EPEL). # We need to explicitly exclude EPEL as it would have the %%{rhel} macro defined. %if 0%{?rhel} && !0%{?epel} @@ -401,7 +401,7 @@ %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 34 +%global buildver 36 %global rpmrelease %(echo "%autorelease" | sed 's;%{?dist};;') #%%global tagsuffix %%{nil} # 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 @@ -421,7 +421,7 @@ # Release will be (where N is usually a number starting at 1): # - 0.N%%{?extraver}%%{?dist} for EA releases, # - N%%{?extraver}{?dist} for GA releases -%global is_ga 0 +%global is_ga 1 %if %{is_ga} %global build_type GA %global ea_designator "" diff --git a/sources b/sources index 62218d8..2c4a914 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-24+34-ea.tar.xz) = caaa8e0e6ca515a9fc18ddbcda0fd1e2a4863aee49b2a5dea77a93346112ff5c9147d57088179866fe6b3905dea3a06c225811118edb395746a478a9dd2d0039 +SHA512 (openjdk-24+36.tar.xz) = cfa05667adc8484818a062e2857c7733e91060efffbfab714f391414ea943c09cd4311e055fff8c4b8862103c392c5236946cba77996c0ba4b4137bc5275557e From fee42c2479df15cf012235d06884342259a5af6a Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Tue, 25 Mar 2025 11:15:02 +0100 Subject: [PATCH 59/86] Add patches for linking from run-time image (RPM support) --- ...-Add-support-for-extra-jlink-options.patch | 65 ++ ...r-hash-sum-overrides-when-linking-fr.patch | 830 ++++++++++++++++++ java-latest-openjdk-portable.spec | 9 +- 3 files changed, 902 insertions(+), 2 deletions(-) create mode 100644 0001-8352692-Add-support-for-extra-jlink-options.patch create mode 100644 0002-8352689-Allow-for-hash-sum-overrides-when-linking-fr.patch diff --git a/0001-8352692-Add-support-for-extra-jlink-options.patch b/0001-8352692-Add-support-for-extra-jlink-options.patch new file mode 100644 index 0000000..6b20564 --- /dev/null +++ b/0001-8352692-Add-support-for-extra-jlink-options.patch @@ -0,0 +1,65 @@ +From bc0ebeddc31949a5d84a9494e8adccc2bade357e Mon Sep 17 00:00:00 2001 +From: Severin Gehwolf +Date: Wed, 26 Mar 2025 10:53:07 +0000 +Subject: [PATCH 1/2] 8352692: Add support for extra jlink options + +Reviewed-by: ihse, erikj +--- + make/Images.gmk | 4 ++++ + make/autoconf/jdk-options.m4 | 12 ++++++++++++ + make/autoconf/spec.gmk.template | 1 + + 3 files changed, 17 insertions(+) + +diff --git a/make/Images.gmk b/make/Images.gmk +index c5d0ef11b5d..cbaf85f7942 100644 +--- a/make/Images.gmk ++++ b/make/Images.gmk +@@ -101,6 +101,10 @@ ifeq ($(JLINK_PRODUCE_LINKABLE_RUNTIME), true) + JLINK_JDK_EXTRA_OPTS += --generate-linkable-runtime + endif + ++ifneq ($(JLINK_USER_EXTRA_FLAGS), ) ++ JLINK_JDK_EXTRA_OPTS += $(JLINK_USER_EXTRA_FLAGS) ++endif ++ + $(eval $(call SetupExecute, jlink_jdk, \ + WARN := Creating jdk image, \ + DEPS := $(JDK_JMODS) $(BASE_RELEASE_FILE) \ +diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 +index 61638ce5a2c..b6fce9cc323 100644 +--- a/make/autoconf/jdk-options.m4 ++++ b/make/autoconf/jdk-options.m4 +@@ -628,6 +628,18 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS], + DEFAULT_DESC: [enabled by default unless --enable-linkable-runtime is set], + CHECKING_MSG: [if packaged modules are kept]) + AC_SUBST(JLINK_KEEP_PACKAGED_MODULES) ++ ++ ################################################################################ ++ # ++ # Extra jlink options to be (optionally) passed to the JDK build ++ # ++ UTIL_ARG_WITH(NAME: extra-jlink-flags, TYPE: string, ++ DEFAULT: [], ++ DESC: [extra flags to be passed to jlink during the build], ++ OPTIONAL: true) ++ ++ JLINK_USER_EXTRA_FLAGS="$EXTRA_JLINK_FLAGS" ++ AC_SUBST(JLINK_USER_EXTRA_FLAGS) + ]) + + ################################################################################ +diff --git a/make/autoconf/spec.gmk.template b/make/autoconf/spec.gmk.template +index 18770c6d360..63d5ce05147 100644 +--- a/make/autoconf/spec.gmk.template ++++ b/make/autoconf/spec.gmk.template +@@ -710,6 +710,7 @@ NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) $(JAVADOC_MAIN_CLASS) + JMOD_COMPRESS := @JMOD_COMPRESS@ + JLINK_KEEP_PACKAGED_MODULES := @JLINK_KEEP_PACKAGED_MODULES@ + JLINK_PRODUCE_LINKABLE_RUNTIME := @JLINK_PRODUCE_LINKABLE_RUNTIME@ ++JLINK_USER_EXTRA_FLAGS := @JLINK_USER_EXTRA_FLAGS@ + + RCFLAGS := @RCFLAGS@ + +-- +2.49.0 + diff --git a/0002-8352689-Allow-for-hash-sum-overrides-when-linking-fr.patch b/0002-8352689-Allow-for-hash-sum-overrides-when-linking-fr.patch new file mode 100644 index 0000000..0cc63db --- /dev/null +++ b/0002-8352689-Allow-for-hash-sum-overrides-when-linking-fr.patch @@ -0,0 +1,830 @@ +From 2a5c9b874aa86b244dec041bed05ca3d1f66ccaa Mon Sep 17 00:00:00 2001 +From: Severin Gehwolf +Date: Thu, 27 Mar 2025 14:50:54 +0100 +Subject: [PATCH 2/2] 8352689: Allow for hash sum overrides when linking from + the run-time image + +--- + .../jdk/tools/jlink/internal/JRTArchive.java | 34 +++++- + .../jdk/tools/jlink/internal/Jlink.java | 12 +- + .../jdk/tools/jlink/internal/JlinkTask.java | 72 +++++++++++- + .../jlink/internal/LinkableRuntimeImage.java | 17 ++- + .../tools/jlink/resources/jlink.properties | 6 + + test/jdk/tools/jlink/IntegrationTest.java | 4 +- + .../jlink/runtimeImage/AddOptionsTest.java | 1 - + .../BasicJlinkMissingJavaBase.java | 1 - + .../jlink/runtimeImage/BasicJlinkTest.java | 1 - + .../runtimeImage/CustomModuleJlinkTest.java | 1 - + .../runtimeImage/GenerateJLIClassesTest.java | 1 - + .../runtimeImage/JavaSEReproducibleTest.java | 1 - + .../KeepPackagedModulesFailTest.java | 1 - + .../runtimeImage/ModifiedFilesExitTest.java | 1 - + .../ModifiedFilesWarningTest.java | 1 - + .../ModifiedFilesWithShaOverrideBase.java | 111 ++++++++++++++++++ + .../ModifiedFilesWithShaOverrideFileTest.java | 77 ++++++++++++ + .../ModifiedFilesWithShaOverrideTest.java | 65 ++++++++++ + .../jlink/runtimeImage/MultiHopTest.java | 1 - + ...PackagedModulesVsRuntimeImageLinkTest.java | 1 - + .../PatchedJDKModuleJlinkTest.java | 1 - + .../jlink/runtimeImage/SystemModulesTest.java | 1 - + .../runtimeImage/SystemModulesTest2.java | 1 - + 23 files changed, 376 insertions(+), 36 deletions(-) + create mode 100644 test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideBase.java + create mode 100644 test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideFileTest.java + create mode 100644 test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideTest.java + +diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java +index df7d35ac777..823d03c50fe 100644 +--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java ++++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2024, Red Hat, Inc. ++ * Copyright (c) 2024, 2025, Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -41,10 +41,12 @@ + import java.util.ArrayList; + import java.util.Arrays; + import java.util.Collections; ++import java.util.HashSet; + import java.util.HexFormat; + import java.util.List; + import java.util.Map; + import java.util.Objects; ++import java.util.Set; + import java.util.function.Function; + import java.util.function.Predicate; + import java.util.stream.Collectors; +@@ -74,6 +76,7 @@ public class JRTArchive implements Archive { + // Maps a module resource path to the corresponding diff to packaged + // modules for that resource (if any) + private final Map resDiff; ++ private final Map> altHashSums; + private final boolean errorOnModifiedFile; + private final TaskHelper taskHelper; + +@@ -86,11 +89,15 @@ public class JRTArchive implements Archive { + * install aborts the link. + * @param perModDiff The lib/modules (a.k.a jimage) diff for this module, + * possibly an empty list if there are no differences. ++ * @param altHashSums A map of alternative hash sums for files in ++ * a module, possibly empty. ++ * @param taskHelper The task helper reference. + */ + JRTArchive(String module, + Path path, + boolean errorOnModifiedFile, + List perModDiff, ++ Map> altHashSums, + TaskHelper taskHelper) { + this.module = module; + this.path = path; +@@ -105,6 +112,7 @@ public class JRTArchive implements Archive { + this.resDiff = Objects.requireNonNull(perModDiff).stream() + .collect(Collectors.toMap(ResourceDiff::getName, Function.identity())); + this.taskHelper = taskHelper; ++ this.altHashSums = altHashSums; + } + + @Override +@@ -217,7 +225,21 @@ private void addNonClassResources() { + + // Read from the base JDK image. + Path path = BASE.resolve(m.resPath); +- if (shaSumMismatch(path, m.hashOrTarget, m.symlink)) { ++ // Allow for additional hash sums so as to support ++ // file modifications done after jlink has run at build ++ // time. For example for Windows builds done with ++ // --with-external-symbols-in-bundles=public or ++ // distribution builds, where some post-processing happens ++ // on produced binaries and libraries invalidating the ++ // hash sum included in the jdk.jlink module for those ++ // files at jlink-time ++ Set shaSums = new HashSet<>(); ++ shaSums.add(m.hashOrTarget); ++ Set extra = altHashSums.get(m.resPath); ++ if (extra != null) { ++ shaSums.addAll(extra); ++ } ++ if (shaSumMismatch(path, shaSums, m.symlink)) { + if (errorOnModifiedFile) { + String msg = taskHelper.getMessage("err.runtime.link.modified.file", path.toString()); + IOException cause = new IOException(msg); +@@ -239,14 +261,12 @@ private void addNonClassResources() { + } + } + +- static boolean shaSumMismatch(Path res, String expectedSha, boolean isSymlink) { ++ static boolean shaSumMismatch(Path res, Set expectedShas, boolean isSymlink) { + if (isSymlink) { + return false; + } + // handle non-symlink resources + try { +- HexFormat format = HexFormat.of(); +- byte[] expected = format.parseHex(expectedSha); + MessageDigest digest = MessageDigest.getInstance("SHA-512"); + try (InputStream is = Files.newInputStream(res)) { + byte[] buf = new byte[1024]; +@@ -256,7 +276,9 @@ static boolean shaSumMismatch(Path res, String expectedSha, boolean isSymlink) { + } + } + byte[] actual = digest.digest(); +- return !MessageDigest.isEqual(expected, actual); ++ // Convert actual to string ++ String strActual = HexFormat.of().formatHex(actual); ++ return !expectedShas.contains(strActual); + } catch (Exception e) { + throw new AssertionError("SHA-512 sum check failed!", e); + } +diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java +index 99029651bfb..12e26bd4aef 100644 +--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java ++++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2025, 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 +@@ -148,7 +148,7 @@ public static final class JlinkConfiguration { + private final Set modules; + private final ModuleFinder finder; + private final boolean linkFromRuntimeImage; +- private final boolean ignoreModifiedRuntime; ++ private final LinkableRuntimeImage.Config runtimeImageConfig; + private final boolean generateRuntimeImage; + + /** +@@ -162,13 +162,13 @@ public JlinkConfiguration(Path output, + Set modules, + ModuleFinder finder, + boolean linkFromRuntimeImage, +- boolean ignoreModifiedRuntime, ++ LinkableRuntimeImage.Config runtimeImageConfig, + boolean generateRuntimeImage) { + this.output = output; + this.modules = Objects.requireNonNull(modules); + this.finder = finder; + this.linkFromRuntimeImage = linkFromRuntimeImage; +- this.ignoreModifiedRuntime = ignoreModifiedRuntime; ++ this.runtimeImageConfig = runtimeImageConfig; + this.generateRuntimeImage = generateRuntimeImage; + } + +@@ -198,8 +198,8 @@ public boolean linkFromRuntimeImage() { + return linkFromRuntimeImage; + } + +- public boolean ignoreModifiedRuntime() { +- return ignoreModifiedRuntime; ++ public LinkableRuntimeImage.Config runtimeImageConfig() { ++ return runtimeImageConfig; + } + + public boolean isGenerateRuntimeImage() { +diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java +index 928b9a47934..bf63f7e6795 100644 +--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java ++++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2025, 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 +@@ -191,7 +191,43 @@ public class JlinkTask { + // be used for linking from the run-time image. + new Option(false, (task, opt, arg) -> { + task.options.generateLinkableRuntime = true; +- }, true, "--generate-linkable-runtime") ++ }, true, "--generate-linkable-runtime"), ++ new Option(true, (task, opt, arg) -> { ++ if (arg.startsWith("@")) { ++ // Read overrides from file ++ if (!task.options.shaOverrides.isEmpty()) { ++ // Only allow a single @file value ++ throw taskHelper.newBadArgs("err.sha.overrides.multiple"); ++ } ++ // Ignore non-existing sha overrides file. ++ // ++ // This is to allow for custom builds needing to optionally ++ // support run-time image links on (possibly) modified ++ // binaries/debuginfo files done after the JDK build ++ // ++ // Allow for JAVA_HOME relative paths for the file, by replacing ++ // the ${java.home} token in the file name ++ String fileName = arg.substring(1); ++ if (fileName.startsWith("${java.home}")) { ++ String javaHome = System.getProperty("java.home"); ++ fileName = javaHome + fileName.substring(12 /* ${java.home}.length() */); ++ } ++ Path file = Paths.get(fileName); ++ if (Files.exists(file)) { ++ try { ++ Files.readAllLines(file).stream() ++ .forEach(task.options.shaOverrides::add); ++ } catch (IOException e) { ++ throw taskHelper.newBadArgs("err.sha.overrides.freaderr", file.toString()); ++ } ++ } ++ } else { ++ // Allow multiple values, separated by comma in addition to ++ // multiple times the same option. ++ Arrays.asList(arg.split(",")).stream() ++ .forEach(task.options.shaOverrides::add); ++ } ++ }, true, "--sha-overrides"), + }; + + +@@ -235,6 +271,7 @@ static class OptionsValues { + boolean suggestProviders = false; + boolean ignoreModifiedRuntime = false; + boolean generateLinkableRuntime = false; ++ final Set shaOverrides = new HashSet<>(); + } + + public static final String OPTIONS_RESOURCE = "jdk/tools/jlink/internal/options"; +@@ -459,14 +496,41 @@ private JlinkConfiguration initJlinkConfig() throws BadArgs { + throw taskHelper.newBadArgs("err.runtime.link.packaged.mods"); + } + ++ LinkableRuntimeImage.Config linkableRuntimeConfig = new LinkableRuntimeImage.Config( ++ options.ignoreModifiedRuntime, ++ isLinkFromRuntime ? buildShaSumMap(taskHelper, options.shaOverrides) : null); + return new JlinkConfiguration(options.output, + roots, + finder, + isLinkFromRuntime, +- options.ignoreModifiedRuntime, ++ linkableRuntimeConfig, + options.generateLinkableRuntime); + } + ++ private Map>> buildShaSumMap(TaskHelper taskHelper, ++ Set shaOverrides) throws BadArgs { ++ Map>> moduleToFiles = new HashMap<>(); ++ for (String t: shaOverrides) { ++ String trimmed = t.trim(); ++ if (trimmed.startsWith("#")) { ++ // skip comment lines ++ continue; ++ } ++ String[] tokens = trimmed.split("\\|"); ++ if (tokens.length != 3) { ++ throw taskHelper.newBadArgs("err.sha.overrides.bad.format", t); ++ } ++ // t is a '|'-separated item of (in that order): ++ // ++ // ++ // ++ Map> perModuleMap = moduleToFiles.computeIfAbsent(tokens[0], k -> new HashMap<>()); ++ Set shaSumsPerFile = perModuleMap.computeIfAbsent(tokens[1], k -> new HashSet<>()); ++ shaSumsPerFile.add(tokens[2]); ++ } ++ return moduleToFiles; ++ } ++ + /* + * Creates a ModuleFinder for the given module paths. + */ +@@ -788,7 +852,7 @@ private static Archive newArchive(String module, + taskHelper.getMessage("err.not.a.module.directory", path)); + } + } else if (config.linkFromRuntimeImage()) { +- return LinkableRuntimeImage.newArchive(module, path, config.ignoreModifiedRuntime(), taskHelper); ++ return LinkableRuntimeImage.newArchive(module, path, config.runtimeImageConfig(), taskHelper); + } else { + throw new IllegalArgumentException( + taskHelper.getMessage("err.not.modular.format", module, path)); +diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java +index 935af4585ad..a9b146d55a2 100644 +--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java ++++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2024, Red Hat, Inc. ++ * Copyright (c) 2024, 2025, Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -29,6 +29,8 @@ + import java.io.InputStream; + import java.nio.file.Path; + import java.util.List; ++import java.util.Map; ++import java.util.Set; + + import jdk.tools.jlink.internal.runtimelink.ResourceDiff; + +@@ -67,7 +69,7 @@ private static InputStream getDiffInputStream(String module) throws IOException + + public static Archive newArchive(String module, + Path path, +- boolean ignoreModifiedRuntime, ++ Config config, + TaskHelper taskHelper) { + assert isLinkableRuntime(); + // Here we retrieve the per module difference file, which is +@@ -81,8 +83,15 @@ public static Archive newArchive(String module, + throw new AssertionError("Failure to retrieve resource diff for " + + "module " + module, e); + } +- return new JRTArchive(module, path, !ignoreModifiedRuntime, perModuleDiff, taskHelper); ++ return new JRTArchive(module, ++ path, ++ !config.ignoreModifiedRuntime, ++ perModuleDiff, ++ // Empty map if no alternative sha sums ++ config.altHashSums.computeIfAbsent(module, k -> Map.of()), ++ taskHelper); + } + +- ++ static record Config(boolean ignoreModifiedRuntime, ++ Map>> altHashSums) {} + } +diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties +index a491b758ea0..59f5860d131 100644 +--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties ++++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties +@@ -127,6 +127,12 @@ err.runtime.link.packaged.mods=This JDK has no packaged modules.\ + err.runtime.link.modified.file={0} has been modified + err.runtime.link.patched.module=jlink does not support linking from the run-time image\ + \ when running on a patched runtime with --patch-module ++ ++# Linking from the run-time image, SHA sum handling ++err.sha.overrides.multiple=option --sha-overrides does not allow @file and non-file combinations ++err.sha.overrides.freaderr=Error reading file ''{0}'' passed with option --sha-overrides ++err.sha.overrides.bad.format=Bad format in --sha-overrides. Token was {0}. Expected || ++ + err.no.module.path=--module-path option must be specified with --add-modules ALL-MODULE-PATH + err.empty.module.path=No module found in module path ''{0}'' with --add-modules ALL-MODULE-PATH + err.limit.modules=--limit-modules not allowed with --add-modules ALL-MODULE-PATH +diff --git a/test/jdk/tools/jlink/IntegrationTest.java b/test/jdk/tools/jlink/IntegrationTest.java +index 5a8d0bce15a..818c31b9eef 100644 +--- a/test/jdk/tools/jlink/IntegrationTest.java ++++ b/test/jdk/tools/jlink/IntegrationTest.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2025, 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 +@@ -159,7 +159,7 @@ private static void test() throws Exception { + mods, + JlinkTask.limitFinder(JlinkTask.newModuleFinder(modulePaths), limits, mods), + linkFromRuntime, +- false /* ignore modified runtime */, ++ null /* run-time image link config */, + false /* generate run-time image */); + + List lst = new ArrayList<>(); +diff --git a/test/jdk/tools/jlink/runtimeImage/AddOptionsTest.java b/test/jdk/tools/jlink/runtimeImage/AddOptionsTest.java +index 827f7da624d..4f25bc3ee66 100644 +--- a/test/jdk/tools/jlink/runtimeImage/AddOptionsTest.java ++++ b/test/jdk/tools/jlink/runtimeImage/AddOptionsTest.java +@@ -33,7 +33,6 @@ + * @summary Test --add-options jlink plugin when linking from the run-time image + * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) + * @library ../../lib /test/lib +- * @enablePreview + * @modules java.base/jdk.internal.jimage + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin +diff --git a/test/jdk/tools/jlink/runtimeImage/BasicJlinkMissingJavaBase.java b/test/jdk/tools/jlink/runtimeImage/BasicJlinkMissingJavaBase.java +index ebf5b060665..cb28f6f2b86 100644 +--- a/test/jdk/tools/jlink/runtimeImage/BasicJlinkMissingJavaBase.java ++++ b/test/jdk/tools/jlink/runtimeImage/BasicJlinkMissingJavaBase.java +@@ -34,7 +34,6 @@ + * but java.xml.jmod present. It should link from the run-time image without errors. + * @requires (jlink.packagedModules & vm.compMode != "Xcomp" & os.maxMemory >= 2g) + * @library ../../lib /test/lib +- * @enablePreview + * @modules java.base/jdk.internal.jimage + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin +diff --git a/test/jdk/tools/jlink/runtimeImage/BasicJlinkTest.java b/test/jdk/tools/jlink/runtimeImage/BasicJlinkTest.java +index 8cbd74e5ed1..f82c16c036d 100644 +--- a/test/jdk/tools/jlink/runtimeImage/BasicJlinkTest.java ++++ b/test/jdk/tools/jlink/runtimeImage/BasicJlinkTest.java +@@ -32,7 +32,6 @@ + * @summary Test basic linking from the run-time image + * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) + * @library ../../lib /test/lib +- * @enablePreview + * @modules java.base/jdk.internal.jimage + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin +diff --git a/test/jdk/tools/jlink/runtimeImage/CustomModuleJlinkTest.java b/test/jdk/tools/jlink/runtimeImage/CustomModuleJlinkTest.java +index d6c237a173b..15cd88ae9fc 100644 +--- a/test/jdk/tools/jlink/runtimeImage/CustomModuleJlinkTest.java ++++ b/test/jdk/tools/jlink/runtimeImage/CustomModuleJlinkTest.java +@@ -32,7 +32,6 @@ + * @summary Test jmod-less jlink with a custom module + * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) + * @library ../../lib /test/lib +- * @enablePreview + * @modules java.base/jdk.internal.jimage + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin +diff --git a/test/jdk/tools/jlink/runtimeImage/GenerateJLIClassesTest.java b/test/jdk/tools/jlink/runtimeImage/GenerateJLIClassesTest.java +index e59d18bd6f0..2a45d920f2d 100644 +--- a/test/jdk/tools/jlink/runtimeImage/GenerateJLIClassesTest.java ++++ b/test/jdk/tools/jlink/runtimeImage/GenerateJLIClassesTest.java +@@ -32,7 +32,6 @@ + * @summary Verify JLI class generation in run-time image link mode + * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) + * @library ../../lib /test/lib +- * @enablePreview + * @modules java.base/jdk.internal.jimage + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin +diff --git a/test/jdk/tools/jlink/runtimeImage/JavaSEReproducibleTest.java b/test/jdk/tools/jlink/runtimeImage/JavaSEReproducibleTest.java +index a376d075ecd..b2137b7b94d 100644 +--- a/test/jdk/tools/jlink/runtimeImage/JavaSEReproducibleTest.java ++++ b/test/jdk/tools/jlink/runtimeImage/JavaSEReproducibleTest.java +@@ -33,7 +33,6 @@ + * image. + * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) + * @library ../../lib /test/lib +- * @enablePreview + * @modules java.base/jdk.internal.jimage + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin +diff --git a/test/jdk/tools/jlink/runtimeImage/KeepPackagedModulesFailTest.java b/test/jdk/tools/jlink/runtimeImage/KeepPackagedModulesFailTest.java +index 6fdaf5a9824..2b13043b1db 100644 +--- a/test/jdk/tools/jlink/runtimeImage/KeepPackagedModulesFailTest.java ++++ b/test/jdk/tools/jlink/runtimeImage/KeepPackagedModulesFailTest.java +@@ -34,7 +34,6 @@ + * --keep-packaged-modules fails as expected. + * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) + * @library ../../lib /test/lib +- * @enablePreview + * @modules java.base/jdk.internal.jimage + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin +diff --git a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesExitTest.java b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesExitTest.java +index 777ce302ce7..b318418de16 100644 +--- a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesExitTest.java ++++ b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesExitTest.java +@@ -33,7 +33,6 @@ + * and files have been modified + * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) + * @library ../../lib /test/lib +- * @enablePreview + * @modules java.base/jdk.internal.jimage + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin +diff --git a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWarningTest.java b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWarningTest.java +index c871024f37c..a309f5cbbc5 100644 +--- a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWarningTest.java ++++ b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWarningTest.java +@@ -32,7 +32,6 @@ + * image and files have been modified + * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) + * @library ../../lib /test/lib +- * @enablePreview + * @modules java.base/jdk.internal.jimage + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin +diff --git a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideBase.java b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideBase.java +new file mode 100644 +index 00000000000..529fbda2ef9 +--- /dev/null ++++ b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideBase.java +@@ -0,0 +1,111 @@ ++/* ++ * Copyright (c) 2025, Red Hat, Inc. ++ * 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. ++ * ++ * 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. ++ */ ++ ++import java.io.IOException; ++import java.io.InputStream; ++import java.nio.file.Files; ++import java.nio.file.Path; ++import java.security.MessageDigest; ++import java.util.ArrayList; ++import java.util.HexFormat; ++import java.util.List; ++ ++import jdk.test.lib.process.OutputAnalyzer; ++import jtreg.SkippedException; ++import tests.Helper; ++ ++/* ++ * Base class for sha overrides tests ++ */ ++public abstract class ModifiedFilesWithShaOverrideBase extends ModifiedFilesTest { ++ ++ protected static final String SHA_OVERRIDE_FLAG = "--sha-overrides"; ++ ++ @Override ++ protected Path modifyFileInImage(Path jmodLessImg) { ++ try { ++ Path libJVM = jmodLessImg.resolve("lib").resolve("server").resolve(System.mapLibraryName("jvm")); ++ String shaBefore = buildSHA512(libJVM); ++ List objcopy = new ArrayList<>(); ++ objcopy.add("objcopy"); ++ // The OpenJDK build doesn't strip all symbols by default. In order ++ // to get a different libjvm.so file, we strip everything. The ++ // expectation is for the sha to be different before and after the ++ // stripping of the file. ++ objcopy.add("--strip-all"); ++ objcopy.add(libJVM.toString()); ++ ProcessBuilder builder = new ProcessBuilder(objcopy); ++ Process p = builder.start(); ++ int returnVal = p.waitFor(); ++ if (returnVal != 0) { ++ throw new SkippedException("Stripping of libjvm failed. Is objcopy installed?"); ++ } ++ String shaAfter = buildSHA512(libJVM); ++ if (shaBefore.equals(shaAfter)) { ++ throw new SkippedException("Binary file would be the same before after - test skipped"); ++ } ++ return libJVM; ++ } catch (IOException | InterruptedException e) { ++ throw new SkippedException("Stripping of libjvm failed: " + e.getMessage()); ++ } ++ } ++ ++ @Override ++ void testAndAssert(Path modifiedFile, Helper helper, Path initialImage) throws Exception { ++ String extraJlinkOption = getShaOverrideOption(modifiedFile, initialImage); ++ CapturingHandler handler = new CapturingHandler(); ++ jlinkUsingImage(new JlinkSpecBuilder() ++ .helper(helper) ++ .imagePath(initialImage) ++ .name(getTargetName()) ++ .addModule("java.base") ++ .validatingModule("java.base") ++ .extraJlinkOpt(extraJlinkOption) // allow for the modified sha ++ .build(), handler); ++ OutputAnalyzer out = handler.analyzer(); ++ // verify we don't get a warning message for the modified file ++ out.stdoutShouldNotMatch(".* has been modified"); ++ out.stdoutShouldNotContain("java.lang.IllegalArgumentException"); ++ out.stdoutShouldNotContain("IOException"); ++ } ++ ++ public abstract String getTargetName(); ++ public abstract String getShaOverrideOption(Path modifiedFile, Path initialImage); ++ ++ protected String buildSHA512(Path modifiedFile) { ++ try { ++ MessageDigest digest = MessageDigest.getInstance("SHA-512"); ++ try (InputStream is = Files.newInputStream(modifiedFile)) { ++ byte[] buf = new byte[1024]; ++ int readBytes = -1; ++ while ((readBytes = is.read(buf)) != -1) { ++ digest.update(buf, 0, readBytes); ++ } ++ } ++ byte[] actual = digest.digest(); ++ return HexFormat.of().formatHex(actual); ++ } catch (Exception e) { ++ throw new AssertionError("SHA-512 sum generation failed"); ++ } ++ } ++} +diff --git a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideFileTest.java b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideFileTest.java +new file mode 100644 +index 00000000000..d20eecd40e7 +--- /dev/null ++++ b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideFileTest.java +@@ -0,0 +1,77 @@ ++/* ++ * Copyright (c) 2025, Red Hat, Inc. ++ * 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. ++ * ++ * 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. ++ */ ++ ++import java.io.File; ++import java.io.FileWriter; ++import java.io.IOException; ++import java.io.PrintWriter; ++import java.nio.file.Path; ++ ++/* ++ * @test ++ * @summary Verify no warnings are being produced on a modified file which ++ * gets the SHA override from a file ++ * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g & os.family == "linux") ++ * @library ../../lib /test/lib ++ * @modules java.base/jdk.internal.jimage ++ * jdk.jlink/jdk.tools.jlink.internal ++ * jdk.jlink/jdk.tools.jlink.plugin ++ * jdk.jlink/jdk.tools.jimage ++ * @build tests.* jdk.test.lib.process.OutputAnalyzer ++ * jdk.test.lib.process.ProcessTools ++ * @run main/othervm -Xmx1g ModifiedFilesWithShaOverrideFileTest ++ */ ++public class ModifiedFilesWithShaOverrideFileTest extends ModifiedFilesWithShaOverrideBase { ++ ++ public static void main(String[] args) throws Exception { ++ ModifiedFilesWithShaOverrideFileTest test = new ModifiedFilesWithShaOverrideFileTest(); ++ test.run(); ++ } ++ ++ @Override ++ String initialImageName() { ++ return "java-base-jlink-with-sha-override-file"; ++ } ++ ++ @Override ++ public String getTargetName() { ++ return "java-base-jlink-with-sha-override-file-target"; ++ } ++ ++ @Override ++ public String getShaOverrideOption(Path modifiedFile, Path initialImage) { ++ String strippedSha = buildSHA512(modifiedFile); ++ Path relativePath = initialImage.relativize(modifiedFile); ++ // Modified file is libjvm.so, which is in java.base ++ String overrideVal = String.format("%s|%s|%s", "java.base", relativePath.toString(), strippedSha); ++ // Write a file in JAVA_HOME of the linkable runtime with the sha ++ // override. ++ File overrideFile = initialImage.resolve("test_sha_override.txt").toFile(); ++ try (PrintWriter pw = new PrintWriter(new FileWriter(overrideFile))) { ++ pw.println(overrideVal); ++ } catch (IOException e) { ++ throw new AssertionError("Test failed unexpectedly: ", e); ++ } ++ return SHA_OVERRIDE_FLAG + "=@${java.home}/test_sha_override.txt"; ++ } ++} +diff --git a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideTest.java b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideTest.java +new file mode 100644 +index 00000000000..ef0e541655d +--- /dev/null ++++ b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideTest.java +@@ -0,0 +1,65 @@ ++/* ++ * Copyright (c) 2025, Red Hat, Inc. ++ * 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. ++ * ++ * 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. ++ */ ++ ++import java.nio.file.Path; ++ ++/* ++ * @test ++ * @summary Verify no warnings are being produced on a modified file which ++ * gets the SHA override from command line ++ * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g & os.family == "linux") ++ * @library ../../lib /test/lib ++ * @modules java.base/jdk.internal.jimage ++ * jdk.jlink/jdk.tools.jlink.internal ++ * jdk.jlink/jdk.tools.jlink.plugin ++ * jdk.jlink/jdk.tools.jimage ++ * @build tests.* jdk.test.lib.process.OutputAnalyzer ++ * jdk.test.lib.process.ProcessTools ++ * @run main/othervm -Xmx1g ModifiedFilesWithShaOverrideTest ++ */ ++public class ModifiedFilesWithShaOverrideTest extends ModifiedFilesWithShaOverrideBase { ++ ++ public static void main(String[] args) throws Exception { ++ ModifiedFilesWithShaOverrideTest test = new ModifiedFilesWithShaOverrideTest(); ++ test.run(); ++ } ++ ++ @Override ++ String initialImageName() { ++ return "java-base-jlink-with-sha-override"; ++ } ++ ++ @Override ++ public String getTargetName() { ++ return "java-base-jlink-with-sha-override-target"; ++ } ++ ++ @Override ++ public String getShaOverrideOption(Path modifiedFile, Path initialImage) { ++ String strippedSha = buildSHA512(modifiedFile); ++ Path relativePath = initialImage.relativize(modifiedFile); ++ // Modified file is libjvm.so, which is in java.base ++ String overrideVal = String.format("%s|%s|%s", "java.base", relativePath.toString(), strippedSha); ++ return SHA_OVERRIDE_FLAG + "=" + overrideVal; ++ } ++} +diff --git a/test/jdk/tools/jlink/runtimeImage/MultiHopTest.java b/test/jdk/tools/jlink/runtimeImage/MultiHopTest.java +index 0e2cabe7425..dfb7c9eb180 100644 +--- a/test/jdk/tools/jlink/runtimeImage/MultiHopTest.java ++++ b/test/jdk/tools/jlink/runtimeImage/MultiHopTest.java +@@ -33,7 +33,6 @@ + * @summary Verify that a jlink using the run-time image cannot include jdk.jlink + * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) + * @library ../../lib /test/lib +- * @enablePreview + * @modules java.base/jdk.internal.jimage + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin +diff --git a/test/jdk/tools/jlink/runtimeImage/PackagedModulesVsRuntimeImageLinkTest.java b/test/jdk/tools/jlink/runtimeImage/PackagedModulesVsRuntimeImageLinkTest.java +index d276e80702b..a49bac80dc0 100644 +--- a/test/jdk/tools/jlink/runtimeImage/PackagedModulesVsRuntimeImageLinkTest.java ++++ b/test/jdk/tools/jlink/runtimeImage/PackagedModulesVsRuntimeImageLinkTest.java +@@ -42,7 +42,6 @@ + * produce the same result + * @requires (jlink.packagedModules & vm.compMode != "Xcomp" & os.maxMemory >= 2g) + * @library ../../lib /test/lib +- * @enablePreview + * @modules java.base/jdk.internal.jimage + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin +diff --git a/test/jdk/tools/jlink/runtimeImage/PatchedJDKModuleJlinkTest.java b/test/jdk/tools/jlink/runtimeImage/PatchedJDKModuleJlinkTest.java +index d4654ec98bd..494b830a145 100644 +--- a/test/jdk/tools/jlink/runtimeImage/PatchedJDKModuleJlinkTest.java ++++ b/test/jdk/tools/jlink/runtimeImage/PatchedJDKModuleJlinkTest.java +@@ -35,7 +35,6 @@ + * @summary Test run-time link with --patch-module. Expect failure. + * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) + * @library ../../lib /test/lib +- * @enablePreview + * @modules java.base/jdk.internal.jimage + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin +diff --git a/test/jdk/tools/jlink/runtimeImage/SystemModulesTest.java b/test/jdk/tools/jlink/runtimeImage/SystemModulesTest.java +index d0a6234eec0..f9256068a40 100644 +--- a/test/jdk/tools/jlink/runtimeImage/SystemModulesTest.java ++++ b/test/jdk/tools/jlink/runtimeImage/SystemModulesTest.java +@@ -34,7 +34,6 @@ + * @summary Test appropriate handling of generated SystemModules* classes in run-time image link mode + * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) + * @library ../../lib /test/lib +- * @enablePreview + * @modules java.base/jdk.internal.jimage + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin +diff --git a/test/jdk/tools/jlink/runtimeImage/SystemModulesTest2.java b/test/jdk/tools/jlink/runtimeImage/SystemModulesTest2.java +index ee22a55f3a7..b77c5a760f9 100644 +--- a/test/jdk/tools/jlink/runtimeImage/SystemModulesTest2.java ++++ b/test/jdk/tools/jlink/runtimeImage/SystemModulesTest2.java +@@ -35,7 +35,6 @@ + * generated classes to not be there. + * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) + * @library ../../lib /test/lib +- * @enablePreview + * @modules java.base/jdk.internal.jimage + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin +-- +2.49.0 + diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 5b4be58..6c79c6b 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -701,8 +701,10 @@ Source18: TestTranslations.java # OpenJDK patches which missed last update # ############################################# - -# Currently empty +# 8352692: Add support for extra jlink options +Patch2000: 0001-8352692-Add-support-for-extra-jlink-options.patch +# 8352689: Allow for hash sum overrides when linking from the run-time image +Patch2001: 0002-8352689-Allow-for-hash-sum-overrides-when-linking-fr.patch ############################################# # @@ -1008,6 +1010,9 @@ pushd %{top_level_dir_name} # Add crypto policy and FIPS support # Skipping fips patch whil eit is not ready for jdk22 %%patch -P1001 -p1 # Patches in need of upstreaming +# Patches which missed the 24+36 GA release +%patch -P2000 -p1 +%patch -P2001 -p1 popd # openjdk From 50c8797062f9a11708ba086e9b070679207531a6 Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Thu, 27 Mar 2025 15:40:28 +0100 Subject: [PATCH 60/86] Use SHA overrides file for builds with internal debug symbols This is so that the RPM installation can generate the overrides based on the portable build. --- java-latest-openjdk-portable.spec | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 6c79c6b..c75533f 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1082,6 +1082,14 @@ gcc ${EXTRA_CFLAGS} -o %{altjavaoutputdir}/%{alt_java_name} %{SOURCE11} echo "Building %{newjavaver}-%{buildver}, pre=%{ea_designator}, opt=%{lts_designator}" +function create_jlink_argfile() { + local argfile=${1} + + # Ensure parent directory exists + mkdir -p $(dirname ${argfile}) + echo "--sha-overrides=@\${java.home}/conf/runtimelink-sha-overrides.conf" > ${argfile} +} + function buildjdk() { local outputdir=${1} local buildjdk=${2} @@ -1092,6 +1100,8 @@ function buildjdk() { local top_dir_abs_src_path=$(pwd)/%{top_level_dir_name} local top_dir_abs_build_path=$(pwd)/${outputdir} + # Only used for "internal" debug symbols builds + local jlink_args_file=$top_dir_abs_build_path/jlink-args-file # This must be set using the global, so that the # static libraries still use a dynamic stdc++lib @@ -1100,6 +1110,17 @@ function buildjdk() { else libc_link_opt="dynamic"; fi + # For internal debug symbols the binaries and libraries + # get stripped by RPM post-build. Therefore add custom + # jlink arg-file which gets built into the lib/modules + # file so that we have a chance to override the recorded + # hash sums. + if [ "x${debug_symbols}" = "xinternal" ] ; then + jlink_flags="--save-jlink-argfiles=${jlink_args_file}" + create_jlink_argfile ${jlink_args_file} + else + jlink_flags="" + fi echo "Using output directory: ${outputdir}"; echo "Checking build JDK ${buildjdk} is operational..." @@ -1108,6 +1129,9 @@ function buildjdk() { echo "Using debuglevel: ${debuglevel}" echo "Using link_opt: ${link_opt}" echo "Using debug_symbols: ${debug_symbols}" + if [ -n "${jlink_flags}" ]; then + echo "Using extra jlink flags: '${jlink_flags}'" + fi echo "Building %{newjavaver}-%{buildver}, pre=%{ea_designator}, opt=%{lts_designator}" mkdir -p ${outputdir} @@ -1142,6 +1166,7 @@ function buildjdk() { --enable-unlimited-crypto \ --enable-linkable-runtime \ --enable-keep-packaged-modules \ + --with-extra-jlink-flags="${jlink_flags}" \ --with-zlib=%{link_type} \ --with-freetype=%{link_type} \ --with-libjpeg=${link_opt} \ From 04c53a74b87aabae6b1e8686d796297dbecff5d4 Mon Sep 17 00:00:00 2001 From: Jiri Date: Wed, 2 Apr 2025 17:59:23 +0200 Subject: [PATCH 61/86] Set rpmrelease to 4 Yet again the autorelease complain that the build already exists --- java-latest-openjdk-portable.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index c75533f..c3ae220 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -402,7 +402,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 36 -%global rpmrelease %(echo "%autorelease" | sed 's;%{?dist};;') +%global rpmrelease 4 #%%global tagsuffix %%{nil} # 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 From f3ab9623659f7e7f5435fe79cdb7eb9b733fb8a9 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 4 Apr 2025 17:18:34 +0200 Subject: [PATCH 62/86] MAde unstripped jmodless jimage work and moved it to its own tarball by regeneratign the hashsums again --- BuildShaSumFile.java | 144 ++++++++++++++++++++++++++++++ java-latest-openjdk-portable.spec | 42 ++++++--- 2 files changed, 174 insertions(+), 12 deletions(-) create mode 100644 BuildShaSumFile.java diff --git a/BuildShaSumFile.java b/BuildShaSumFile.java new file mode 100644 index 0000000..8d5390c --- /dev/null +++ b/BuildShaSumFile.java @@ -0,0 +1,144 @@ +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.io.UncheckedIOException; +import java.lang.module.ModuleDescriptor; +import java.lang.module.ModuleFinder; +import java.lang.module.ModuleReference; +import java.nio.file.Files; +import java.nio.file.Path; +import java.security.MessageDigest; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HexFormat; +import java.util.List; +import java.util.Map; +import java.util.Scanner; +import java.util.Set; +import java.util.function.Function; +import java.util.spi.ToolProvider; +import java.util.stream.Collectors; + +public class BuildShaSumFile { + + // Mirrored from ResourcePoolEntry.Type: + private enum Type { + CLASS_OR_RESOURCE(0), + CONFIG(1), + HEADER_FILE(2), + LEGAL_NOTICE(3), + MAN_PAGE(4), + NATIVE_CMD(5), + NATIVE_LIB(6), + TOP(7); + + int intVal; + + Type(int val) { + this.intVal = val; + } + + Integer getOrdinal() { + return intVal; + } + } + + private static final String RESOURCE_FILE_FORMAT = "jdk/tools/jlink/internal/runtimelink/fs_%s_files"; + private static final Map TYPE_MAP = Arrays.stream(Type.values()) + .collect(Collectors.toMap(Type::getOrdinal, Function.identity())); + private static final Module JLINK_MODULE = ToolProvider.findFirst("jlink").orElseThrow().getClass().getModule(); + private static final Set BINARIES_LIBS = Set.of(Type.NATIVE_CMD, Type.NATIVE_LIB); + + private final String outPutFile; + + public BuildShaSumFile(String output) { + this.outPutFile = output; + } + + /* + * Use the fs__files resource part of jdk.jlink to + * figure out the files part of a module from the JDK image. + * + * Note that the file is of the following format: + * ||| + * + * Example: + * 5|0|428e61a697dc05f585333888f0d9baaef7dad088c279f052e189e401471d0c94e99711f567c5d1e5d2e08259c3b320b9d239cbb610f7c347b2eff4eec8ce712c|bin/jmod + */ + private List getModuleFiles(String module, Set includeTypes) { + List moduleFiles = new ArrayList<>(); + String resourceFile = String.format(RESOURCE_FILE_FORMAT, module); + try (InputStream in = JLINK_MODULE.getResourceAsStream(resourceFile); + Scanner scanner = new Scanner(in)) { + while (scanner.hasNextLine()) { + String[] tokens = scanner.nextLine().split("\\|", 4); + Integer typeInt = Integer.valueOf(tokens[0]); + Type type = TYPE_MAP.get(typeInt); + boolean isSymlink = Integer.valueOf(tokens[1]) == 1; + if (includeTypes.contains(type) && !isSymlink) { + moduleFiles.add(tokens[3]); + } + } + } catch (IOException e) { + throw new UncheckedIOException(e); + } + return moduleFiles; + } + + private String sha512Sum(String file) { + try { + MessageDigest digest = MessageDigest.getInstance("SHA-512"); + try (InputStream is = Files.newInputStream(Path.of(System.getProperty("java.home")).resolve(Path.of(file)))) { + byte[] buf = new byte[1024]; + int readBytes = -1; + while ((readBytes = is.read(buf)) != -1) { + digest.update(buf, 0, readBytes); + } + } + byte[] hashSum = digest.digest(); + return HexFormat.of().formatHex(hashSum); + } catch (Exception e) { + throw new RuntimeException("Failed to generate hash sum"); + } + } + + public void produceHashSumFile() { + // Sanity check JEP 493 enabled builds: + String resourceFile = String.format(RESOURCE_FILE_FORMAT, "java.base"); + try (InputStream in = JLINK_MODULE.getResourceAsStream(resourceFile)) { + if (in == null) { + System.out.println("Not a JEP 493 enabled build. Aborting!"); + return; + } + } catch (IOException e) { + throw new UncheckedIOException(e); + } + try (PrintWriter pw = new PrintWriter(new FileWriter(Path.of(outPutFile).toFile()))) { + ModuleFinder.ofSystem().findAll().stream() + .map(ModuleReference::descriptor) + .map(ModuleDescriptor::name).forEach(m -> { + List moduleFiles = getModuleFiles(m, BINARIES_LIBS); + for (String file: moduleFiles) { + String shaSum = sha512Sum(file); + pw.println(String.format("%s|%s|%s", m, file, shaSum)); + } + }); + + } catch (IOException e) { + throw new UncheckedIOException(e); + } + System.out.println("File " + outPutFile + " written. " + + "You can feed that now to 'jlink's --sha-overrides option."); + } + + public static void main(String[] args) { + if (args.length != 1) { + System.err.println("Usage: " + BuildShaSumFile.class.getSimpleName() + " "); + System.exit(1); + } + BuildShaSumFile b = new BuildShaSumFile(args[0]); + b.produceHashSumFile(); + } + +} diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index c3ae220..e52e8af 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -402,7 +402,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 36 -%global rpmrelease 4 +%global rpmrelease 5 #%%global tagsuffix %%{nil} # 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 @@ -458,10 +458,12 @@ %define jdkportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.jdk;g" | sed "s;openjdkportable;el;g") %define jdkportablesourcesnameimpl() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.sources;g" | sed "s;openjdkportable;el;g" | sed "s;.%{_arch};.noarch;g") %define staticlibsportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.static-libs;g" | sed "s;openjdkportable;el;g") +%define jmodsportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.jmods;g" | sed "s;openjdkportable;el;g") %define jreportablearchive() %{expand:%{jreportablenameimpl -- %%{1}}.tar.xz} %define jdkportablearchive() %{expand:%{jdkportablenameimpl -- %%{1}}.tar.xz} %define jdkportablesourcesarchive() %{expand:%{jdkportablesourcesnameimpl -- %%{1}}.tar.xz} %define staticlibsportablearchive() %{expand:%{staticlibsportablenameimpl -- %%{1}}.tar.xz} +%define jmodsportablearchive() %{expand:%{jmodsportablenameimpl -- %%{1}}.tar.xz} %define jreportablename() %{expand:%{jreportablenameimpl -- %%{1}}} %define jdkportablename() %{expand:%{jdkportablenameimpl -- %%{1}}} %define jdkportablesourcesname() %{expand:%{jdkportablesourcesnameimpl -- %%{1}}} @@ -479,6 +481,7 @@ %define jdkportablearchiveForFiles() %(echo %{jdkportablearchive -- ""}) %define jdkportablesourcesarchiveForFiles() %(echo %{jdkportablesourcesarchive -- ""}) %define staticlibsportablearchiveForFiles() %(echo %{staticlibsportablearchive -- ""}) +%define jmodsportablearchiveForFiles() %(echo %{jmodsportablearchive -- ""}) ################################################################# # fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349 @@ -642,6 +645,10 @@ Source16: CheckVendor.java # Ensure translations are available for new timezones Source18: TestTranslations.java +# Regenerate jmod-less jlink hashsums after the build do all evil things +# The stripped debuginfo may fail this operation, but that is currently broken anyway +Source19: BuildShaSumFile.java + ############################################ # # RPM/distribution specific patches @@ -1110,17 +1117,9 @@ function buildjdk() { else libc_link_opt="dynamic"; fi - # For internal debug symbols the binaries and libraries - # get stripped by RPM post-build. Therefore add custom - # jlink arg-file which gets built into the lib/modules - # file so that we have a chance to override the recorded - # hash sums. - if [ "x${debug_symbols}" = "xinternal" ] ; then - jlink_flags="--save-jlink-argfiles=${jlink_args_file}" - create_jlink_argfile ${jlink_args_file} - else - jlink_flags="" - fi + + jlink_flags="--save-jlink-argfiles=${jlink_args_file}" + create_jlink_argfile ${jlink_args_file} echo "Using output directory: ${outputdir}"; echo "Checking build JDK ${buildjdk} is operational..." @@ -1372,6 +1371,7 @@ function packagejdk() { jdkname=%{jdkportablename -- "$nameSuffix"} jdkarchive=${packagesdir}/%{jdkportablearchive -- "$nameSuffix"} + jmodsarchive=${packagesdir}/%{jmodsportablearchive -- "$nameSuffix"} jrename=%{jreportablename -- "$nameSuffix"} jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"} staticname=%{staticlibsportablename -- "$nameSuffix"} @@ -1423,6 +1423,11 @@ function packagejdk() { genchecksum ${miscarchive} fi + tar -cJf ${jmodsarchive} --exclude='**.debuginfo' ${jdkname}/jmods + genchecksum ${jmodsarchive} + + rm -rv ${jdkname}/jmods + tar -cJf ${jdkarchive} --exclude='**.debuginfo' ${jdkname} genchecksum ${jdkarchive} @@ -1508,6 +1513,10 @@ for suffix in %{build_loop} ; do stripjdk ${builddir} installjdk ${builddir} ${installdir} fi + + pushd ${installdir}/images/jdk/ + ./bin/java --add-opens=jdk.jlink/jdk.tools.jlink.internal.runtimelink=ALL-UNNAMED %{SOURCE19} ./conf/runtimelink-sha-overrides.conf + popd packagejdk ${installdir} ${packagesdir} %{altjavaoutputdir} %if %{system_libs} @@ -1700,6 +1709,7 @@ for suffix in %{build_loop} ; do # These definitions should match those in installjdk jdkarchive=${packagesdir}/%{jdkportablearchive -- "$nameSuffix"} + jmodsarchive=${packagesdir}/%{jmodsportablearchive -- "$nameSuffix"} jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"} staticarchive=${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"} debugarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.debuginfo"} @@ -1707,6 +1717,8 @@ for suffix in %{build_loop} ; do mv ${jdkarchive} $RPM_BUILD_ROOT%{_jvmdir}/ mv ${jdkarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ + mv ${jmodsarchive} $RPM_BUILD_ROOT%{_jvmdir}/ + mv ${jmodsarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ mv ${jrearchive} $RPM_BUILD_ROOT%{_jvmdir}/ mv ${jrearchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ @@ -1756,6 +1768,8 @@ done %{_jvmdir}/%{jdkportablearchive -- .debuginfo} %{_jvmdir}/%{jdkportablearchiveForFiles}.sha256sum %{_jvmdir}/%{jdkportablearchive -- .debuginfo}.sha256sum +%{_jvmdir}/%{jmodsportablearchiveForFiles} +%{_jvmdir}/%{jmodsportablearchiveForFiles}.sha256sum %endif %if %{include_normal_build} @@ -1778,6 +1792,8 @@ done %files devel-slowdebug %{_jvmdir}/%{jdkportablearchive -- .slowdebug} %{_jvmdir}/%{jdkportablearchive -- .slowdebug}.sha256sum +%{_jvmdir}/%{jmodsportablearchive -- .slowdebug} +%{_jvmdir}/%{jmodsportablearchive -- .slowdebug}.sha256sum %if %{include_staticlibs} %files static-libs-slowdebug @@ -1794,6 +1810,8 @@ done %files devel-fastdebug %{_jvmdir}/%{jdkportablearchive -- .fastdebug} %{_jvmdir}/%{jdkportablearchive -- .fastdebug}.sha256sum +%{_jvmdir}/%{jmodsportablearchive -- .fastdebug} +%{_jvmdir}/%{jmodsportablearchive -- .fastdebug}.sha256sum %if %{include_staticlibs} %files static-libs-fastdebug From 66b9ab625c3fed03d62ddc144db56447a6f8fbed Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Wed, 16 Apr 2025 15:28:05 +0200 Subject: [PATCH 63/86] Updated to security jdk-24.0.1+9 updated news --- .gitignore | 1 + NEWS | 46 +++++++++++++++++++++++++++++++ generate_source_tarball.sh | 2 +- java-latest-openjdk-portable.spec | 6 ++-- sources | 2 +- 5 files changed, 52 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 58cebdb..b56c1ea 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ /openjdk-23.0.2+7.tar.xz /openjdk-24+34-ea.tar.xz /openjdk-24+36.tar.xz +/openjdk-24.0.1+9.tar.xz diff --git a/NEWS b/NEWS index 2eb9bd4..5cd16bd 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,52 @@ JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY JEP-XYZ: https://openjdk.org/jeps/XYZ +New in release OpenJDK 24.0.1+9 (2025-4-16): +=========================================== + - JDK-8211851: (ch) java/nio/channels/AsynchronousSocketChannel/StressLoopback.java times out (aix) + - JDK-8290043: serviceability/attach/ConcAttachTest.java failed "guarantee(!CheckJNICalls) failed: Attached JNI thread exited without being detached" + - JDK-8337494: Clarify JarInputStream behavior + - JDK-8337692: Better TLS connection support + - JDK-8338430: Improve compiler transformations + - JDK-8339356: Test javax/net/ssl/SSLSocket/Tls13PacketSize.java failed with java.net.SocketException: An established connection was aborted by the software in your host machine + - JDK-8342562: Enhance Deflater operations + - JDK-8343007: Enhance Buffered Image handling + - JDK-8344361: Restore null return for invalid services from legacy providers + - JDK-8345276: Remove EA from the JDK 24 version string with first RC promotion + - JDK-8345614: Improve AnnotationFormatError message for duplicate annotation interfaces + - JDK-8345684: OperatingSystemMXBean.getSystemCpuLoad() throws NPE + - JDK-8345959: Make JVM_IsStaticallyLinked JVM_LEAF + - JDK-8346014: Bump version numbers for 24.0.1 + - JDK-8346082: Output JVMTI agent information in hserr files + - JDK-8346239: Improve memory efficiency of JimageDiffGenerator + - JDK-8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI + - JDK-8346587: Distrust TLS server certificates anchored by Camerfirma Root CAs + - JDK-8346688: GenShen: Missing metadata trigger log message + - JDK-8346690: Shenandoah: Fix log message for end of GC usage report + - JDK-8346712: Remove com/sun/net/httpserver/TcpNoDelayNotRequired.java test + - JDK-8346713: [testsuite] NeverActAsServerClassMachine breaks TestPLABAdaptToMinTLABSize.java TestPinnedHumongousFragmentation.java TestPinnedObjectContents.java + - JDK-8346868: RISC-V: compiler/sharedstubs tests fail after JDK-8332689 + - JDK-8346887: DrawFocusRect() may cause an assertion failure + - JDK-8347124: Clean tests with --enable-linkable-runtime + - JDK-8347129: cpuset cgroups controller is required for no good reason + - JDK-8347256: Epsilon: Demote heap size and AlwaysPreTouch warnings to info level + - JDK-8347299: Add annotations to test cases in LicenseTest + - JDK-8347334: JimageDiffGenerator code clean-ups + - JDK-8347424: Fix and rewrite sun/security/x509/DNSName/LeadingPeriod.java test + - JDK-8347496: Test jdk/jfr/jvm/TestModularImage.java fails after JDK-8347124: No javac + - JDK-8347506: Compatible OCSP readtimeout property with OCSP timeout + - JDK-8347564: ZGC: Crash in DependencyContext::clean_unloading_dependents + - JDK-8347847: Enhance jar file support + - JDK-8347911: Limit the length of inflated text chunks + - JDK-8347965: (tz) Update Timezone Data to 2025a + - JDK-8348562: ZGC: segmentation fault due to missing node type check in barrier elision analysis + - JDK-8349058: 'internal proprietary API' warnings make javac warnings unusable + - JDK-8349084: Update vectors used in several PQC benchmarks + - JDK-8349183: [BACKOUT] Optimization for StringBuilder append boolean & null + - JDK-8349239: [BACKOUT] Reuse StringLatin1::putCharsAt and StringUTF16::putCharsAt + - JDK-8349828: Redo - Change milestone to fcs for newly created jdk24.0.1 branch + - JDK-8350820: OperatingSystemMXBean CpuLoad() methods return -1.0 on Windows + New in release OpenJDK 24.0.0+34 (2025-03-18): =========================================== - 404: Generational Shenandoah (Experimental) diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index 69b9dc3..9a0e233 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -36,7 +36,7 @@ # # PROJECT_NAME=openjdk # REPO_NAME=jdk24u -# VERSION=jdk-24+36 +# VERSION=jdk-24.0.1+9 # # or to e.g., prepare systemtap, icedtea7's jstack and other tapsets: # diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index e52e8af..c7ee334 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -337,7 +337,7 @@ # New Version-String scheme-style defines %global featurever 24 %global interimver 0 -%global updatever 0 +%global updatever 1 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, @@ -401,8 +401,8 @@ %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 36 -%global rpmrelease 5 +%global buildver 9 +%global rpmrelease 1 #%%global tagsuffix %%{nil} # 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 diff --git a/sources b/sources index 2c4a914..d00eba7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-24+36.tar.xz) = cfa05667adc8484818a062e2857c7733e91060efffbfab714f391414ea943c09cd4311e055fff8c4b8862103c392c5236946cba77996c0ba4b4137bc5275557e +SHA512 (openjdk-24.0.1+9.tar.xz) = 44bd46f4478d6c466850c39bfefd575bf05f349f58512ecb4ec441eebc7282e27b8dc521a3e7b9d086ada0b43f7399f2258a4237b635a891727144b67911a185 From dcabb97227ad047a3aa331c7e0c9fe519beb2304 Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Thu, 17 Apr 2025 12:30:34 +0200 Subject: [PATCH 64/86] Fix FTBFS in rawhide with GCC 15 --- 0001-Fix-name-class-of-uabs-with-GCC-15.patch | 198 ++++++++++++++++++ java-latest-openjdk-portable.spec | 5 +- 2 files changed, 201 insertions(+), 2 deletions(-) create mode 100644 0001-Fix-name-class-of-uabs-with-GCC-15.patch diff --git a/0001-Fix-name-class-of-uabs-with-GCC-15.patch b/0001-Fix-name-class-of-uabs-with-GCC-15.patch new file mode 100644 index 0000000..0825c72 --- /dev/null +++ b/0001-Fix-name-class-of-uabs-with-GCC-15.patch @@ -0,0 +1,198 @@ +From 0fd5cab226219eda13b8d3864797bea034ed3f70 Mon Sep 17 00:00:00 2001 +From: Severin Gehwolf +Date: Thu, 17 Apr 2025 11:48:31 +0200 +Subject: [PATCH] Fix name class of uabs with GCC 15 + +--- + src/hotspot/cpu/aarch64/assembler_aarch64.cpp | 2 +- + src/hotspot/cpu/aarch64/assembler_aarch64.hpp | 2 +- + src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp | 2 +- + src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp | 4 ++-- + src/hotspot/cpu/riscv/assembler_riscv.hpp | 2 +- + src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 4 ++-- + src/hotspot/share/opto/mulnode.cpp | 4 ++-- + src/hotspot/share/opto/subnode.cpp | 4 ++-- + src/hotspot/share/utilities/globalDefinitions.hpp | 12 ++++++++---- + 9 files changed, 20 insertions(+), 16 deletions(-) + +diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp +index 76f88764416..946bf1c4406 100644 +--- a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp ++++ b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp +@@ -457,7 +457,7 @@ void Assembler::bang_stack_with_offset(int offset) { Unimplemented(); } + + bool asm_util::operand_valid_for_immediate_bits(int64_t imm, unsigned nbits) { + guarantee(nbits == 8 || nbits == 12, "invalid nbits value"); +- uint64_t uimm = (uint64_t)uabs((jlong)imm); ++ uint64_t uimm = (uint64_t)UABS((jlong)imm); + if (uimm < (UCONST64(1) << nbits)) + return true; + if (uimm < (UCONST64(1) << (2 * nbits)) +diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +index a5e0e2665af..639af579d9f 100644 +--- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp ++++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +@@ -932,7 +932,7 @@ class Assembler : public AbstractAssembler { + static const uint64_t branch_range = NOT_DEBUG(128 * M) DEBUG_ONLY(2 * M); + + static bool reachable_from_branch_at(address branch, address target) { +- return uabs(target - branch) < branch_range; ++ return UABS(target - branch) < branch_range; + } + + // Unconditional branch (immediate) +diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +index d561fb912a3..3a7d2b96ecf 100644 +--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp ++++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +@@ -3271,7 +3271,7 @@ void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, uint64_t im + if (fits) { + (this->*insn1)(Rd, Rn, imm); + } else { +- if (uabs(imm) < (1 << 24)) { ++ if (UABS(imm) < (1 << 24)) { + (this->*insn1)(Rd, Rn, imm & -(1 << 12)); + (this->*insn1)(Rd, Rd, imm & ((1 << 12)-1)); + } else { +diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +index de5df5c1af1..0acac529a20 100644 +--- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp ++++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +@@ -1133,7 +1133,7 @@ class StubGenerator: public StubCodeGenerator { + + void copy_memory_small(DecoratorSet decorators, BasicType type, Register s, Register d, Register count, int step) { + bool is_backwards = step < 0; +- size_t granularity = uabs(step); ++ size_t granularity = UABS(step); + int direction = is_backwards ? -1 : 1; + + Label Lword, Lint, Lshort, Lbyte; +@@ -1192,7 +1192,7 @@ class StubGenerator: public StubCodeGenerator { + Register s, Register d, Register count, int step) { + copy_direction direction = step < 0 ? copy_backwards : copy_forwards; + bool is_backwards = step < 0; +- unsigned int granularity = uabs(step); ++ unsigned int granularity = UABS(step); + const Register t0 = r3, t1 = r4; + + // <= 80 (or 96 for SIMD) bytes do inline. Direction doesn't matter because we always +diff --git a/src/hotspot/cpu/riscv/assembler_riscv.hpp b/src/hotspot/cpu/riscv/assembler_riscv.hpp +index 31713d7362a..e193cf9fbb7 100644 +--- a/src/hotspot/cpu/riscv/assembler_riscv.hpp ++++ b/src/hotspot/cpu/riscv/assembler_riscv.hpp +@@ -3393,7 +3393,7 @@ enum Nf { + static const unsigned long branch_range = 1 * M; + + static bool reachable_from_branch_at(address branch, address target) { +- return uabs(target - branch) < branch_range; ++ return UABS(target - branch) < branch_range; + } + + // Decode the given instruction, checking if it's a 16-bit compressed +diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +index 7e6fe50e8f8..35192700673 100644 +--- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp ++++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +@@ -874,7 +874,7 @@ class StubGenerator: public StubCodeGenerator { + + void copy_memory_v(Register s, Register d, Register count, int step) { + bool is_backward = step < 0; +- int granularity = uabs(step); ++ int granularity = UABS(step); + + const Register src = x30, dst = x31, vl = x14, cnt = x15, tmp1 = x16, tmp2 = x17; + assert_different_registers(s, d, cnt, vl, tmp1, tmp2); +@@ -936,7 +936,7 @@ class StubGenerator: public StubCodeGenerator { + } + + bool is_backwards = step < 0; +- int granularity = uabs(step); ++ int granularity = UABS(step); + + const Register src = x30, dst = x31, cnt = x15, tmp3 = x16, tmp4 = x17, tmp5 = x14, tmp6 = x13; + const Register gct1 = x28, gct2 = x29, gct3 = t2; +diff --git a/src/hotspot/share/opto/mulnode.cpp b/src/hotspot/share/opto/mulnode.cpp +index ad98fda025f..a51024eb578 100644 +--- a/src/hotspot/share/opto/mulnode.cpp ++++ b/src/hotspot/share/opto/mulnode.cpp +@@ -245,7 +245,7 @@ Node *MulINode::Ideal(PhaseGVN *phase, bool can_reshape) { + // Check for negative constant; if so negate the final result + bool sign_flip = false; + +- unsigned int abs_con = uabs(con); ++ unsigned int abs_con = UABS(con); + if (abs_con != (unsigned int)con) { + sign_flip = true; + } +@@ -480,7 +480,7 @@ Node *MulLNode::Ideal(PhaseGVN *phase, bool can_reshape) { + + // Check for negative constant; if so negate the final result + bool sign_flip = false; +- julong abs_con = uabs(con); ++ julong abs_con = UABS(con); + if (abs_con != (julong)con) { + sign_flip = true; + } +diff --git a/src/hotspot/share/opto/subnode.cpp b/src/hotspot/share/opto/subnode.cpp +index f1eca4682bd..a79c1c86e96 100644 +--- a/src/hotspot/share/opto/subnode.cpp ++++ b/src/hotspot/share/opto/subnode.cpp +@@ -1923,14 +1923,14 @@ const Type* AbsNode::Value(PhaseGVN* phase) const { + case Type::Int: { + const TypeInt* ti = t1->is_int(); + if (ti->is_con()) { +- return TypeInt::make(uabs(ti->get_con())); ++ return TypeInt::make(UABS(ti->get_con())); + } + break; + } + case Type::Long: { + const TypeLong* tl = t1->is_long(); + if (tl->is_con()) { +- return TypeLong::make(uabs(tl->get_con())); ++ return TypeLong::make(UABS(tl->get_con())); + } + break; + } +diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp +index ccd3106b471..274c0591411 100644 +--- a/src/hotspot/share/utilities/globalDefinitions.hpp ++++ b/src/hotspot/share/utilities/globalDefinitions.hpp +@@ -1142,9 +1142,13 @@ inline T clamp(T value, T min, T max) { + inline bool is_odd (intx x) { return x & 1; } + inline bool is_even(intx x) { return !is_odd(x); } + ++// Some compilers define uabs() in a conflicting way (e.g. GCC 15), ++// use a macro to work-around that name clash by calling it custom_uabs ++#define UABS(x) custom_uabs(x) ++ + // abs methods which cannot overflow and so are well-defined across + // the entire domain of integer types. +-static inline unsigned int uabs(unsigned int n) { ++static inline unsigned int custom_uabs(unsigned int n) { + union { + unsigned int result; + int value; +@@ -1153,7 +1157,7 @@ static inline unsigned int uabs(unsigned int n) { + if (value < 0) result = 0-result; + return result; + } +-static inline julong uabs(julong n) { ++static inline julong custom_uabs(julong n) { + union { + julong result; + jlong value; +@@ -1162,8 +1166,8 @@ static inline julong uabs(julong n) { + if (value < 0) result = 0-result; + return result; + } +-static inline julong uabs(jlong n) { return uabs((julong)n); } +-static inline unsigned int uabs(int n) { return uabs((unsigned int)n); } ++static inline julong custom_uabs(jlong n) { return custom_uabs((julong)n); } ++static inline unsigned int custom_uabs(int n) { return custom_uabs((unsigned int)n); } + + // "to" should be greater than "from." + inline size_t byte_size(void* from, void* to) { +-- +2.49.0 + diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index c7ee334..18ff103 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -700,8 +700,8 @@ Source19: BuildShaSumFile.java # OpenJDK patches in need of upstreaming # ############################################# - -# Currently empty +# Fix rawhide build failure with GCC 15 +Patch1100: 0001-Fix-name-class-of-uabs-with-GCC-15.patch ############################################# # @@ -1017,6 +1017,7 @@ pushd %{top_level_dir_name} # Add crypto policy and FIPS support # Skipping fips patch whil eit is not ready for jdk22 %%patch -P1001 -p1 # Patches in need of upstreaming +%patch -P1100 -p1 # Patches which missed the 24+36 GA release %patch -P2000 -p1 %patch -P2001 -p1 From 2f7e59623f1590319c486a9028abed9bb2d4276d Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Tue, 22 Apr 2025 18:22:01 +0200 Subject: [PATCH 65/86] Revert hash sum calculation patches --- ...-Add-support-for-extra-jlink-options.patch | 65 -- ...r-hash-sum-overrides-when-linking-fr.patch | 830 ------------------ java-latest-openjdk-portable.spec | 7 - 3 files changed, 902 deletions(-) delete mode 100644 0001-8352692-Add-support-for-extra-jlink-options.patch delete mode 100644 0002-8352689-Allow-for-hash-sum-overrides-when-linking-fr.patch diff --git a/0001-8352692-Add-support-for-extra-jlink-options.patch b/0001-8352692-Add-support-for-extra-jlink-options.patch deleted file mode 100644 index 6b20564..0000000 --- a/0001-8352692-Add-support-for-extra-jlink-options.patch +++ /dev/null @@ -1,65 +0,0 @@ -From bc0ebeddc31949a5d84a9494e8adccc2bade357e Mon Sep 17 00:00:00 2001 -From: Severin Gehwolf -Date: Wed, 26 Mar 2025 10:53:07 +0000 -Subject: [PATCH 1/2] 8352692: Add support for extra jlink options - -Reviewed-by: ihse, erikj ---- - make/Images.gmk | 4 ++++ - make/autoconf/jdk-options.m4 | 12 ++++++++++++ - make/autoconf/spec.gmk.template | 1 + - 3 files changed, 17 insertions(+) - -diff --git a/make/Images.gmk b/make/Images.gmk -index c5d0ef11b5d..cbaf85f7942 100644 ---- a/make/Images.gmk -+++ b/make/Images.gmk -@@ -101,6 +101,10 @@ ifeq ($(JLINK_PRODUCE_LINKABLE_RUNTIME), true) - JLINK_JDK_EXTRA_OPTS += --generate-linkable-runtime - endif - -+ifneq ($(JLINK_USER_EXTRA_FLAGS), ) -+ JLINK_JDK_EXTRA_OPTS += $(JLINK_USER_EXTRA_FLAGS) -+endif -+ - $(eval $(call SetupExecute, jlink_jdk, \ - WARN := Creating jdk image, \ - DEPS := $(JDK_JMODS) $(BASE_RELEASE_FILE) \ -diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 -index 61638ce5a2c..b6fce9cc323 100644 ---- a/make/autoconf/jdk-options.m4 -+++ b/make/autoconf/jdk-options.m4 -@@ -628,6 +628,18 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS], - DEFAULT_DESC: [enabled by default unless --enable-linkable-runtime is set], - CHECKING_MSG: [if packaged modules are kept]) - AC_SUBST(JLINK_KEEP_PACKAGED_MODULES) -+ -+ ################################################################################ -+ # -+ # Extra jlink options to be (optionally) passed to the JDK build -+ # -+ UTIL_ARG_WITH(NAME: extra-jlink-flags, TYPE: string, -+ DEFAULT: [], -+ DESC: [extra flags to be passed to jlink during the build], -+ OPTIONAL: true) -+ -+ JLINK_USER_EXTRA_FLAGS="$EXTRA_JLINK_FLAGS" -+ AC_SUBST(JLINK_USER_EXTRA_FLAGS) - ]) - - ################################################################################ -diff --git a/make/autoconf/spec.gmk.template b/make/autoconf/spec.gmk.template -index 18770c6d360..63d5ce05147 100644 ---- a/make/autoconf/spec.gmk.template -+++ b/make/autoconf/spec.gmk.template -@@ -710,6 +710,7 @@ NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) $(JAVADOC_MAIN_CLASS) - JMOD_COMPRESS := @JMOD_COMPRESS@ - JLINK_KEEP_PACKAGED_MODULES := @JLINK_KEEP_PACKAGED_MODULES@ - JLINK_PRODUCE_LINKABLE_RUNTIME := @JLINK_PRODUCE_LINKABLE_RUNTIME@ -+JLINK_USER_EXTRA_FLAGS := @JLINK_USER_EXTRA_FLAGS@ - - RCFLAGS := @RCFLAGS@ - --- -2.49.0 - diff --git a/0002-8352689-Allow-for-hash-sum-overrides-when-linking-fr.patch b/0002-8352689-Allow-for-hash-sum-overrides-when-linking-fr.patch deleted file mode 100644 index 0cc63db..0000000 --- a/0002-8352689-Allow-for-hash-sum-overrides-when-linking-fr.patch +++ /dev/null @@ -1,830 +0,0 @@ -From 2a5c9b874aa86b244dec041bed05ca3d1f66ccaa Mon Sep 17 00:00:00 2001 -From: Severin Gehwolf -Date: Thu, 27 Mar 2025 14:50:54 +0100 -Subject: [PATCH 2/2] 8352689: Allow for hash sum overrides when linking from - the run-time image - ---- - .../jdk/tools/jlink/internal/JRTArchive.java | 34 +++++- - .../jdk/tools/jlink/internal/Jlink.java | 12 +- - .../jdk/tools/jlink/internal/JlinkTask.java | 72 +++++++++++- - .../jlink/internal/LinkableRuntimeImage.java | 17 ++- - .../tools/jlink/resources/jlink.properties | 6 + - test/jdk/tools/jlink/IntegrationTest.java | 4 +- - .../jlink/runtimeImage/AddOptionsTest.java | 1 - - .../BasicJlinkMissingJavaBase.java | 1 - - .../jlink/runtimeImage/BasicJlinkTest.java | 1 - - .../runtimeImage/CustomModuleJlinkTest.java | 1 - - .../runtimeImage/GenerateJLIClassesTest.java | 1 - - .../runtimeImage/JavaSEReproducibleTest.java | 1 - - .../KeepPackagedModulesFailTest.java | 1 - - .../runtimeImage/ModifiedFilesExitTest.java | 1 - - .../ModifiedFilesWarningTest.java | 1 - - .../ModifiedFilesWithShaOverrideBase.java | 111 ++++++++++++++++++ - .../ModifiedFilesWithShaOverrideFileTest.java | 77 ++++++++++++ - .../ModifiedFilesWithShaOverrideTest.java | 65 ++++++++++ - .../jlink/runtimeImage/MultiHopTest.java | 1 - - ...PackagedModulesVsRuntimeImageLinkTest.java | 1 - - .../PatchedJDKModuleJlinkTest.java | 1 - - .../jlink/runtimeImage/SystemModulesTest.java | 1 - - .../runtimeImage/SystemModulesTest2.java | 1 - - 23 files changed, 376 insertions(+), 36 deletions(-) - create mode 100644 test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideBase.java - create mode 100644 test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideFileTest.java - create mode 100644 test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideTest.java - -diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java -index df7d35ac777..823d03c50fe 100644 ---- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java -+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2024, Red Hat, Inc. -+ * Copyright (c) 2024, 2025, Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it -@@ -41,10 +41,12 @@ - import java.util.ArrayList; - import java.util.Arrays; - import java.util.Collections; -+import java.util.HashSet; - import java.util.HexFormat; - import java.util.List; - import java.util.Map; - import java.util.Objects; -+import java.util.Set; - import java.util.function.Function; - import java.util.function.Predicate; - import java.util.stream.Collectors; -@@ -74,6 +76,7 @@ public class JRTArchive implements Archive { - // Maps a module resource path to the corresponding diff to packaged - // modules for that resource (if any) - private final Map resDiff; -+ private final Map> altHashSums; - private final boolean errorOnModifiedFile; - private final TaskHelper taskHelper; - -@@ -86,11 +89,15 @@ public class JRTArchive implements Archive { - * install aborts the link. - * @param perModDiff The lib/modules (a.k.a jimage) diff for this module, - * possibly an empty list if there are no differences. -+ * @param altHashSums A map of alternative hash sums for files in -+ * a module, possibly empty. -+ * @param taskHelper The task helper reference. - */ - JRTArchive(String module, - Path path, - boolean errorOnModifiedFile, - List perModDiff, -+ Map> altHashSums, - TaskHelper taskHelper) { - this.module = module; - this.path = path; -@@ -105,6 +112,7 @@ public class JRTArchive implements Archive { - this.resDiff = Objects.requireNonNull(perModDiff).stream() - .collect(Collectors.toMap(ResourceDiff::getName, Function.identity())); - this.taskHelper = taskHelper; -+ this.altHashSums = altHashSums; - } - - @Override -@@ -217,7 +225,21 @@ private void addNonClassResources() { - - // Read from the base JDK image. - Path path = BASE.resolve(m.resPath); -- if (shaSumMismatch(path, m.hashOrTarget, m.symlink)) { -+ // Allow for additional hash sums so as to support -+ // file modifications done after jlink has run at build -+ // time. For example for Windows builds done with -+ // --with-external-symbols-in-bundles=public or -+ // distribution builds, where some post-processing happens -+ // on produced binaries and libraries invalidating the -+ // hash sum included in the jdk.jlink module for those -+ // files at jlink-time -+ Set shaSums = new HashSet<>(); -+ shaSums.add(m.hashOrTarget); -+ Set extra = altHashSums.get(m.resPath); -+ if (extra != null) { -+ shaSums.addAll(extra); -+ } -+ if (shaSumMismatch(path, shaSums, m.symlink)) { - if (errorOnModifiedFile) { - String msg = taskHelper.getMessage("err.runtime.link.modified.file", path.toString()); - IOException cause = new IOException(msg); -@@ -239,14 +261,12 @@ private void addNonClassResources() { - } - } - -- static boolean shaSumMismatch(Path res, String expectedSha, boolean isSymlink) { -+ static boolean shaSumMismatch(Path res, Set expectedShas, boolean isSymlink) { - if (isSymlink) { - return false; - } - // handle non-symlink resources - try { -- HexFormat format = HexFormat.of(); -- byte[] expected = format.parseHex(expectedSha); - MessageDigest digest = MessageDigest.getInstance("SHA-512"); - try (InputStream is = Files.newInputStream(res)) { - byte[] buf = new byte[1024]; -@@ -256,7 +276,9 @@ static boolean shaSumMismatch(Path res, String expectedSha, boolean isSymlink) { - } - } - byte[] actual = digest.digest(); -- return !MessageDigest.isEqual(expected, actual); -+ // Convert actual to string -+ String strActual = HexFormat.of().formatHex(actual); -+ return !expectedShas.contains(strActual); - } catch (Exception e) { - throw new AssertionError("SHA-512 sum check failed!", e); - } -diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java -index 99029651bfb..12e26bd4aef 100644 ---- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java -+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2025, 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 -@@ -148,7 +148,7 @@ public static final class JlinkConfiguration { - private final Set modules; - private final ModuleFinder finder; - private final boolean linkFromRuntimeImage; -- private final boolean ignoreModifiedRuntime; -+ private final LinkableRuntimeImage.Config runtimeImageConfig; - private final boolean generateRuntimeImage; - - /** -@@ -162,13 +162,13 @@ public JlinkConfiguration(Path output, - Set modules, - ModuleFinder finder, - boolean linkFromRuntimeImage, -- boolean ignoreModifiedRuntime, -+ LinkableRuntimeImage.Config runtimeImageConfig, - boolean generateRuntimeImage) { - this.output = output; - this.modules = Objects.requireNonNull(modules); - this.finder = finder; - this.linkFromRuntimeImage = linkFromRuntimeImage; -- this.ignoreModifiedRuntime = ignoreModifiedRuntime; -+ this.runtimeImageConfig = runtimeImageConfig; - this.generateRuntimeImage = generateRuntimeImage; - } - -@@ -198,8 +198,8 @@ public boolean linkFromRuntimeImage() { - return linkFromRuntimeImage; - } - -- public boolean ignoreModifiedRuntime() { -- return ignoreModifiedRuntime; -+ public LinkableRuntimeImage.Config runtimeImageConfig() { -+ return runtimeImageConfig; - } - - public boolean isGenerateRuntimeImage() { -diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java -index 928b9a47934..bf63f7e6795 100644 ---- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java -+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2025, 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 -@@ -191,7 +191,43 @@ public class JlinkTask { - // be used for linking from the run-time image. - new Option(false, (task, opt, arg) -> { - task.options.generateLinkableRuntime = true; -- }, true, "--generate-linkable-runtime") -+ }, true, "--generate-linkable-runtime"), -+ new Option(true, (task, opt, arg) -> { -+ if (arg.startsWith("@")) { -+ // Read overrides from file -+ if (!task.options.shaOverrides.isEmpty()) { -+ // Only allow a single @file value -+ throw taskHelper.newBadArgs("err.sha.overrides.multiple"); -+ } -+ // Ignore non-existing sha overrides file. -+ // -+ // This is to allow for custom builds needing to optionally -+ // support run-time image links on (possibly) modified -+ // binaries/debuginfo files done after the JDK build -+ // -+ // Allow for JAVA_HOME relative paths for the file, by replacing -+ // the ${java.home} token in the file name -+ String fileName = arg.substring(1); -+ if (fileName.startsWith("${java.home}")) { -+ String javaHome = System.getProperty("java.home"); -+ fileName = javaHome + fileName.substring(12 /* ${java.home}.length() */); -+ } -+ Path file = Paths.get(fileName); -+ if (Files.exists(file)) { -+ try { -+ Files.readAllLines(file).stream() -+ .forEach(task.options.shaOverrides::add); -+ } catch (IOException e) { -+ throw taskHelper.newBadArgs("err.sha.overrides.freaderr", file.toString()); -+ } -+ } -+ } else { -+ // Allow multiple values, separated by comma in addition to -+ // multiple times the same option. -+ Arrays.asList(arg.split(",")).stream() -+ .forEach(task.options.shaOverrides::add); -+ } -+ }, true, "--sha-overrides"), - }; - - -@@ -235,6 +271,7 @@ static class OptionsValues { - boolean suggestProviders = false; - boolean ignoreModifiedRuntime = false; - boolean generateLinkableRuntime = false; -+ final Set shaOverrides = new HashSet<>(); - } - - public static final String OPTIONS_RESOURCE = "jdk/tools/jlink/internal/options"; -@@ -459,14 +496,41 @@ private JlinkConfiguration initJlinkConfig() throws BadArgs { - throw taskHelper.newBadArgs("err.runtime.link.packaged.mods"); - } - -+ LinkableRuntimeImage.Config linkableRuntimeConfig = new LinkableRuntimeImage.Config( -+ options.ignoreModifiedRuntime, -+ isLinkFromRuntime ? buildShaSumMap(taskHelper, options.shaOverrides) : null); - return new JlinkConfiguration(options.output, - roots, - finder, - isLinkFromRuntime, -- options.ignoreModifiedRuntime, -+ linkableRuntimeConfig, - options.generateLinkableRuntime); - } - -+ private Map>> buildShaSumMap(TaskHelper taskHelper, -+ Set shaOverrides) throws BadArgs { -+ Map>> moduleToFiles = new HashMap<>(); -+ for (String t: shaOverrides) { -+ String trimmed = t.trim(); -+ if (trimmed.startsWith("#")) { -+ // skip comment lines -+ continue; -+ } -+ String[] tokens = trimmed.split("\\|"); -+ if (tokens.length != 3) { -+ throw taskHelper.newBadArgs("err.sha.overrides.bad.format", t); -+ } -+ // t is a '|'-separated item of (in that order): -+ // -+ // -+ // -+ Map> perModuleMap = moduleToFiles.computeIfAbsent(tokens[0], k -> new HashMap<>()); -+ Set shaSumsPerFile = perModuleMap.computeIfAbsent(tokens[1], k -> new HashSet<>()); -+ shaSumsPerFile.add(tokens[2]); -+ } -+ return moduleToFiles; -+ } -+ - /* - * Creates a ModuleFinder for the given module paths. - */ -@@ -788,7 +852,7 @@ private static Archive newArchive(String module, - taskHelper.getMessage("err.not.a.module.directory", path)); - } - } else if (config.linkFromRuntimeImage()) { -- return LinkableRuntimeImage.newArchive(module, path, config.ignoreModifiedRuntime(), taskHelper); -+ return LinkableRuntimeImage.newArchive(module, path, config.runtimeImageConfig(), taskHelper); - } else { - throw new IllegalArgumentException( - taskHelper.getMessage("err.not.modular.format", module, path)); -diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java -index 935af4585ad..a9b146d55a2 100644 ---- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java -+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2024, Red Hat, Inc. -+ * Copyright (c) 2024, 2025, Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it -@@ -29,6 +29,8 @@ - import java.io.InputStream; - import java.nio.file.Path; - import java.util.List; -+import java.util.Map; -+import java.util.Set; - - import jdk.tools.jlink.internal.runtimelink.ResourceDiff; - -@@ -67,7 +69,7 @@ private static InputStream getDiffInputStream(String module) throws IOException - - public static Archive newArchive(String module, - Path path, -- boolean ignoreModifiedRuntime, -+ Config config, - TaskHelper taskHelper) { - assert isLinkableRuntime(); - // Here we retrieve the per module difference file, which is -@@ -81,8 +83,15 @@ public static Archive newArchive(String module, - throw new AssertionError("Failure to retrieve resource diff for " + - "module " + module, e); - } -- return new JRTArchive(module, path, !ignoreModifiedRuntime, perModuleDiff, taskHelper); -+ return new JRTArchive(module, -+ path, -+ !config.ignoreModifiedRuntime, -+ perModuleDiff, -+ // Empty map if no alternative sha sums -+ config.altHashSums.computeIfAbsent(module, k -> Map.of()), -+ taskHelper); - } - -- -+ static record Config(boolean ignoreModifiedRuntime, -+ Map>> altHashSums) {} - } -diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties -index a491b758ea0..59f5860d131 100644 ---- a/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties -+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties -@@ -127,6 +127,12 @@ err.runtime.link.packaged.mods=This JDK has no packaged modules.\ - err.runtime.link.modified.file={0} has been modified - err.runtime.link.patched.module=jlink does not support linking from the run-time image\ - \ when running on a patched runtime with --patch-module -+ -+# Linking from the run-time image, SHA sum handling -+err.sha.overrides.multiple=option --sha-overrides does not allow @file and non-file combinations -+err.sha.overrides.freaderr=Error reading file ''{0}'' passed with option --sha-overrides -+err.sha.overrides.bad.format=Bad format in --sha-overrides. Token was {0}. Expected || -+ - err.no.module.path=--module-path option must be specified with --add-modules ALL-MODULE-PATH - err.empty.module.path=No module found in module path ''{0}'' with --add-modules ALL-MODULE-PATH - err.limit.modules=--limit-modules not allowed with --add-modules ALL-MODULE-PATH -diff --git a/test/jdk/tools/jlink/IntegrationTest.java b/test/jdk/tools/jlink/IntegrationTest.java -index 5a8d0bce15a..818c31b9eef 100644 ---- a/test/jdk/tools/jlink/IntegrationTest.java -+++ b/test/jdk/tools/jlink/IntegrationTest.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2025, 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 -@@ -159,7 +159,7 @@ private static void test() throws Exception { - mods, - JlinkTask.limitFinder(JlinkTask.newModuleFinder(modulePaths), limits, mods), - linkFromRuntime, -- false /* ignore modified runtime */, -+ null /* run-time image link config */, - false /* generate run-time image */); - - List lst = new ArrayList<>(); -diff --git a/test/jdk/tools/jlink/runtimeImage/AddOptionsTest.java b/test/jdk/tools/jlink/runtimeImage/AddOptionsTest.java -index 827f7da624d..4f25bc3ee66 100644 ---- a/test/jdk/tools/jlink/runtimeImage/AddOptionsTest.java -+++ b/test/jdk/tools/jlink/runtimeImage/AddOptionsTest.java -@@ -33,7 +33,6 @@ - * @summary Test --add-options jlink plugin when linking from the run-time image - * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) - * @library ../../lib /test/lib -- * @enablePreview - * @modules java.base/jdk.internal.jimage - * jdk.jlink/jdk.tools.jlink.internal - * jdk.jlink/jdk.tools.jlink.plugin -diff --git a/test/jdk/tools/jlink/runtimeImage/BasicJlinkMissingJavaBase.java b/test/jdk/tools/jlink/runtimeImage/BasicJlinkMissingJavaBase.java -index ebf5b060665..cb28f6f2b86 100644 ---- a/test/jdk/tools/jlink/runtimeImage/BasicJlinkMissingJavaBase.java -+++ b/test/jdk/tools/jlink/runtimeImage/BasicJlinkMissingJavaBase.java -@@ -34,7 +34,6 @@ - * but java.xml.jmod present. It should link from the run-time image without errors. - * @requires (jlink.packagedModules & vm.compMode != "Xcomp" & os.maxMemory >= 2g) - * @library ../../lib /test/lib -- * @enablePreview - * @modules java.base/jdk.internal.jimage - * jdk.jlink/jdk.tools.jlink.internal - * jdk.jlink/jdk.tools.jlink.plugin -diff --git a/test/jdk/tools/jlink/runtimeImage/BasicJlinkTest.java b/test/jdk/tools/jlink/runtimeImage/BasicJlinkTest.java -index 8cbd74e5ed1..f82c16c036d 100644 ---- a/test/jdk/tools/jlink/runtimeImage/BasicJlinkTest.java -+++ b/test/jdk/tools/jlink/runtimeImage/BasicJlinkTest.java -@@ -32,7 +32,6 @@ - * @summary Test basic linking from the run-time image - * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) - * @library ../../lib /test/lib -- * @enablePreview - * @modules java.base/jdk.internal.jimage - * jdk.jlink/jdk.tools.jlink.internal - * jdk.jlink/jdk.tools.jlink.plugin -diff --git a/test/jdk/tools/jlink/runtimeImage/CustomModuleJlinkTest.java b/test/jdk/tools/jlink/runtimeImage/CustomModuleJlinkTest.java -index d6c237a173b..15cd88ae9fc 100644 ---- a/test/jdk/tools/jlink/runtimeImage/CustomModuleJlinkTest.java -+++ b/test/jdk/tools/jlink/runtimeImage/CustomModuleJlinkTest.java -@@ -32,7 +32,6 @@ - * @summary Test jmod-less jlink with a custom module - * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) - * @library ../../lib /test/lib -- * @enablePreview - * @modules java.base/jdk.internal.jimage - * jdk.jlink/jdk.tools.jlink.internal - * jdk.jlink/jdk.tools.jlink.plugin -diff --git a/test/jdk/tools/jlink/runtimeImage/GenerateJLIClassesTest.java b/test/jdk/tools/jlink/runtimeImage/GenerateJLIClassesTest.java -index e59d18bd6f0..2a45d920f2d 100644 ---- a/test/jdk/tools/jlink/runtimeImage/GenerateJLIClassesTest.java -+++ b/test/jdk/tools/jlink/runtimeImage/GenerateJLIClassesTest.java -@@ -32,7 +32,6 @@ - * @summary Verify JLI class generation in run-time image link mode - * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) - * @library ../../lib /test/lib -- * @enablePreview - * @modules java.base/jdk.internal.jimage - * jdk.jlink/jdk.tools.jlink.internal - * jdk.jlink/jdk.tools.jlink.plugin -diff --git a/test/jdk/tools/jlink/runtimeImage/JavaSEReproducibleTest.java b/test/jdk/tools/jlink/runtimeImage/JavaSEReproducibleTest.java -index a376d075ecd..b2137b7b94d 100644 ---- a/test/jdk/tools/jlink/runtimeImage/JavaSEReproducibleTest.java -+++ b/test/jdk/tools/jlink/runtimeImage/JavaSEReproducibleTest.java -@@ -33,7 +33,6 @@ - * image. - * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) - * @library ../../lib /test/lib -- * @enablePreview - * @modules java.base/jdk.internal.jimage - * jdk.jlink/jdk.tools.jlink.internal - * jdk.jlink/jdk.tools.jlink.plugin -diff --git a/test/jdk/tools/jlink/runtimeImage/KeepPackagedModulesFailTest.java b/test/jdk/tools/jlink/runtimeImage/KeepPackagedModulesFailTest.java -index 6fdaf5a9824..2b13043b1db 100644 ---- a/test/jdk/tools/jlink/runtimeImage/KeepPackagedModulesFailTest.java -+++ b/test/jdk/tools/jlink/runtimeImage/KeepPackagedModulesFailTest.java -@@ -34,7 +34,6 @@ - * --keep-packaged-modules fails as expected. - * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) - * @library ../../lib /test/lib -- * @enablePreview - * @modules java.base/jdk.internal.jimage - * jdk.jlink/jdk.tools.jlink.internal - * jdk.jlink/jdk.tools.jlink.plugin -diff --git a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesExitTest.java b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesExitTest.java -index 777ce302ce7..b318418de16 100644 ---- a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesExitTest.java -+++ b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesExitTest.java -@@ -33,7 +33,6 @@ - * and files have been modified - * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) - * @library ../../lib /test/lib -- * @enablePreview - * @modules java.base/jdk.internal.jimage - * jdk.jlink/jdk.tools.jlink.internal - * jdk.jlink/jdk.tools.jlink.plugin -diff --git a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWarningTest.java b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWarningTest.java -index c871024f37c..a309f5cbbc5 100644 ---- a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWarningTest.java -+++ b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWarningTest.java -@@ -32,7 +32,6 @@ - * image and files have been modified - * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) - * @library ../../lib /test/lib -- * @enablePreview - * @modules java.base/jdk.internal.jimage - * jdk.jlink/jdk.tools.jlink.internal - * jdk.jlink/jdk.tools.jlink.plugin -diff --git a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideBase.java b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideBase.java -new file mode 100644 -index 00000000000..529fbda2ef9 ---- /dev/null -+++ b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideBase.java -@@ -0,0 +1,111 @@ -+/* -+ * Copyright (c) 2025, Red Hat, Inc. -+ * 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. -+ * -+ * 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. -+ */ -+ -+import java.io.IOException; -+import java.io.InputStream; -+import java.nio.file.Files; -+import java.nio.file.Path; -+import java.security.MessageDigest; -+import java.util.ArrayList; -+import java.util.HexFormat; -+import java.util.List; -+ -+import jdk.test.lib.process.OutputAnalyzer; -+import jtreg.SkippedException; -+import tests.Helper; -+ -+/* -+ * Base class for sha overrides tests -+ */ -+public abstract class ModifiedFilesWithShaOverrideBase extends ModifiedFilesTest { -+ -+ protected static final String SHA_OVERRIDE_FLAG = "--sha-overrides"; -+ -+ @Override -+ protected Path modifyFileInImage(Path jmodLessImg) { -+ try { -+ Path libJVM = jmodLessImg.resolve("lib").resolve("server").resolve(System.mapLibraryName("jvm")); -+ String shaBefore = buildSHA512(libJVM); -+ List objcopy = new ArrayList<>(); -+ objcopy.add("objcopy"); -+ // The OpenJDK build doesn't strip all symbols by default. In order -+ // to get a different libjvm.so file, we strip everything. The -+ // expectation is for the sha to be different before and after the -+ // stripping of the file. -+ objcopy.add("--strip-all"); -+ objcopy.add(libJVM.toString()); -+ ProcessBuilder builder = new ProcessBuilder(objcopy); -+ Process p = builder.start(); -+ int returnVal = p.waitFor(); -+ if (returnVal != 0) { -+ throw new SkippedException("Stripping of libjvm failed. Is objcopy installed?"); -+ } -+ String shaAfter = buildSHA512(libJVM); -+ if (shaBefore.equals(shaAfter)) { -+ throw new SkippedException("Binary file would be the same before after - test skipped"); -+ } -+ return libJVM; -+ } catch (IOException | InterruptedException e) { -+ throw new SkippedException("Stripping of libjvm failed: " + e.getMessage()); -+ } -+ } -+ -+ @Override -+ void testAndAssert(Path modifiedFile, Helper helper, Path initialImage) throws Exception { -+ String extraJlinkOption = getShaOverrideOption(modifiedFile, initialImage); -+ CapturingHandler handler = new CapturingHandler(); -+ jlinkUsingImage(new JlinkSpecBuilder() -+ .helper(helper) -+ .imagePath(initialImage) -+ .name(getTargetName()) -+ .addModule("java.base") -+ .validatingModule("java.base") -+ .extraJlinkOpt(extraJlinkOption) // allow for the modified sha -+ .build(), handler); -+ OutputAnalyzer out = handler.analyzer(); -+ // verify we don't get a warning message for the modified file -+ out.stdoutShouldNotMatch(".* has been modified"); -+ out.stdoutShouldNotContain("java.lang.IllegalArgumentException"); -+ out.stdoutShouldNotContain("IOException"); -+ } -+ -+ public abstract String getTargetName(); -+ public abstract String getShaOverrideOption(Path modifiedFile, Path initialImage); -+ -+ protected String buildSHA512(Path modifiedFile) { -+ try { -+ MessageDigest digest = MessageDigest.getInstance("SHA-512"); -+ try (InputStream is = Files.newInputStream(modifiedFile)) { -+ byte[] buf = new byte[1024]; -+ int readBytes = -1; -+ while ((readBytes = is.read(buf)) != -1) { -+ digest.update(buf, 0, readBytes); -+ } -+ } -+ byte[] actual = digest.digest(); -+ return HexFormat.of().formatHex(actual); -+ } catch (Exception e) { -+ throw new AssertionError("SHA-512 sum generation failed"); -+ } -+ } -+} -diff --git a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideFileTest.java b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideFileTest.java -new file mode 100644 -index 00000000000..d20eecd40e7 ---- /dev/null -+++ b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideFileTest.java -@@ -0,0 +1,77 @@ -+/* -+ * Copyright (c) 2025, Red Hat, Inc. -+ * 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. -+ * -+ * 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. -+ */ -+ -+import java.io.File; -+import java.io.FileWriter; -+import java.io.IOException; -+import java.io.PrintWriter; -+import java.nio.file.Path; -+ -+/* -+ * @test -+ * @summary Verify no warnings are being produced on a modified file which -+ * gets the SHA override from a file -+ * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g & os.family == "linux") -+ * @library ../../lib /test/lib -+ * @modules java.base/jdk.internal.jimage -+ * jdk.jlink/jdk.tools.jlink.internal -+ * jdk.jlink/jdk.tools.jlink.plugin -+ * jdk.jlink/jdk.tools.jimage -+ * @build tests.* jdk.test.lib.process.OutputAnalyzer -+ * jdk.test.lib.process.ProcessTools -+ * @run main/othervm -Xmx1g ModifiedFilesWithShaOverrideFileTest -+ */ -+public class ModifiedFilesWithShaOverrideFileTest extends ModifiedFilesWithShaOverrideBase { -+ -+ public static void main(String[] args) throws Exception { -+ ModifiedFilesWithShaOverrideFileTest test = new ModifiedFilesWithShaOverrideFileTest(); -+ test.run(); -+ } -+ -+ @Override -+ String initialImageName() { -+ return "java-base-jlink-with-sha-override-file"; -+ } -+ -+ @Override -+ public String getTargetName() { -+ return "java-base-jlink-with-sha-override-file-target"; -+ } -+ -+ @Override -+ public String getShaOverrideOption(Path modifiedFile, Path initialImage) { -+ String strippedSha = buildSHA512(modifiedFile); -+ Path relativePath = initialImage.relativize(modifiedFile); -+ // Modified file is libjvm.so, which is in java.base -+ String overrideVal = String.format("%s|%s|%s", "java.base", relativePath.toString(), strippedSha); -+ // Write a file in JAVA_HOME of the linkable runtime with the sha -+ // override. -+ File overrideFile = initialImage.resolve("test_sha_override.txt").toFile(); -+ try (PrintWriter pw = new PrintWriter(new FileWriter(overrideFile))) { -+ pw.println(overrideVal); -+ } catch (IOException e) { -+ throw new AssertionError("Test failed unexpectedly: ", e); -+ } -+ return SHA_OVERRIDE_FLAG + "=@${java.home}/test_sha_override.txt"; -+ } -+} -diff --git a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideTest.java b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideTest.java -new file mode 100644 -index 00000000000..ef0e541655d ---- /dev/null -+++ b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWithShaOverrideTest.java -@@ -0,0 +1,65 @@ -+/* -+ * Copyright (c) 2025, Red Hat, Inc. -+ * 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. -+ * -+ * 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. -+ */ -+ -+import java.nio.file.Path; -+ -+/* -+ * @test -+ * @summary Verify no warnings are being produced on a modified file which -+ * gets the SHA override from command line -+ * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g & os.family == "linux") -+ * @library ../../lib /test/lib -+ * @modules java.base/jdk.internal.jimage -+ * jdk.jlink/jdk.tools.jlink.internal -+ * jdk.jlink/jdk.tools.jlink.plugin -+ * jdk.jlink/jdk.tools.jimage -+ * @build tests.* jdk.test.lib.process.OutputAnalyzer -+ * jdk.test.lib.process.ProcessTools -+ * @run main/othervm -Xmx1g ModifiedFilesWithShaOverrideTest -+ */ -+public class ModifiedFilesWithShaOverrideTest extends ModifiedFilesWithShaOverrideBase { -+ -+ public static void main(String[] args) throws Exception { -+ ModifiedFilesWithShaOverrideTest test = new ModifiedFilesWithShaOverrideTest(); -+ test.run(); -+ } -+ -+ @Override -+ String initialImageName() { -+ return "java-base-jlink-with-sha-override"; -+ } -+ -+ @Override -+ public String getTargetName() { -+ return "java-base-jlink-with-sha-override-target"; -+ } -+ -+ @Override -+ public String getShaOverrideOption(Path modifiedFile, Path initialImage) { -+ String strippedSha = buildSHA512(modifiedFile); -+ Path relativePath = initialImage.relativize(modifiedFile); -+ // Modified file is libjvm.so, which is in java.base -+ String overrideVal = String.format("%s|%s|%s", "java.base", relativePath.toString(), strippedSha); -+ return SHA_OVERRIDE_FLAG + "=" + overrideVal; -+ } -+} -diff --git a/test/jdk/tools/jlink/runtimeImage/MultiHopTest.java b/test/jdk/tools/jlink/runtimeImage/MultiHopTest.java -index 0e2cabe7425..dfb7c9eb180 100644 ---- a/test/jdk/tools/jlink/runtimeImage/MultiHopTest.java -+++ b/test/jdk/tools/jlink/runtimeImage/MultiHopTest.java -@@ -33,7 +33,6 @@ - * @summary Verify that a jlink using the run-time image cannot include jdk.jlink - * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) - * @library ../../lib /test/lib -- * @enablePreview - * @modules java.base/jdk.internal.jimage - * jdk.jlink/jdk.tools.jlink.internal - * jdk.jlink/jdk.tools.jlink.plugin -diff --git a/test/jdk/tools/jlink/runtimeImage/PackagedModulesVsRuntimeImageLinkTest.java b/test/jdk/tools/jlink/runtimeImage/PackagedModulesVsRuntimeImageLinkTest.java -index d276e80702b..a49bac80dc0 100644 ---- a/test/jdk/tools/jlink/runtimeImage/PackagedModulesVsRuntimeImageLinkTest.java -+++ b/test/jdk/tools/jlink/runtimeImage/PackagedModulesVsRuntimeImageLinkTest.java -@@ -42,7 +42,6 @@ - * produce the same result - * @requires (jlink.packagedModules & vm.compMode != "Xcomp" & os.maxMemory >= 2g) - * @library ../../lib /test/lib -- * @enablePreview - * @modules java.base/jdk.internal.jimage - * jdk.jlink/jdk.tools.jlink.internal - * jdk.jlink/jdk.tools.jlink.plugin -diff --git a/test/jdk/tools/jlink/runtimeImage/PatchedJDKModuleJlinkTest.java b/test/jdk/tools/jlink/runtimeImage/PatchedJDKModuleJlinkTest.java -index d4654ec98bd..494b830a145 100644 ---- a/test/jdk/tools/jlink/runtimeImage/PatchedJDKModuleJlinkTest.java -+++ b/test/jdk/tools/jlink/runtimeImage/PatchedJDKModuleJlinkTest.java -@@ -35,7 +35,6 @@ - * @summary Test run-time link with --patch-module. Expect failure. - * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) - * @library ../../lib /test/lib -- * @enablePreview - * @modules java.base/jdk.internal.jimage - * jdk.jlink/jdk.tools.jlink.internal - * jdk.jlink/jdk.tools.jlink.plugin -diff --git a/test/jdk/tools/jlink/runtimeImage/SystemModulesTest.java b/test/jdk/tools/jlink/runtimeImage/SystemModulesTest.java -index d0a6234eec0..f9256068a40 100644 ---- a/test/jdk/tools/jlink/runtimeImage/SystemModulesTest.java -+++ b/test/jdk/tools/jlink/runtimeImage/SystemModulesTest.java -@@ -34,7 +34,6 @@ - * @summary Test appropriate handling of generated SystemModules* classes in run-time image link mode - * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) - * @library ../../lib /test/lib -- * @enablePreview - * @modules java.base/jdk.internal.jimage - * jdk.jlink/jdk.tools.jlink.internal - * jdk.jlink/jdk.tools.jlink.plugin -diff --git a/test/jdk/tools/jlink/runtimeImage/SystemModulesTest2.java b/test/jdk/tools/jlink/runtimeImage/SystemModulesTest2.java -index ee22a55f3a7..b77c5a760f9 100644 ---- a/test/jdk/tools/jlink/runtimeImage/SystemModulesTest2.java -+++ b/test/jdk/tools/jlink/runtimeImage/SystemModulesTest2.java -@@ -35,7 +35,6 @@ - * generated classes to not be there. - * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) - * @library ../../lib /test/lib -- * @enablePreview - * @modules java.base/jdk.internal.jimage - * jdk.jlink/jdk.tools.jlink.internal - * jdk.jlink/jdk.tools.jlink.plugin --- -2.49.0 - diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 18ff103..218d036 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -708,10 +708,6 @@ Patch1100: 0001-Fix-name-class-of-uabs-with-GCC-15.patch # OpenJDK patches which missed last update # ############################################# -# 8352692: Add support for extra jlink options -Patch2000: 0001-8352692-Add-support-for-extra-jlink-options.patch -# 8352689: Allow for hash sum overrides when linking from the run-time image -Patch2001: 0002-8352689-Allow-for-hash-sum-overrides-when-linking-fr.patch ############################################# # @@ -1018,9 +1014,6 @@ pushd %{top_level_dir_name} # Skipping fips patch whil eit is not ready for jdk22 %%patch -P1001 -p1 # Patches in need of upstreaming %patch -P1100 -p1 -# Patches which missed the 24+36 GA release -%patch -P2000 -p1 -%patch -P2001 -p1 popd # openjdk From 4fa1f27deabf81a11fd8d9860b5267e0fc619b02 Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Tue, 22 Apr 2025 18:42:18 +0200 Subject: [PATCH 66/86] Don't do custom debuginfo stripping Use the --with-native-debug-symbols=external approach instead. --- BuildShaSumFile.java | 144 ------------------------------ java-latest-openjdk-portable.spec | 133 ++------------------------- 2 files changed, 9 insertions(+), 268 deletions(-) delete mode 100644 BuildShaSumFile.java diff --git a/BuildShaSumFile.java b/BuildShaSumFile.java deleted file mode 100644 index 8d5390c..0000000 --- a/BuildShaSumFile.java +++ /dev/null @@ -1,144 +0,0 @@ -import java.io.FileWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintWriter; -import java.io.UncheckedIOException; -import java.lang.module.ModuleDescriptor; -import java.lang.module.ModuleFinder; -import java.lang.module.ModuleReference; -import java.nio.file.Files; -import java.nio.file.Path; -import java.security.MessageDigest; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HexFormat; -import java.util.List; -import java.util.Map; -import java.util.Scanner; -import java.util.Set; -import java.util.function.Function; -import java.util.spi.ToolProvider; -import java.util.stream.Collectors; - -public class BuildShaSumFile { - - // Mirrored from ResourcePoolEntry.Type: - private enum Type { - CLASS_OR_RESOURCE(0), - CONFIG(1), - HEADER_FILE(2), - LEGAL_NOTICE(3), - MAN_PAGE(4), - NATIVE_CMD(5), - NATIVE_LIB(6), - TOP(7); - - int intVal; - - Type(int val) { - this.intVal = val; - } - - Integer getOrdinal() { - return intVal; - } - } - - private static final String RESOURCE_FILE_FORMAT = "jdk/tools/jlink/internal/runtimelink/fs_%s_files"; - private static final Map TYPE_MAP = Arrays.stream(Type.values()) - .collect(Collectors.toMap(Type::getOrdinal, Function.identity())); - private static final Module JLINK_MODULE = ToolProvider.findFirst("jlink").orElseThrow().getClass().getModule(); - private static final Set BINARIES_LIBS = Set.of(Type.NATIVE_CMD, Type.NATIVE_LIB); - - private final String outPutFile; - - public BuildShaSumFile(String output) { - this.outPutFile = output; - } - - /* - * Use the fs__files resource part of jdk.jlink to - * figure out the files part of a module from the JDK image. - * - * Note that the file is of the following format: - * ||| - * - * Example: - * 5|0|428e61a697dc05f585333888f0d9baaef7dad088c279f052e189e401471d0c94e99711f567c5d1e5d2e08259c3b320b9d239cbb610f7c347b2eff4eec8ce712c|bin/jmod - */ - private List getModuleFiles(String module, Set includeTypes) { - List moduleFiles = new ArrayList<>(); - String resourceFile = String.format(RESOURCE_FILE_FORMAT, module); - try (InputStream in = JLINK_MODULE.getResourceAsStream(resourceFile); - Scanner scanner = new Scanner(in)) { - while (scanner.hasNextLine()) { - String[] tokens = scanner.nextLine().split("\\|", 4); - Integer typeInt = Integer.valueOf(tokens[0]); - Type type = TYPE_MAP.get(typeInt); - boolean isSymlink = Integer.valueOf(tokens[1]) == 1; - if (includeTypes.contains(type) && !isSymlink) { - moduleFiles.add(tokens[3]); - } - } - } catch (IOException e) { - throw new UncheckedIOException(e); - } - return moduleFiles; - } - - private String sha512Sum(String file) { - try { - MessageDigest digest = MessageDigest.getInstance("SHA-512"); - try (InputStream is = Files.newInputStream(Path.of(System.getProperty("java.home")).resolve(Path.of(file)))) { - byte[] buf = new byte[1024]; - int readBytes = -1; - while ((readBytes = is.read(buf)) != -1) { - digest.update(buf, 0, readBytes); - } - } - byte[] hashSum = digest.digest(); - return HexFormat.of().formatHex(hashSum); - } catch (Exception e) { - throw new RuntimeException("Failed to generate hash sum"); - } - } - - public void produceHashSumFile() { - // Sanity check JEP 493 enabled builds: - String resourceFile = String.format(RESOURCE_FILE_FORMAT, "java.base"); - try (InputStream in = JLINK_MODULE.getResourceAsStream(resourceFile)) { - if (in == null) { - System.out.println("Not a JEP 493 enabled build. Aborting!"); - return; - } - } catch (IOException e) { - throw new UncheckedIOException(e); - } - try (PrintWriter pw = new PrintWriter(new FileWriter(Path.of(outPutFile).toFile()))) { - ModuleFinder.ofSystem().findAll().stream() - .map(ModuleReference::descriptor) - .map(ModuleDescriptor::name).forEach(m -> { - List moduleFiles = getModuleFiles(m, BINARIES_LIBS); - for (String file: moduleFiles) { - String shaSum = sha512Sum(file); - pw.println(String.format("%s|%s|%s", m, file, shaSum)); - } - }); - - } catch (IOException e) { - throw new UncheckedIOException(e); - } - System.out.println("File " + outPutFile + " written. " + - "You can feed that now to 'jlink's --sha-overrides option."); - } - - public static void main(String[] args) { - if (args.length != 1) { - System.err.println("Usage: " + BuildShaSumFile.class.getSimpleName() + " "); - System.exit(1); - } - BuildShaSumFile b = new BuildShaSumFile(args[0]); - b.produceHashSumFile(); - } - -} diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 218d036..1375e1a 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -551,9 +551,6 @@ ExcludeArch: %{ix86} %define java_static_libs_rpo() %{expand: } -%define java_unstripped_rpo() %{expand: -} - %define java_docs_rpo() %{expand: } @@ -645,10 +642,6 @@ Source16: CheckVendor.java # Ensure translations are available for new timezones Source18: TestTranslations.java -# Regenerate jmod-less jlink hashsums after the build do all evil things -# The stripped debuginfo may fail this operation, but that is currently broken anyway -Source19: BuildShaSumFile.java - ############################################ # # RPM/distribution specific patches @@ -920,17 +913,6 @@ The %{origin_nice} %{featurever} libraries for static linking - portable edition # staticlibs %endif -%if %{include_normal_build} -%package unstripped -Summary: The %{origin_nice} %{featurever} runtime environment. - -%{java_unstripped_rpo %{nil}} - -%description unstripped -The %{origin_nice} %{featurever} runtime environment. - -%endif - %if %{include_normal_build} %package docs Summary: %{origin_nice} %{featurever} API documentation @@ -1083,14 +1065,6 @@ gcc ${EXTRA_CFLAGS} -o %{altjavaoutputdir}/%{alt_java_name} %{SOURCE11} echo "Building %{newjavaver}-%{buildver}, pre=%{ea_designator}, opt=%{lts_designator}" -function create_jlink_argfile() { - local argfile=${1} - - # Ensure parent directory exists - mkdir -p $(dirname ${argfile}) - echo "--sha-overrides=@\${java.home}/conf/runtimelink-sha-overrides.conf" > ${argfile} -} - function buildjdk() { local outputdir=${1} local buildjdk=${2} @@ -1101,8 +1075,6 @@ function buildjdk() { local top_dir_abs_src_path=$(pwd)/%{top_level_dir_name} local top_dir_abs_build_path=$(pwd)/${outputdir} - # Only used for "internal" debug symbols builds - local jlink_args_file=$top_dir_abs_build_path/jlink-args-file # This must be set using the global, so that the # static libraries still use a dynamic stdc++lib @@ -1112,9 +1084,6 @@ function buildjdk() { libc_link_opt="dynamic"; fi - jlink_flags="--save-jlink-argfiles=${jlink_args_file}" - create_jlink_argfile ${jlink_args_file} - echo "Using output directory: ${outputdir}"; echo "Checking build JDK ${buildjdk} is operational..." ${buildjdk}/bin/java -version @@ -1122,9 +1091,6 @@ function buildjdk() { echo "Using debuglevel: ${debuglevel}" echo "Using link_opt: ${link_opt}" echo "Using debug_symbols: ${debug_symbols}" - if [ -n "${jlink_flags}" ]; then - echo "Using extra jlink flags: '${jlink_flags}'" - fi echo "Building %{newjavaver}-%{buildver}, pre=%{ea_designator}, opt=%{lts_designator}" mkdir -p ${outputdir} @@ -1159,7 +1125,6 @@ function buildjdk() { --enable-unlimited-crypto \ --enable-linkable-runtime \ --enable-keep-packaged-modules \ - --with-extra-jlink-flags="${jlink_flags}" \ --with-zlib=%{link_type} \ --with-freetype=%{link_type} \ --with-libjpeg=${link_opt} \ @@ -1192,59 +1157,11 @@ function buildjdk() { popd } -function stripjdk() { - local outputdir=${1} - local jdkimagepath=${outputdir}/images/%{jdkimage} - local jreimagepath=${outputdir}/images/%{jreimage} - local jmodimagepath=${outputdir}/images/jmods - local supportdir=${outputdir}/support - - if [ "x$suffix" = "x" ] ; then - # Keep the unstripped version for consumption by RHEL RPMs - cp -a ${jdkimagepath}{,.unstripped} - - # Strip the files - for file in $(find ${jdkimagepath} ${jreimagepath} ${supportdir} -type f) ; do - if file ${file} | grep -q 'ELF'; then - noextfile=${file/.so/}; - objcopy --only-keep-debug ${file} ${noextfile}.debuginfo; - objcopy --add-gnu-debuglink=${noextfile}.debuginfo ${file}; - strip -g ${file}; - fi - done - - # Rebuild jmod files against the stripped binaries - if [ ! -d ${supportdir} ] ; then - echo "Support directory missing."; - exit 15 - fi - for cmd in $(find ${supportdir} -name '*.jmod_exec.cmdline') ; do - pre=${cmd/_exec/_pre}; - post=${cmd/_exec/_post}; - jmod=$(echo ${cmd}|sed 's#.*_create_##'|sed 's#_exec.cmdline##') - echo "Rebuilding ${jmod} against stripped binaries..."; - if [ -e ${pre} ] ; then - echo "Executing ${pre}..."; - cat ${pre} | sh -s ; - fi - echo "Executing ${cmd}..."; - cat ${cmd} | sh -s ; - if [ -e ${post} ] ; then - echo "Executing ${post}..."; - cat ${post} | sh -s ; - fi - done - rm -rf ${jdkimagepath}/jmods - cp -a ${jmodimagepath} ${jdkimagepath} - fi -} - function installjdk() { local outputdir=${1} local installdir=${2} local jdkimagepath=${installdir}/images/%{jdkimage} local jreimagepath=${installdir}/images/%{jreimage} - local unstripped=${jdkimagepath}.unstripped echo "Installing build from ${outputdir} to ${installdir}..." mkdir -p ${installdir} @@ -1273,7 +1190,7 @@ function installjdk() { fi; done - for imagepath in ${jdkimagepath} ${jreimagepath} ${unstripped}; do + for imagepath in ${jdkimagepath} ${jreimagepath}; do if [ -d ${imagepath} ] ; then # the build (erroneously) removes read permissions from some jars @@ -1365,13 +1282,11 @@ function packagejdk() { jdkname=%{jdkportablename -- "$nameSuffix"} jdkarchive=${packagesdir}/%{jdkportablearchive -- "$nameSuffix"} - jmodsarchive=${packagesdir}/%{jmodsportablearchive -- "$nameSuffix"} jrename=%{jreportablename -- "$nameSuffix"} jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"} staticname=%{staticlibsportablename -- "$nameSuffix"} staticarchive=${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"} debugarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.debuginfo"} - unstrippedarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.unstripped"} if [ "x$suffix" = "x" ] ; then docname=%{docportablename} docarchive=${packagesdir}/%{docportablearchive} @@ -1381,14 +1296,6 @@ function packagejdk() { miscname=%{miscportablename} miscarchive=${packagesdir}/%{miscportablearchive} - if [ "x$suffix" = "x" ] ; then - # Keep the unstripped version for consumption by RHEL RPMs - mv %{jdkimage}.unstripped ${jdkname} - tar -cJf ${unstrippedarchive} ${jdkname} - genchecksum ${unstrippedarchive} - mv ${jdkname} %{jdkimage}.unstripped - fi - # Rename directories for packaging mv %{jdkimage} ${jdkname} mv %{jreimage} ${jrename} @@ -1417,11 +1324,6 @@ function packagejdk() { genchecksum ${miscarchive} fi - tar -cJf ${jmodsarchive} --exclude='**.debuginfo' ${jdkname}/jmods - genchecksum ${jmodsarchive} - - rm -rv ${jdkname}/jmods - tar -cJf ${jdkarchive} --exclude='**.debuginfo' ${jdkname} genchecksum ${jdkarchive} @@ -1465,10 +1367,14 @@ for suffix in %{build_loop} ; do # change --something to something debugbuild=`echo $suffix | sed "s/-//g"` fi - # We build with internal debug symbols and do - # our own stripping for one version of the - # release build - debug_symbols=internal + # We build with 'external' debug symbols for the + # release build and build with 'internal' for + # slowdebug/fastdebug variants + if [ "x$suffix" = "x" ] ; then + debug_symbols=external + else + debug_symbols=internal + fi builddir=%{buildoutputdir -- ${suffix}} bootbuilddir=boot${builddir} @@ -1498,19 +1404,14 @@ for suffix in %{build_loop} ; do installjdk ${bootbuilddir} ${bootinstalldir} buildjdk ${builddir} $(pwd)/${bootinstalldir}/images/%{jdkimage} "${maketargets}" ${debugbuild} ${link_opt} ${debug_symbols} findgeneratedsources ${installdir} ${builddir} $(pwd)/%{top_level_dir_name} - stripjdk ${builddir} installjdk ${builddir} ${installdir} %{!?with_artifacts:rm -rf ${bootinstalldir}} else buildjdk ${builddir} ${systemjdk} "${maketargets}" ${debugbuild} ${link_opt} ${debug_symbols} findgeneratedsources ${installdir} ${builddir} $(pwd)/%{top_level_dir_name} - stripjdk ${builddir} installjdk ${builddir} ${installdir} fi - pushd ${installdir}/images/jdk/ - ./bin/java --add-opens=jdk.jlink/jdk.tools.jlink.internal.runtimelink=ALL-UNNAMED %{SOURCE19} ./conf/runtimelink-sha-overrides.conf - popd packagejdk ${installdir} ${packagesdir} %{altjavaoutputdir} %if %{system_libs} @@ -1703,16 +1604,12 @@ for suffix in %{build_loop} ; do # These definitions should match those in installjdk jdkarchive=${packagesdir}/%{jdkportablearchive -- "$nameSuffix"} - jmodsarchive=${packagesdir}/%{jmodsportablearchive -- "$nameSuffix"} jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"} staticarchive=${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"} debugarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.debuginfo"} - unstrippedarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.unstripped"} mv ${jdkarchive} $RPM_BUILD_ROOT%{_jvmdir}/ mv ${jdkarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ - mv ${jmodsarchive} $RPM_BUILD_ROOT%{_jvmdir}/ - mv ${jmodsarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ mv ${jrearchive} $RPM_BUILD_ROOT%{_jvmdir}/ mv ${jrearchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ @@ -1724,8 +1621,6 @@ for suffix in %{build_loop} ; do if [ "x$suffix" = "x" ] ; then mv ${debugarchive} $RPM_BUILD_ROOT%{_jvmdir}/ mv ${debugarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ - mv ${unstrippedarchive} $RPM_BUILD_ROOT%{_jvmdir}/ - mv ${unstrippedarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ fi done @@ -1762,8 +1657,6 @@ done %{_jvmdir}/%{jdkportablearchive -- .debuginfo} %{_jvmdir}/%{jdkportablearchiveForFiles}.sha256sum %{_jvmdir}/%{jdkportablearchive -- .debuginfo}.sha256sum -%{_jvmdir}/%{jmodsportablearchiveForFiles} -%{_jvmdir}/%{jmodsportablearchiveForFiles}.sha256sum %endif %if %{include_normal_build} @@ -1772,10 +1665,6 @@ done %{_jvmdir}/%{staticlibsportablearchiveForFiles} %{_jvmdir}/%{staticlibsportablearchiveForFiles}.sha256sum %endif - -%files unstripped -%{_jvmdir}/%{jdkportablearchive -- .unstripped} -%{_jvmdir}/%{jdkportablearchive -- .unstripped}.sha256sum %endif %if %{include_debug_build} @@ -1786,8 +1675,6 @@ done %files devel-slowdebug %{_jvmdir}/%{jdkportablearchive -- .slowdebug} %{_jvmdir}/%{jdkportablearchive -- .slowdebug}.sha256sum -%{_jvmdir}/%{jmodsportablearchive -- .slowdebug} -%{_jvmdir}/%{jmodsportablearchive -- .slowdebug}.sha256sum %if %{include_staticlibs} %files static-libs-slowdebug @@ -1804,8 +1691,6 @@ done %files devel-fastdebug %{_jvmdir}/%{jdkportablearchive -- .fastdebug} %{_jvmdir}/%{jdkportablearchive -- .fastdebug}.sha256sum -%{_jvmdir}/%{jmodsportablearchive -- .fastdebug} -%{_jvmdir}/%{jmodsportablearchive -- .fastdebug}.sha256sum %if %{include_staticlibs} %files static-libs-fastdebug From 73e20c5c38bc1f050ec9c617582b87c9e3dd9c80 Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Thu, 24 Apr 2025 15:08:54 +0200 Subject: [PATCH 67/86] Add patches for JDK-8353185 and JDK-8350137 Those are in the July CPU update (24.0.2). Add them ahead of time. --- ...K-8348975-Linux-builds-contain-man-p.patch | 55 +++ ...e-the-concept-of-upgradeable-files-i.patch | 381 ++++++++++++++++++ java-latest-openjdk-portable.spec | 8 + 3 files changed, 444 insertions(+) create mode 100644 0001-8350137-After-JDK-8348975-Linux-builds-contain-man-p.patch create mode 100644 0001-8353185-Introduce-the-concept-of-upgradeable-files-i.patch diff --git a/0001-8350137-After-JDK-8348975-Linux-builds-contain-man-p.patch b/0001-8350137-After-JDK-8348975-Linux-builds-contain-man-p.patch new file mode 100644 index 0000000..c5a9c5c --- /dev/null +++ b/0001-8350137-After-JDK-8348975-Linux-builds-contain-man-p.patch @@ -0,0 +1,55 @@ +From ef35e66937108b56742e4f1b9faddf7379aed805 Mon Sep 17 00:00:00 2001 +From: Nizar Benalla +Date: Wed, 26 Feb 2025 17:16:16 +0000 +Subject: [PATCH] 8350137: After JDK-8348975, Linux builds contain man pages + for windows only tools + +Backport-of: 53db57648a09c4c380064eea11fcdb680011d741 +--- + make/Docs.gmk | 2 +- + make/common/Modules.gmk | 9 ++++++++- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/make/Docs.gmk b/make/Docs.gmk +index fb2726e6dad..a75d8c74b7c 100644 +--- a/make/Docs.gmk ++++ b/make/Docs.gmk +@@ -680,7 +680,7 @@ ifeq ($(ENABLE_PANDOC), true) + + $(foreach m, $(ALL_MODULES), \ + $(eval MAN_$m := $(call ApplySpecFilter, $(filter %.md, $(call FindFiles, \ +- $(call FindModuleManDirs, $m))))) \ ++ $(call FindModuleManDirsForDocs, $m))))) \ + $(if $(MAN_$m), \ + $(eval $(call SetupProcessMarkdown, MAN_TO_HTML_$m, \ + FILES := $(MAN_$m), \ +diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk +index c8c78ed8041..f87e240ad62 100644 +--- a/make/common/Modules.gmk ++++ b/make/common/Modules.gmk +@@ -92,7 +92,10 @@ SRC_SUBDIRS += share/classes + + SPEC_SUBDIRS += share/specs + +-MAN_SUBDIRS += share/man windows/man ++MAN_SUBDIRS += share/man $(TARGET_OS)/man ++ ++# The docs should include the sum of all man pages for all platforms ++MAN_DOCS_SUBDIRS += share/man windows/man + + # Find all module-info.java files for the current build target platform and + # configuration. +@@ -158,6 +161,10 @@ FindModuleManDirs = \ + $(strip $(wildcard \ + $(foreach sub, $(MAN_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS))))) + ++FindModuleManDirsForDocs = \ ++ $(strip $(wildcard \ ++ $(foreach sub, $(MAN_DOCS_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS))))) ++ + # Construct the complete module source path + GetModuleSrcPath = \ + $(call PathList, \ +-- +2.49.0 + diff --git a/0001-8353185-Introduce-the-concept-of-upgradeable-files-i.patch b/0001-8353185-Introduce-the-concept-of-upgradeable-files-i.patch new file mode 100644 index 0000000..829dc76 --- /dev/null +++ b/0001-8353185-Introduce-the-concept-of-upgradeable-files-i.patch @@ -0,0 +1,381 @@ +From 2c314dcb723d9c5df255761c3016b25fd8fb501e Mon Sep 17 00:00:00 2001 +From: Severin Gehwolf +Date: Thu, 17 Apr 2025 11:44:15 +0000 +Subject: [PATCH] 8353185: Introduce the concept of upgradeable files in + context of JEP 493 + +Backport-of: 4e24dc003c2304041b342371adf430b120a9fec8 +--- + make/modules/jdk.jlink/Java.gmk | 32 ++++ + .../jdk/tools/jlink/internal/JRTArchive.java | 22 ++- + .../jlink/internal/LinkableRuntimeImage.java | 47 +++++- + .../runtimelink/upgrade_files_java.base.conf | 4 + + .../UpgradeableFileCacertsTest.java | 153 ++++++++++++++++++ + 5 files changed, 254 insertions(+), 4 deletions(-) + create mode 100644 make/modules/jdk.jlink/Java.gmk + create mode 100644 src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf + create mode 100644 test/jdk/tools/jlink/runtimeImage/UpgradeableFileCacertsTest.java + +diff --git a/make/modules/jdk.jlink/Java.gmk b/make/modules/jdk.jlink/Java.gmk +new file mode 100644 +index 00000000000..4ddd1eab03d +--- /dev/null ++++ b/make/modules/jdk.jlink/Java.gmk +@@ -0,0 +1,32 @@ ++# ++# Copyright (c) 2025, 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 ++# 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. ++# ++ ++################################################################################ ++ ++# Instruct SetupJavaCompilation for the jdk.jlink module to include ++# upgrade_files_.conf files ++COPY += .conf ++ ++################################################################################ +diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java +index df7d35ac777..aac220e5b94 100644 +--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java ++++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java +@@ -45,6 +45,7 @@ + import java.util.List; + import java.util.Map; + import java.util.Objects; ++import java.util.Set; + import java.util.function.Function; + import java.util.function.Predicate; + import java.util.stream.Collectors; +@@ -76,6 +77,7 @@ public class JRTArchive implements Archive { + private final Map resDiff; + private final boolean errorOnModifiedFile; + private final TaskHelper taskHelper; ++ private final Set upgradeableFiles; + + /** + * JRTArchive constructor +@@ -86,12 +88,15 @@ public class JRTArchive implements Archive { + * install aborts the link. + * @param perModDiff The lib/modules (a.k.a jimage) diff for this module, + * possibly an empty list if there are no differences. ++ * @param taskHelper The task helper instance. ++ * @param upgradeableFiles The set of files that are allowed for upgrades. + */ + JRTArchive(String module, + Path path, + boolean errorOnModifiedFile, + List perModDiff, +- TaskHelper taskHelper) { ++ TaskHelper taskHelper, ++ Set upgradeableFiles) { + this.module = module; + this.path = path; + this.ref = ModuleFinder.ofSystem() +@@ -105,6 +110,7 @@ public class JRTArchive implements Archive { + this.resDiff = Objects.requireNonNull(perModDiff).stream() + .collect(Collectors.toMap(ResourceDiff::getName, Function.identity())); + this.taskHelper = taskHelper; ++ this.upgradeableFiles = upgradeableFiles; + } + + @Override +@@ -217,7 +223,8 @@ private void addNonClassResources() { + + // Read from the base JDK image. + Path path = BASE.resolve(m.resPath); +- if (shaSumMismatch(path, m.hashOrTarget, m.symlink)) { ++ if (!isUpgradeableFile(m.resPath) && ++ shaSumMismatch(path, m.hashOrTarget, m.symlink)) { + if (errorOnModifiedFile) { + String msg = taskHelper.getMessage("err.runtime.link.modified.file", path.toString()); + IOException cause = new IOException(msg); +@@ -239,6 +246,17 @@ private void addNonClassResources() { + } + } + ++ /** ++ * Certain files in a module are considered upgradeable. That is, ++ * their hash sums aren't checked. ++ * ++ * @param resPath The resource path of the file to check for upgradeability. ++ * @return {@code true} if the file is upgradeable. {@code false} otherwise. ++ */ ++ private boolean isUpgradeableFile(String resPath) { ++ return upgradeableFiles.contains(resPath); ++ } ++ + static boolean shaSumMismatch(Path res, String expectedSha, boolean isSymlink) { + if (isSymlink) { + return false; +diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java +index 935af4585ad..d564ed0bad8 100644 +--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java ++++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java +@@ -28,7 +28,10 @@ + import java.io.IOException; + import java.io.InputStream; + import java.nio.file.Path; ++import java.util.HashSet; + import java.util.List; ++import java.util.Scanner; ++import java.util.Set; + + import jdk.tools.jlink.internal.runtimelink.ResourceDiff; + +@@ -42,6 +45,9 @@ public class LinkableRuntimeImage { + public static final String RESPATH_PATTERN = "jdk/tools/jlink/internal/runtimelink/fs_%s_files"; + // The diff files per module for supporting linking from the run-time image + public static final String DIFF_PATTERN = "jdk/tools/jlink/internal/runtimelink/diff_%s"; ++ // meta data for upgradable files ++ private static final String UPGRADEABLE_FILES_PATTERN = "jdk/tools/jlink/internal/runtimelink/upgrade_files_%s.conf"; ++ private static final Module JDK_JLINK_MOD = LinkableRuntimeImage.class.getModule(); + + /** + * In order to be able to show whether or not a runtime is capable of +@@ -62,7 +68,38 @@ public static boolean isLinkableRuntime() { + + private static InputStream getDiffInputStream(String module) throws IOException { + String resourceName = String.format(DIFF_PATTERN, module); +- return LinkableRuntimeImage.class.getModule().getResourceAsStream(resourceName); ++ return JDK_JLINK_MOD.getResourceAsStream(resourceName); ++ } ++ ++ private static Set upgradeableFiles(String module) { ++ String resourceName = String.format(UPGRADEABLE_FILES_PATTERN, module); ++ InputStream filesIn = null; ++ try { ++ filesIn = JDK_JLINK_MOD.getResourceAsStream(resourceName); ++ } catch (IOException e) { ++ throw new AssertionError("Unexpected IO error getting res stream"); ++ } ++ if (filesIn == null) { ++ // no upgradeable files ++ return Set.of(); ++ } ++ Set upgradeableFiles = new HashSet<>(); ++ final InputStream in = filesIn; ++ try (in; ++ Scanner scanner = new Scanner(filesIn)) { ++ while (scanner.hasNextLine()) { ++ String line = scanner.nextLine(); ++ if (line.trim().startsWith("#")) { ++ // Skip comments ++ continue; ++ } ++ upgradeableFiles.add(scanner.nextLine()); ++ } ++ } catch (IOException e) { ++ throw new AssertionError("Failure to retrieve upgradeable files for " + ++ "module " + module, e); ++ } ++ return upgradeableFiles; + } + + public static Archive newArchive(String module, +@@ -81,7 +118,13 @@ public static Archive newArchive(String module, + throw new AssertionError("Failure to retrieve resource diff for " + + "module " + module, e); + } +- return new JRTArchive(module, path, !ignoreModifiedRuntime, perModuleDiff, taskHelper); ++ Set upgradeableFiles = upgradeableFiles(module); ++ return new JRTArchive(module, ++ path, ++ !ignoreModifiedRuntime, ++ perModuleDiff, ++ taskHelper, ++ upgradeableFiles); + } + + +diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf +new file mode 100644 +index 00000000000..df2ca809f08 +--- /dev/null ++++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf +@@ -0,0 +1,4 @@ ++# Configuration for resource paths of files allowed to be ++# upgraded (in java.base) ++lib/tzdb.dat ++lib/security/cacerts +diff --git a/test/jdk/tools/jlink/runtimeImage/UpgradeableFileCacertsTest.java b/test/jdk/tools/jlink/runtimeImage/UpgradeableFileCacertsTest.java +new file mode 100644 +index 00000000000..86e0f8cefd5 +--- /dev/null ++++ b/test/jdk/tools/jlink/runtimeImage/UpgradeableFileCacertsTest.java +@@ -0,0 +1,153 @@ ++/* ++ * Copyright (c) 2025, Red Hat, Inc. ++ * 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. ++ * ++ * 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. ++ */ ++ ++import java.io.ByteArrayInputStream; ++import java.io.ByteArrayOutputStream; ++import java.io.FileInputStream; ++import java.io.FileOutputStream; ++import java.io.IOException; ++import java.io.InputStream; ++import java.nio.file.Path; ++import java.security.KeyStore; ++import java.security.cert.Certificate; ++import java.security.cert.CertificateException; ++import java.security.cert.CertificateFactory; ++import java.security.cert.X509Certificate; ++ ++import jdk.test.lib.process.OutputAnalyzer; ++import tests.Helper; ++ ++/* ++ * @test ++ * @summary Verify that no errors are reported for files that have been ++ * upgraded when linking from the run-time image ++ * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) ++ * @library ../../lib /test/lib ++ * @modules java.base/jdk.internal.jimage ++ * jdk.jlink/jdk.tools.jlink.internal ++ * jdk.jlink/jdk.tools.jlink.plugin ++ * jdk.jlink/jdk.tools.jimage ++ * @build tests.* jdk.test.lib.process.OutputAnalyzer ++ * jdk.test.lib.process.ProcessTools ++ * @run main/othervm -Xmx1g UpgradeableFileCacertsTest ++ */ ++public class UpgradeableFileCacertsTest extends ModifiedFilesTest { ++ ++ /* ++ * Generated with: ++ * $ rm -f server.keystore && keytool -genkey -alias jlink-upgrade-test \ ++ * -keyalg RSA -dname CN=jlink-upgrade-test \ ++ * -storepass changeit -keysize 3072 -sigalg SHA512withRSA \ ++ * -validity 7300 -keystore server.keystore ++ * $ keytool -export -alias jlink-upgrade-test -storepass changeit \ ++ * -keystore server.keystore -rfc ++ */ ++ private static final String CERT = """ ++ -----BEGIN CERTIFICATE----- ++ MIID3jCCAkagAwIBAgIJALiT/+HXBkSIMA0GCSqGSIb3DQEBDQUAMB0xGzAZBgNV ++ BAMTEmpsaW5rLXVwZ3JhZGUtdGVzdDAeFw0yNTA0MDQxMjA3MjJaFw00NTAzMzAx ++ MjA3MjJaMB0xGzAZBgNVBAMTEmpsaW5rLXVwZ3JhZGUtdGVzdDCCAaIwDQYJKoZI ++ hvcNAQEBBQADggGPADCCAYoCggGBANmrnCDKqSXEJRIiSi4yHWN97ILls3RqYjED ++ la3AZTeXnZrrEIgSjVFUMxCztYqbWoVzKa2lov42Vue2BXVYffcQ8TKc2EJDNO+2 ++ uRKQZpsN7RI4QoVBR2Rq8emrO8CrdOQT7Hh4agxkN9AOvGKMFdt+fXeCIPIuflKP ++ f+RfvhLfC2A70Y+Uu74C5uWgLloA/HF0SsVxf9KmqS9fZBQaiTYhKyoDghCRlWpa ++ nPIHB1XVaRdw8aSpCuzIOQzSCTTlLcammJkBjbFwMZdQG7eglTWzIYryZwe/cyY2 ++ xctLVW3xhUHvnMFG+MajeFny2mxNu163Rxf/rBu4e7jRC/LGSU784nJGapq5K170 ++ WbaeceKp+YORJBviFFORrmkPIwIgE+iGCD6PD6Xwu8vcpeuTVDgsSWMlfgCL3NoI ++ GXmdGiI2Xc/hQX7uzu3UBF6IcPDMTcYr2JKYbgu3v2/vDlJu3qO2ycUeePo5jhuG ++ X2WgcHkb6uOU4W5qdbCA+wFPVZBuwQIDAQABoyEwHzAdBgNVHQ4EFgQUtMJM0+ct ++ ssKqryRckk4YEWdYAZkwDQYJKoZIhvcNAQENBQADggGBAI8A6gJQ8wDx12sy2ZI4 ++ 1q9b+WG6w3LcFEF6Fko5NBizhtfmVycQv4mBa/NJgx4DZmd+5d60gJcTp/hJXGY0 ++ LZyFilm/AgxsLNUUQLbHAV6TWqd3ODWwswAuew9sFU6izl286a9W65tbMWL5r1EA ++ t34ZYVWZYbCS9+czU98WomH4uarRAOlzcEUui3ZX6ZcQxWbz/R2wtKcUPUAYnsqH ++ JPivpE25G5xW2Dp/yeQTrlffq9OLgZWVz0jtOguBUMnsUsgCcpQZtqZX08//wtpz ++ ohLHFGvpXTPbRumRasWWtnRR/QqGRT66tYDqybXXz37UtKZ8VKW0sv2ypVbmAEs5 ++ pLkA/3XiXlstJuCD6cW0Gfbpb5rrPPD46O3FDVlmqlTH3b/MsiQREdydqGzqY7uG ++ AA2GFVaKFASA5ls01CfHLAcrKxSVixditXvsjeIqhddB7Pnbsx20RdzPQoeo9/hF ++ WeIrh4zePDPZChuLR8ZyxeVJhLB71nTrTDDjwXarVez9Xw== ++ -----END CERTIFICATE----- ++ """; ++ ++ private static final String CERT_ALIAS = "jlink-upgrade-test"; ++ ++ public static void main(String[] args) throws Exception { ++ UpgradeableFileCacertsTest test = new UpgradeableFileCacertsTest(); ++ test.run(); ++ } ++ ++ @Override ++ String initialImageName() { ++ return "java-base-jlink-upgrade-cacerts"; ++ } ++ ++ @Override ++ void testAndAssert(Path modifiedFile, Helper helper, Path initialImage) throws Exception { ++ CapturingHandler handler = new CapturingHandler(); ++ jlinkUsingImage(new JlinkSpecBuilder() ++ .helper(helper) ++ .imagePath(initialImage) ++ .name("java-base-jlink-upgrade-cacerts-target") ++ .addModule("java.base") ++ .validatingModule("java.base") ++ .build(), handler); ++ OutputAnalyzer analyzer = handler.analyzer(); ++ // verify we don't get any modified warning ++ analyzer.stdoutShouldNotContain(modifiedFile.toString() + " has been modified"); ++ analyzer.stdoutShouldNotContain("java.lang.IllegalArgumentException"); ++ analyzer.stdoutShouldNotContain("IOException"); ++ } ++ ++ // Add an extra certificate in the cacerts file so that it no longer matches ++ // the recorded hash sum at build time. ++ protected Path modifyFileInImage(Path jmodLessImg) ++ throws IOException, AssertionError { ++ Path cacerts = jmodLessImg.resolve(Path.of("lib", "security", "cacerts")); ++ try (FileInputStream fin = new FileInputStream(cacerts.toFile())) { ++ KeyStore certStore = KeyStore.getInstance(cacerts.toFile(), ++ (char[])null); ++ certStore.load(fin, (char[])null); ++ X509Certificate cert; ++ try (ByteArrayInputStream bin = new ByteArrayInputStream(CERT.getBytes())) { ++ cert = (X509Certificate)generateCertificate(bin); ++ } catch (ClassCastException | CertificateException ce) { ++ throw new AssertionError("Test failed unexpectedly", ce); ++ } ++ certStore.setCertificateEntry(CERT_ALIAS, cert); ++ ByteArrayOutputStream bout = new ByteArrayOutputStream(); ++ certStore.store(bout, (char[])null); ++ try (FileOutputStream fout = new FileOutputStream(cacerts.toFile())) { ++ fout.write(bout.toByteArray()); ++ } ++ } catch (Exception e) { ++ throw new AssertionError("Test failed unexpectedly: ", e); ++ } ++ return cacerts; ++ } ++ ++ private Certificate generateCertificate(InputStream in) ++ throws CertificateException, IOException { ++ byte[] data = in.readAllBytes(); ++ return CertificateFactory.getInstance("X.509") ++ .generateCertificate(new ByteArrayInputStream(data)); ++ } ++} +-- +2.49.0 + diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 1375e1a..dd942ea 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -701,6 +701,10 @@ Patch1100: 0001-Fix-name-class-of-uabs-with-GCC-15.patch # OpenJDK patches which missed last update # ############################################# +# JDK-8350137: After JDK-8348975, Linux builds contain man pages for windows only tools +Patch2000: 0001-8350137-After-JDK-8348975-Linux-builds-contain-man-p.patch +# JDK-8353185: Introduce the concept of upgradeable files in context of JEP 493 +Patch2001: 0001-8353185-Introduce-the-concept-of-upgradeable-files-i.patch ############################################# # @@ -996,6 +1000,10 @@ pushd %{top_level_dir_name} # Skipping fips patch whil eit is not ready for jdk22 %%patch -P1001 -p1 # Patches in need of upstreaming %patch -P1100 -p1 + +# Patches not yet in 24.0.1 +%patch -P2000 -p1 +%patch -P2001 -p1 popd # openjdk From f3a237805c6c7b6d9af0673abcda2e1f2d22ada5 Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Fri, 25 Apr 2025 10:44:59 +0200 Subject: [PATCH 68/86] Add patch for JDK-8355524, fixing a bug in JDK-8353185 There was a bug in the patch of JDK-8353185 which made the tzdb.dat upgrade to not work. --- ...ry-second-line-in-upgradeable-files-.patch | 38 +++++++++++++++++++ java-latest-openjdk-portable.spec | 3 ++ 2 files changed, 41 insertions(+) create mode 100644 0001-8355524-Only-every-second-line-in-upgradeable-files-.patch diff --git a/0001-8355524-Only-every-second-line-in-upgradeable-files-.patch b/0001-8355524-Only-every-second-line-in-upgradeable-files-.patch new file mode 100644 index 0000000..6c1c4e9 --- /dev/null +++ b/0001-8355524-Only-every-second-line-in-upgradeable-files-.patch @@ -0,0 +1,38 @@ +From 89f9268ed7c2cb86891f23a10482cd459454bd32 Mon Sep 17 00:00:00 2001 +From: Severin Gehwolf +Date: Fri, 25 Apr 2025 08:20:51 +0000 +Subject: [PATCH] 8355524: Only every second line in upgradeable files is being + used + +Reviewed-by: shade, alanb +--- + .../classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java | 2 +- + .../jlink/internal/runtimelink/upgrade_files_java.base.conf | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java +index d564ed0bad8..30c37961829 100644 +--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java ++++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java +@@ -93,7 +93,7 @@ private static Set upgradeableFiles(String module) { + // Skip comments + continue; + } +- upgradeableFiles.add(scanner.nextLine()); ++ upgradeableFiles.add(line); + } + } catch (IOException e) { + throw new AssertionError("Failure to retrieve upgradeable files for " + +diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf +index df2ca809f08..fc5e7b4f328 100644 +--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf ++++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf +@@ -1,4 +1,4 @@ + # Configuration for resource paths of files allowed to be + # upgraded (in java.base) +-lib/tzdb.dat + lib/security/cacerts ++lib/tzdb.dat +-- +2.49.0 + diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index dd942ea..ae8b5aa 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -705,6 +705,8 @@ Patch1100: 0001-Fix-name-class-of-uabs-with-GCC-15.patch Patch2000: 0001-8350137-After-JDK-8348975-Linux-builds-contain-man-p.patch # JDK-8353185: Introduce the concept of upgradeable files in context of JEP 493 Patch2001: 0001-8353185-Introduce-the-concept-of-upgradeable-files-i.patch +# JDK-8355524: Only every second line in upgradeable files is being used +Patch2002: 0001-8355524-Only-every-second-line-in-upgradeable-files-.patch ############################################# # @@ -1004,6 +1006,7 @@ pushd %{top_level_dir_name} # Patches not yet in 24.0.1 %patch -P2000 -p1 %patch -P2001 -p1 +%patch -P2002 -p1 popd # openjdk From fa56012985d6102e58684fde46ef4abf1d920e19 Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Mon, 28 Apr 2025 16:49:07 +0200 Subject: [PATCH 69/86] Add --disable-absolute-paths-in-output to not need debugedit The non-portable version of the build uses debugedit to modify built in paths to source files in debuginfo files. By setting --disable-absolute-paths-in-output we enable features added by JDK-8323667 and JDK-8284437. This feature was already implicitly used by the release build. Align release and fastdebug/slowdebug builds. --- java-latest-openjdk-portable.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index ae8b5aa..846b52f 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1133,6 +1133,7 @@ function buildjdk() { --with-boot-jdk=${buildjdk} \ --with-debug-level=${debuglevel} \ --with-native-debug-symbols="${debug_symbols}" \ + --disable-absolute-paths-in-output \ --enable-unlimited-crypto \ --enable-linkable-runtime \ --enable-keep-packaged-modules \ From 2681c6e177dfa790b5c993cb33ecb4ae1916a60f Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Mon, 12 May 2025 16:33:29 +0200 Subject: [PATCH 70/86] Re-introduce JMODs archive tarball --- java-latest-openjdk-portable.spec | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 846b52f..e04275e 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1294,6 +1294,7 @@ function packagejdk() { jdkname=%{jdkportablename -- "$nameSuffix"} jdkarchive=${packagesdir}/%{jdkportablearchive -- "$nameSuffix"} + jmodsarchive=${packagesdir}/%{jmodsportablearchive -- "$nameSuffix"} jrename=%{jreportablename -- "$nameSuffix"} jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"} staticname=%{staticlibsportablename -- "$nameSuffix"} @@ -1336,6 +1337,10 @@ function packagejdk() { genchecksum ${miscarchive} fi + tar -cJf ${jmodsarchive} --exclude='**.debuginfo' ${jdkname}/jmods + genchecksum ${jmodsarchive} + rm -rv ${jdkname}/jmods + tar -cJf ${jdkarchive} --exclude='**.debuginfo' ${jdkname} genchecksum ${jdkarchive} @@ -1616,12 +1621,15 @@ for suffix in %{build_loop} ; do # These definitions should match those in installjdk jdkarchive=${packagesdir}/%{jdkportablearchive -- "$nameSuffix"} + jmodsarchive=${packagesdir}/%{jmodsportablearchive -- "$nameSuffix"} jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"} staticarchive=${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"} debugarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.debuginfo"} mv ${jdkarchive} $RPM_BUILD_ROOT%{_jvmdir}/ mv ${jdkarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ + mv ${jmodsarchive} $RPM_BUILD_ROOT%{_jvmdir}/ + mv ${jmodsarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ mv ${jrearchive} $RPM_BUILD_ROOT%{_jvmdir}/ mv ${jrearchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/ @@ -1669,6 +1677,8 @@ done %{_jvmdir}/%{jdkportablearchive -- .debuginfo} %{_jvmdir}/%{jdkportablearchiveForFiles}.sha256sum %{_jvmdir}/%{jdkportablearchive -- .debuginfo}.sha256sum +%{_jvmdir}/%{jmodsportablearchiveForFiles} +%{_jvmdir}/%{jmodsportablearchiveForFiles}.sha256sum %endif %if %{include_normal_build} @@ -1687,6 +1697,8 @@ done %files devel-slowdebug %{_jvmdir}/%{jdkportablearchive -- .slowdebug} %{_jvmdir}/%{jdkportablearchive -- .slowdebug}.sha256sum +%{_jvmdir}/%{jmodsportablearchive -- .slowdebug} +%{_jvmdir}/%{jmodsportablearchive -- .slowdebug}.sha256sum %if %{include_staticlibs} %files static-libs-slowdebug @@ -1703,6 +1715,8 @@ done %files devel-fastdebug %{_jvmdir}/%{jdkportablearchive -- .fastdebug} %{_jvmdir}/%{jdkportablearchive -- .fastdebug}.sha256sum +%{_jvmdir}/%{jmodsportablearchive -- .fastdebug} +%{_jvmdir}/%{jmodsportablearchive -- .fastdebug}.sha256sum %if %{include_staticlibs} %files static-libs-fastdebug From 87c794a095ad8f5cdf191408eddf60d8156b2a7c Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Tue, 29 Apr 2025 12:59:48 +0200 Subject: [PATCH 71/86] Update to upstream patch for glibc 2.42 build failure --- 0001-Fix-name-class-of-uabs-with-GCC-15.patch | 102 +++++++----------- 1 file changed, 38 insertions(+), 64 deletions(-) diff --git a/0001-Fix-name-class-of-uabs-with-GCC-15.patch b/0001-Fix-name-class-of-uabs-with-GCC-15.patch index 0825c72..a5031f9 100644 --- a/0001-Fix-name-class-of-uabs-with-GCC-15.patch +++ b/0001-Fix-name-class-of-uabs-with-GCC-15.patch @@ -1,35 +1,18 @@ -From 0fd5cab226219eda13b8d3864797bea034ed3f70 Mon Sep 17 00:00:00 2001 -From: Severin Gehwolf -Date: Thu, 17 Apr 2025 11:48:31 +0200 -Subject: [PATCH] Fix name class of uabs with GCC 15 - ---- - src/hotspot/cpu/aarch64/assembler_aarch64.cpp | 2 +- - src/hotspot/cpu/aarch64/assembler_aarch64.hpp | 2 +- - src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp | 2 +- - src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp | 4 ++-- - src/hotspot/cpu/riscv/assembler_riscv.hpp | 2 +- - src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 4 ++-- - src/hotspot/share/opto/mulnode.cpp | 4 ++-- - src/hotspot/share/opto/subnode.cpp | 4 ++-- - src/hotspot/share/utilities/globalDefinitions.hpp | 12 ++++++++---- - 9 files changed, 20 insertions(+), 16 deletions(-) - diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp -index 76f88764416..946bf1c4406 100644 +index b03344f2d80..ec4f2a0d6c3 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp -@@ -457,7 +457,7 @@ void Assembler::bang_stack_with_offset(int offset) { Unimplemented(); } +@@ -456,7 +456,7 @@ void Assembler::bang_stack_with_offset(int offset) { Unimplemented(); } bool asm_util::operand_valid_for_immediate_bits(int64_t imm, unsigned nbits) { guarantee(nbits == 8 || nbits == 12, "invalid nbits value"); - uint64_t uimm = (uint64_t)uabs((jlong)imm); -+ uint64_t uimm = (uint64_t)UABS((jlong)imm); ++ uint64_t uimm = (uint64_t)g_uabs((jlong)imm); if (uimm < (UCONST64(1) << nbits)) return true; if (uimm < (UCONST64(1) << (2 * nbits)) diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp -index a5e0e2665af..639af579d9f 100644 +index 5c02e30963e..aee4a30b649 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp @@ -932,7 +932,7 @@ class Assembler : public AbstractAssembler { @@ -37,112 +20,112 @@ index a5e0e2665af..639af579d9f 100644 static bool reachable_from_branch_at(address branch, address target) { - return uabs(target - branch) < branch_range; -+ return UABS(target - branch) < branch_range; ++ return g_uabs(target - branch) < branch_range; } // Unconditional branch (immediate) diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp -index d561fb912a3..3a7d2b96ecf 100644 +index fd6af0b9b4b..b6aa54b27a4 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp -@@ -3271,7 +3271,7 @@ void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, uint64_t im +@@ -3267,7 +3267,7 @@ void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, uint64_t im if (fits) { (this->*insn1)(Rd, Rn, imm); } else { - if (uabs(imm) < (1 << 24)) { -+ if (UABS(imm) < (1 << 24)) { ++ if (g_uabs(imm) < (1 << 24)) { (this->*insn1)(Rd, Rn, imm & -(1 << 12)); (this->*insn1)(Rd, Rd, imm & ((1 << 12)-1)); } else { diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp -index de5df5c1af1..0acac529a20 100644 +index f5567dcc03a..0843489900c 100644 --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp -@@ -1133,7 +1133,7 @@ class StubGenerator: public StubCodeGenerator { +@@ -1162,7 +1162,7 @@ class StubGenerator: public StubCodeGenerator { void copy_memory_small(DecoratorSet decorators, BasicType type, Register s, Register d, Register count, int step) { bool is_backwards = step < 0; - size_t granularity = uabs(step); -+ size_t granularity = UABS(step); ++ size_t granularity = g_uabs(step); int direction = is_backwards ? -1 : 1; Label Lword, Lint, Lshort, Lbyte; -@@ -1192,7 +1192,7 @@ class StubGenerator: public StubCodeGenerator { +@@ -1221,7 +1221,7 @@ class StubGenerator: public StubCodeGenerator { Register s, Register d, Register count, int step) { copy_direction direction = step < 0 ? copy_backwards : copy_forwards; bool is_backwards = step < 0; - unsigned int granularity = uabs(step); -+ unsigned int granularity = UABS(step); ++ unsigned int granularity = g_uabs(step); const Register t0 = r3, t1 = r4; // <= 80 (or 96 for SIMD) bytes do inline. Direction doesn't matter because we always diff --git a/src/hotspot/cpu/riscv/assembler_riscv.hpp b/src/hotspot/cpu/riscv/assembler_riscv.hpp -index 31713d7362a..e193cf9fbb7 100644 +index 4773043e1ba..4a19b577d9f 100644 --- a/src/hotspot/cpu/riscv/assembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/assembler_riscv.hpp -@@ -3393,7 +3393,7 @@ enum Nf { +@@ -3818,7 +3818,7 @@ enum Nf { static const unsigned long branch_range = 1 * M; static bool reachable_from_branch_at(address branch, address target) { - return uabs(target - branch) < branch_range; -+ return UABS(target - branch) < branch_range; ++ return g_uabs(target - branch) < branch_range; } // Decode the given instruction, checking if it's a 16-bit compressed diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp -index 7e6fe50e8f8..35192700673 100644 +index fb4539267ae..e6bbd32bd3e 100644 --- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp -@@ -874,7 +874,7 @@ class StubGenerator: public StubCodeGenerator { +@@ -886,7 +886,7 @@ class StubGenerator: public StubCodeGenerator { void copy_memory_v(Register s, Register d, Register count, int step) { bool is_backward = step < 0; - int granularity = uabs(step); -+ int granularity = UABS(step); ++ int granularity = g_uabs(step); const Register src = x30, dst = x31, vl = x14, cnt = x15, tmp1 = x16, tmp2 = x17; assert_different_registers(s, d, cnt, vl, tmp1, tmp2); -@@ -936,7 +936,7 @@ class StubGenerator: public StubCodeGenerator { +@@ -948,7 +948,7 @@ class StubGenerator: public StubCodeGenerator { } bool is_backwards = step < 0; - int granularity = uabs(step); -+ int granularity = UABS(step); ++ int granularity = g_uabs(step); const Register src = x30, dst = x31, cnt = x15, tmp3 = x16, tmp4 = x17, tmp5 = x14, tmp6 = x13; const Register gct1 = x28, gct2 = x29, gct3 = t2; diff --git a/src/hotspot/share/opto/mulnode.cpp b/src/hotspot/share/opto/mulnode.cpp -index ad98fda025f..a51024eb578 100644 +index 72562a657ea..4691c6a45b0 100644 --- a/src/hotspot/share/opto/mulnode.cpp +++ b/src/hotspot/share/opto/mulnode.cpp -@@ -245,7 +245,7 @@ Node *MulINode::Ideal(PhaseGVN *phase, bool can_reshape) { +@@ -258,7 +258,7 @@ Node *MulINode::Ideal(PhaseGVN *phase, bool can_reshape) { // Check for negative constant; if so negate the final result bool sign_flip = false; - unsigned int abs_con = uabs(con); -+ unsigned int abs_con = UABS(con); ++ unsigned int abs_con = g_uabs(con); if (abs_con != (unsigned int)con) { sign_flip = true; } -@@ -480,7 +480,7 @@ Node *MulLNode::Ideal(PhaseGVN *phase, bool can_reshape) { +@@ -493,7 +493,7 @@ Node *MulLNode::Ideal(PhaseGVN *phase, bool can_reshape) { // Check for negative constant; if so negate the final result bool sign_flip = false; - julong abs_con = uabs(con); -+ julong abs_con = UABS(con); ++ julong abs_con = g_uabs(con); if (abs_con != (julong)con) { sign_flip = true; } diff --git a/src/hotspot/share/opto/subnode.cpp b/src/hotspot/share/opto/subnode.cpp -index f1eca4682bd..a79c1c86e96 100644 +index d1384384101..aaf53f80b8b 100644 --- a/src/hotspot/share/opto/subnode.cpp +++ b/src/hotspot/share/opto/subnode.cpp -@@ -1923,14 +1923,14 @@ const Type* AbsNode::Value(PhaseGVN* phase) const { +@@ -1943,14 +1943,14 @@ const Type* AbsNode::Value(PhaseGVN* phase) const { case Type::Int: { const TypeInt* ti = t1->is_int(); if (ti->is_con()) { - return TypeInt::make(uabs(ti->get_con())); -+ return TypeInt::make(UABS(ti->get_con())); ++ return TypeInt::make(g_uabs(ti->get_con())); } break; } @@ -150,49 +133,40 @@ index f1eca4682bd..a79c1c86e96 100644 const TypeLong* tl = t1->is_long(); if (tl->is_con()) { - return TypeLong::make(uabs(tl->get_con())); -+ return TypeLong::make(UABS(tl->get_con())); ++ return TypeLong::make(g_uabs(tl->get_con())); } break; } diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp -index ccd3106b471..274c0591411 100644 +index cc5f3ebb291..4ec61babec3 100644 --- a/src/hotspot/share/utilities/globalDefinitions.hpp +++ b/src/hotspot/share/utilities/globalDefinitions.hpp -@@ -1142,9 +1142,13 @@ inline T clamp(T value, T min, T max) { - inline bool is_odd (intx x) { return x & 1; } - inline bool is_even(intx x) { return !is_odd(x); } +@@ -1118,7 +1118,7 @@ inline bool is_even(intx x) { return !is_odd(x); } -+// Some compilers define uabs() in a conflicting way (e.g. GCC 15), -+// use a macro to work-around that name clash by calling it custom_uabs -+#define UABS(x) custom_uabs(x) -+ // abs methods which cannot overflow and so are well-defined across // the entire domain of integer types. -static inline unsigned int uabs(unsigned int n) { -+static inline unsigned int custom_uabs(unsigned int n) { ++static inline unsigned int g_uabs(unsigned int n) { union { unsigned int result; int value; -@@ -1153,7 +1157,7 @@ static inline unsigned int uabs(unsigned int n) { +@@ -1127,7 +1127,7 @@ static inline unsigned int uabs(unsigned int n) { if (value < 0) result = 0-result; return result; } -static inline julong uabs(julong n) { -+static inline julong custom_uabs(julong n) { ++static inline julong g_uabs(julong n) { union { julong result; jlong value; -@@ -1162,8 +1166,8 @@ static inline julong uabs(julong n) { +@@ -1136,8 +1136,8 @@ static inline julong uabs(julong n) { if (value < 0) result = 0-result; return result; } -static inline julong uabs(jlong n) { return uabs((julong)n); } -static inline unsigned int uabs(int n) { return uabs((unsigned int)n); } -+static inline julong custom_uabs(jlong n) { return custom_uabs((julong)n); } -+static inline unsigned int custom_uabs(int n) { return custom_uabs((unsigned int)n); } ++static inline julong g_uabs(jlong n) { return g_uabs((julong)n); } ++static inline unsigned int g_uabs(int n) { return g_uabs((unsigned int)n); } // "to" should be greater than "from." inline size_t byte_size(void* from, void* to) { --- -2.49.0 - From dafff6d4c19e3bb93f3ea78e6b37b3152b97ae2a Mon Sep 17 00:00:00 2001 From: Jiri Date: Mon, 26 May 2025 13:11:31 +0200 Subject: [PATCH 72/86] Bumped release --- java-latest-openjdk-portable.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index e04275e..667c736 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -402,7 +402,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 9 -%global rpmrelease 1 +%global rpmrelease 2 #%%global tagsuffix %%{nil} # 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 From 31207ffae30d0513aa8158ec7fa691d18e9d7c43 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 21 Jul 2025 19:33:26 +0200 Subject: [PATCH 73/86] Updated to 24.0.2.0.12 minor changes: * added changelog * shenandoah included in risc arches * bumped bundled providfes * introduced XZ_OPTS to -T0 * scripts moved to scritps dir * scripts passesd through spell check --- .gitignore | 1 + NEWS | 180 ++++++++++++++++++ ...c48eda.patch => fips-21u-9203d50836c.patch | 41 ++-- java-latest-openjdk-portable.spec | 43 ++--- openjdk_news.sh | 76 -------- .../discover_trees.sh | 27 ++- .../generate_source_tarball.sh | 128 +++++++------ icedtea_sync.sh => scripts/icedtea_sync.sh | 0 scripts/openjdk_news.sh | 114 +++++++++++ sources | 2 +- 10 files changed, 426 insertions(+), 186 deletions(-) rename fips-21u-75ffdc48eda.patch => fips-21u-9203d50836c.patch (99%) delete mode 100755 openjdk_news.sh rename discover_trees.sh => scripts/discover_trees.sh (57%) rename generate_source_tarball.sh => scripts/generate_source_tarball.sh (70%) rename icedtea_sync.sh => scripts/icedtea_sync.sh (100%) create mode 100755 scripts/openjdk_news.sh diff --git a/.gitignore b/.gitignore index b56c1ea..7829d87 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,4 @@ /openjdk-24+34-ea.tar.xz /openjdk-24+36.tar.xz /openjdk-24.0.1+9.tar.xz +/openjdk-24.0.2+12.tar.xz diff --git a/NEWS b/NEWS index 5cd16bd..8a27fc4 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,186 @@ Key: JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY JEP-XYZ: https://openjdk.org/jeps/XYZ +New in release OpenJDK 24.0.2+12 (2025-7-15): +=========================================== +* CVEs + - CVE-2025-30749 + - CVE-2025-30754 + - CVE-2025-50059 + - CVE-2025-50106 +* Changes + - JDK-8217914: java/net/httpclient/ConnectTimeoutHandshakeSync.java failed on connection refused while doing POST + - JDK-8276995: Bug in jdk.jfr.event.gc.collection.TestSystemGC + - JDK-8280991: [XWayland] No displayChanged event after setDisplayMode call + - JDK-8281511: java/net/ipv6tests/UdpTest.java fails with checkTime failed + - JDK-8286204: [Accessibility,macOS,VoiceOver] VoiceOver reads the spinner value 10 as 1 when user iterates to 10 for the first time on macOS + - JDK-8294155: Exception thrown before awaitAndCheck hangs PassFailJFrame + - JDK-8303770: Remove Baltimore root certificate expiring in May 2025 + - JDK-8305010: Test vmTestbase/nsk/jvmti/scenarios/sampling/SP05/sp05t003/TestDescription.java timed out: thread not suspended + - JDK-8314840: 3 gc/epsilon tests ignore external vm options + - JDK-8322983: Virtual Threads: exclude 2 tests + - JDK-8330598: java/net/httpclient/Http1ChunkedTest.java fails with java.util.MissingFormatArgumentException: Format specifier '%s' + - JDK-8330936: [ubsan] exclude function BilinearInterp and ShapeSINextSpan in libawt java2d from ubsan checks + - JDK-8334644: Automate javax/print/attribute/PageRangesException.java + - JDK-8336042: Caller/callee param size mismatch in deoptimization causes crash + - JDK-8338303: Linux ppc64le with toolchain clang - detection failure in early JVM startup + - JDK-8339889: Several compiler tests ignore vm flags and not marked as flagless + - JDK-8340784: Remove PassFailJFrame constructor with screenshots + - JDK-8342524: Use latch in AbstractButton/bug6298940.java instead of delay + - JDK-8342775: [Graal] java/util/concurrent/locks/Lock/OOMEInAQS.java fails OOME thrown from the UncaughtExceptionHandler + - JDK-8343191: Cgroup v1 subsystem fails to set subsystem path + - JDK-8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 + - JDK-8343607: C2: Shenandoah crashes during barrier expansion in Continuation::enter + - JDK-8343882: BasicAnnoTests doesn't handle multiple annotations at the same position + - JDK-8343978: Update the default value of CodeEntryAlignment for Ampere-1A and 1B + - JDK-8344316: security/auth/callback/TextCallbackHandler/Password.java make runnable with JTReg and add the UI + - JDK-8344453: Test jdk/jfr/event/oldobject/TestSanityDefault.java timed out + - JDK-8344581: [TESTBUG] java/awt/Robot/ScreenCaptureRobotTest.java failing on macOS + - JDK-8344629: SSLSocketNoServerHelloClientShutdown test timeout + - JDK-8344892: beans/finder/MethodFinder.findMethod incorrectly returns null + - JDK-8344925: translet-name ignored when package-name is also set + - JDK-8345133: Test sun/security/tools/jarsigner/TsacertOptionTest.java failed: Warning found in stdout + - JDK-8345134: Test sun/security/tools/jarsigner/ConciseJarsigner.java failed: unable to find valid certification path to requested target + - JDK-8345185: Update jpackage to not include service bindings by default + - JDK-8345276: Remove EA from the JDK 24 version string with first RC promotion + - JDK-8345368: java/io/File/createTempFile/SpecialTempFile.java fails on Windows Server 2025 + - JDK-8345569: [ubsan] adjustments to filemap.cpp and virtualspace.cpp for macOS aarch64 + - JDK-8345590: AIX 'make all' fails after JDK-8339480 + - JDK-8345625: Better HTTP connections + - JDK-8345676: [ubsan] ProcessImpl_md.c:561:40: runtime error: applying zero offset to null pointer on macOS aarch64 + - JDK-8345728: [Accessibility,macOS,Screen Magnifier]: JCheckbox unchecked state does not magnify but works for checked state + - JDK-8346049: jdk/test/lib/security/timestamp/TsaServer.java warnings + - JDK-8346264: "Total compile time" counter should include time spent in failing/bailout compiles + - JDK-8346285: Update jarsigner compatibility test for change in default digest algorithm + - JDK-8346581: JRadioButton/ButtonGroupFocusTest.java fails in CI on Linux + - JDK-8346587: Distrust TLS server certificates anchored by Camerfirma Root CAs + - JDK-8346671: java/nio/file/Files/probeContentType/Basic.java fails on Windows 2025 + - JDK-8346705: SNI not sent with Java 22+ using java.net.http.HttpClient.Builder#sslParameters + - JDK-8346832: runtime/CompressedOops/CompressedCPUSpecificClassSpaceReservation.java fails on RISC-V + - JDK-8346880: [aix] java/lang/ProcessHandle/InfoTest.java still fails: "reported cputime less than expected" + - JDK-8346881: [ubsan] logSelection.cpp:154:24 / logSelectionList.cpp:72:94 : runtime error: applying non-zero offset 1 to null pointer + - JDK-8346888: [ubsan] block.cpp:1617:30: runtime error: 9.97582e+36 is outside the range of representable values of type 'int' + - JDK-8346972: Test java/nio/channels/FileChannel/LoopingTruncate.java fails sometimes with IOException: There is not enough space on the disk + - JDK-8347000: Bug in com/sun/net/httpserver/bugs/B6361557.java test + - JDK-8347018: C2: Insertion of Assertion Predicates ignores the effects of PhaseIdealLoop::clone_up_backedge_goo() + - JDK-8347038: [JMH] jdk.incubator.vector.SpiltReplicate fails NoClassDefFoundError + - JDK-8347126: gc/stress/TestStressG1Uncommit.java gets OOM-killed + - JDK-8347171: (dc) java/nio/channels/DatagramChannel/InterruptibleOrNot.java fails with virtual thread factory + - JDK-8347173: java/net/DatagramSocket/InterruptibleDatagramSocket.java fails with virtual thread factory + - JDK-8347267: [macOS]: UnixOperatingSystem.c:67:40: runtime error: division by zero + - JDK-8347268: [ubsan] logOutput.cpp:357:21: runtime error: applying non-zero offset 1 to null pointer + - JDK-8347286: (fs) Remove some extensions from java/nio/file/Files/probeContentType/Basic.java + - JDK-8347296: WinInstallerUiTest fails in local test runs if the path to test work directory is longer that regular + - JDK-8347298: Bug in JPackageCommand.ignoreFakeRuntime() + - JDK-8347300: Don't exclude the "PATH" var from the environment when running app launchers in jpackage tests + - JDK-8347302: Mark test tools/jimage/JImageToolTest.java as flagless + - JDK-8347373: HTTP/2 flow control checks may count unprocessed data twice + - JDK-8347377: Add validation checks for ICC_Profile header fields + - JDK-8347427: JTabbedPane/8134116/Bug8134116.java has no license header + - JDK-8347564: ZGC: Crash in DependencyContext::clean_unloading_dependents + - JDK-8347576: Error output in libjsound has non matching format strings + - JDK-8347629: Test FailOverDirectExecutionControlTest.java fails with -Xcomp + - JDK-8347718: Unexpected NullPointerException in C2 compiled code due to ReduceAllocationMerges + - JDK-8347740: java/io/File/createTempFile/SpecialTempFile.java failing + - JDK-8347847: Enhance jar file support + - JDK-8347995: Race condition in jdk/java/net/httpclient/offline/FixedResponseHttpClient.java + - JDK-8347997: assert(false) failed: EA: missing memory path + - JDK-8348102: java/net/httpclient/HttpClientSNITest.java fails intermittently + - JDK-8348110: Update LCMS to 2.17 + - JDK-8348261: assert(n->is_Mem()) failed: memory node required + - JDK-8348299: Update List/ItemEventTest/ItemEventTest.java + - JDK-8348323: Corrupted timezone string in JVM crash log + - JDK-8348356: Update the release version after forking Apr CPU25_04 + - JDK-8348562: ZGC: segmentation fault due to missing node type check in barrier elision analysis + - JDK-8348582: Set -fstack-protector when building with clang + - JDK-8348596: Update FreeType to 2.13.3 + - JDK-8348597: Update HarfBuzz to 10.4.0 + - JDK-8348598: Update Libpng to 1.6.47 + - JDK-8348600: Update PipeWire to 1.3.81 + - JDK-8348675: TrayIcon tests fail in Ubuntu 24.10 Wayland + - JDK-8348936: [Accessibility,macOS,VoiceOver] VoiceOver doesn't announce untick on toggling the checkbox with "space" key on macOS + - JDK-8348989: Better Glyph drawing + - JDK-8349002: GenShen: Deadlock during shutdown + - JDK-8349039: Adjust exception No type named in database + - JDK-8349058: 'internal proprietary API' warnings make javac warnings unusable + - JDK-8349084: Update vectors used in several PQC benchmarks + - JDK-8349111: Enhance Swing supports + - JDK-8349150: Support precompiled headers on AIX + - JDK-8349183: [BACKOUT] Optimization for StringBuilder append boolean & null + - JDK-8349200: [JMH] time.format.ZonedDateTimeFormatterBenchmark fails + - JDK-8349213: G1: Clearing bitmaps during collection set merging not claimed by region + - JDK-8349214: Improve size optimization flags for MSVC builds + - JDK-8349239: [BACKOUT] Reuse StringLatin1::putCharsAt and StringUTF16::putCharsAt + - JDK-8349348: Refactor ClassLoaderDeadlock.sh and Deadlock.sh to run fully in java + - JDK-8349358: [JMH] Cannot access class jdk.internal.vm.ContinuationScope + - JDK-8349370: Bump version numbers for 24.0.2 + - JDK-8349375: Cleanup AIX special file build settings + - JDK-8349378: Build splashscreen lib with SIZE optimization + - JDK-8349492: Update sun/security/pkcs12/KeytoolOpensslInteropTest.java to use a recent Openssl version + - JDK-8349501: Relocate supporting classes in security/testlibrary to test/lib/jdk tree + - JDK-8349551: Failures in tests after JDK-8345625 + - JDK-8349584: Improve compiler processing + - JDK-8349594: Enhance TLS protocol support + - JDK-8349623: [ASAN] Gtest os_linux.glibc_mallinfo_wrapper_vm fails + - JDK-8349637: Integer.numberOfLeadingZeros outputs incorrectly in certain cases + - JDK-8349751: AIX build failure after upgrade pipewire to 1.3.81 + - JDK-8349753: Incorrect use of CodeBlob::is_buffer_blob() in few places + - JDK-8349787: java/lang/Thread/virtual/ThreadPollOnYield.java#default passes unexpectedly without libVThreadPinner.so + - JDK-8349943: [JMH] Use jvmArgs consistently + - JDK-8350103: Test containers/systemd/SystemdMemoryAwarenessTest.java fails on Linux ppc64le SLES15 SP6 + - JDK-8350137: After JDK-8348975, Linux builds contain man pages for windows only tools + - JDK-8350201: Out of bounds access on Linux aarch64 in os::print_register_info + - JDK-8350202: Tune for Power10 CPUs on Linux ppc64le + - JDK-8350211: CTW: Attempt to preload all classes in constant pool + - JDK-8350260: Improve HTML instruction formatting in PassFailJFrame + - JDK-8350313: Include timings for leaving safepoint in safepoint logging + - JDK-8350386: Test TestCodeCacheFull.java fails with option -XX:-UseCodeCacheFlushing + - JDK-8350483: AArch64: turn on signum intrinsics by default on Ampere CPUs + - JDK-8350498: Remove two Camerfirma root CA certificates + - JDK-8350499: Minimal build fails with slowdebug builds + - JDK-8350546: Several java/net/InetAddress tests fails UnknownHostException + - JDK-8350682: [JMH] vector.IndexInRangeBenchmark failed with IndexOutOfBoundsException for size=1024 + - JDK-8350683: Non-C2 / minimal JVM crashes in the build on ppc64 platforms + - JDK-8350786: Some java/lang jtreg tests miss requires vm.hasJFR + - JDK-8350820: OperatingSystemMXBean CpuLoad() methods return -1.0 on Windows + - JDK-8350924: javax/swing/JMenu/4213634/bug4213634.java fails + - JDK-8350991: Improve HTTP client header handling + - JDK-8351033: RISC-V: TestFloat16ScalarOperations asserts with offset (4210) is too large to be patched in one beq/bge/bgeu/blt/bltu/bne instruction! + - JDK-8351223: Update localized resources in keytool and jarsigner + - JDK-8351233: [ASAN] avx2-emu-funcs.hpp:151:20: error: ‘D.82188’ is used uninitialized + - JDK-8351277: Remove pipewire from AIX build + - JDK-8351382: New test containers/docker/TestMemoryWithSubgroups.java is failing + - JDK-8351500: G1: NUMA migrations cause crashes in region allocation + - JDK-8351639: Improve debuggability of test/langtools/jdk/jshell/JdiHangingListenExecutionControlTest.java test + - JDK-8351665: Remove unused UseNUMA in os_aix.cpp + - JDK-8351933: Inaccurate masking of TC subfield decrement in ForkJoinPool + - JDK-8352109: java/awt/Desktop/MailTest.java fails in platforms where Action.MAIL is not supported + - JDK-8352302: Test sun/security/tools/jarsigner/TimestampCheck.java is failing + - JDK-8352508: [Redo] G1: Pinned regions with pinned objects only reachable by native code crash VM + - JDK-8352512: TestVectorZeroCount: counter not reset between iterations + - JDK-8352706: httpclient HeadTest does not run on HTTP2 + - JDK-8352716: (tz) Update Timezone Data to 2025b + - JDK-8352946: SEGV_BND signal code of SIGSEGV missing from our signal-code table + - JDK-8353053: (fs) Add support for UserDefinedFileAttributeView on AIX + - JDK-8353066: Properly detect Windows/aarch64 as build platform + - JDK-8353185: Introduce the concept of upgradeable files in context of JEP 493 + - JDK-8353261: Problemlist 5 tests due to failures in the CI pipeline + - JDK-8353274: [PPC64] Bug related to -XX:+UseCompactObjectHeaders -XX:-UseSIGTRAP in JDK-8305895 + - JDK-8353329: Small memory leak when create GrowableArray with initial size 0 + - JDK-8353709: Debug symbols bundle should contain full debug files when building --with-external-symbols-in-bundles=public + - JDK-8353740: Problemlist 2 tests due to failures in the CI pipeline + - JDK-8353787: Increased number of SHA-384-Digest java.util.jar.Attributes$Name instances leading to higher memory footprint + - JDK-8353861: Problemlist 1 test due to failures in the CI pipeline + - JDK-8353946: Incorrect WINDOWS ifdef in os::build_agent_function_name + - JDK-8354657: Problemlist 2 tests due to failures in the CI pipeline + - JDK-8354831: Problemlist 2 tests due to failures in the CI pipeline + - JDK-8354861: Change milestone to fcs for all releases + - JDK-8354904: [Backout] JDK-8345625: Better HTTP connections + - JDK-8355524: Only every second line in upgradeable files is being used + - JDK-8355884: [macos] java/awt/Frame/I18NTitle.java fails on MacOS + - JDK-8356096: ISO 4217 Amendment 179 Update + - JDK-8359170: Add 2 TLS and 2 CS Sectigo roots + - JDK-8360147: Better Glyph drawing redux New in release OpenJDK 24.0.1+9 (2025-4-16): =========================================== diff --git a/fips-21u-75ffdc48eda.patch b/fips-21u-9203d50836c.patch similarity index 99% rename from fips-21u-75ffdc48eda.patch rename to fips-21u-9203d50836c.patch index 8413fe1..9966391 100644 --- a/fips-21u-75ffdc48eda.patch +++ b/fips-21u-9203d50836c.patch @@ -116,7 +116,7 @@ index 00000000000..f48fc7f7e80 + AC_SUBST(NSS_LIBDIR) +]) diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4 -index a1fc81564b1..ebad69d9dcf 100644 +index 51d4f724c33..feb0bcf3e75 100644 --- a/make/autoconf/libraries.m4 +++ b/make/autoconf/libraries.m4 @@ -35,6 +35,7 @@ m4_include([lib-std.m4]) @@ -127,7 +127,7 @@ index a1fc81564b1..ebad69d9dcf 100644 ################################################################################ # Determine which libraries are needed for this configuration -@@ -134,6 +135,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES], +@@ -128,6 +129,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES], LIB_SETUP_X11 LIB_TESTS_SETUP_GTEST @@ -136,10 +136,10 @@ index a1fc81564b1..ebad69d9dcf 100644 BASIC_JDKLIB_LIBS="" BASIC_JDKLIB_LIBS_TARGET="" diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in -index 0f85917814e..9419562b654 100644 +index f6def153c82..4d7abc33427 100644 --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in -@@ -867,6 +867,11 @@ INSTALL_SYSCONFDIR=@sysconfdir@ +@@ -873,6 +873,11 @@ INSTALL_SYSCONFDIR=@sysconfdir@ # Libraries # @@ -1979,7 +1979,7 @@ index 539ef1e8ee8..435f57e3ff2 100644 "sun.security.rsa.PSSParameters", null); } diff --git a/src/java.base/share/conf/security/java.security b/src/java.base/share/conf/security/java.security -index 5149edba0e5..8227d650a03 100644 +index f8b01a4ea1e..b325bf7e9fc 100644 --- a/src/java.base/share/conf/security/java.security +++ b/src/java.base/share/conf/security/java.security @@ -85,6 +85,17 @@ security.provider.tbd=Apple @@ -2959,7 +2959,7 @@ index 00000000000..f8d505ca815 +} \ No newline at end of file diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java -index 6b26297b1b4..7ee5e07756c 100644 +index 01fc06ae283..e3ca000d309 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java @@ -37,6 +37,8 @@ import javax.crypto.*; @@ -2981,20 +2981,21 @@ index 6b26297b1b4..7ee5e07756c 100644 private static final String PUBLIC = "public"; private static final String PRIVATE = "private"; private static final String SECRET = "secret"; -@@ -401,8 +406,10 @@ abstract class P11Key implements Key, Length { +@@ -414,9 +419,10 @@ abstract class P11Key implements Key, Length { new CK_ATTRIBUTE(CKA_EXTRACTABLE), }); -- boolean keySensitive = (attrs[0].getBoolean() || -- attrs[1].getBoolean() || !attrs[2].getBoolean()); +- boolean keySensitive = +- (attrs[0].getBoolean() && P11Util.isNSS(session.token)) || +- attrs[1].getBoolean() || !attrs[2].getBoolean(); + boolean exportable = plainKeySupportEnabled && !algorithm.equals("DH"); + boolean keySensitive = (!exportable && -+ (attrs[0].getBoolean() || -+ attrs[1].getBoolean() || !attrs[2].getBoolean())); ++ ((attrs[0].getBoolean() && P11Util.isNSS(session.token)) || ++ attrs[1].getBoolean() || !attrs[2].getBoolean())); return switch (algorithm) { case "RSA" -> P11RSAPrivateKeyInternal.of(session, keyID, algorithm, -@@ -454,7 +461,8 @@ abstract class P11Key implements Key, Length { +@@ -468,7 +474,8 @@ abstract class P11Key implements Key, Length { public String getFormat() { token.ensureValid(); @@ -3004,13 +3005,13 @@ index 6b26297b1b4..7ee5e07756c 100644 return null; } else { return "RAW"; -@@ -1624,4 +1632,3 @@ final class SessionKeyRef extends PhantomReference { +@@ -1638,4 +1645,3 @@ final class SessionKeyRef extends PhantomReference { this.clear(); } } - diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java -index 5cd6828d293..bae49c4e8a9 100644 +index 0a62021633f..0723b69c2bc 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java @@ -26,6 +26,9 @@ @@ -3021,7 +3022,7 @@ index 5cd6828d293..bae49c4e8a9 100644 +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; import java.util.*; - + import java.util.stream.Collectors; import java.security.*; @@ -42,10 +45,12 @@ import javax.security.auth.callback.PasswordCallback; @@ -3140,7 +3141,7 @@ index 5cd6828d293..bae49c4e8a9 100644 } p11 = tmpPKCS11; -@@ -1389,11 +1461,52 @@ public final class SunPKCS11 extends AuthProvider { +@@ -1388,11 +1460,52 @@ public final class SunPKCS11 extends AuthProvider { } @Override @@ -3193,7 +3194,7 @@ index 5cd6828d293..bae49c4e8a9 100644 try { return newInstance0(param); } catch (PKCS11Exception e) { -@@ -1750,6 +1863,9 @@ public final class SunPKCS11 extends AuthProvider { +@@ -1749,6 +1862,9 @@ public final class SunPKCS11 extends AuthProvider { try { session = token.getOpSession(); p11.C_Logout(session.id()); @@ -3204,7 +3205,7 @@ index 5cd6828d293..bae49c4e8a9 100644 debug.println("logout succeeded"); } diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Token.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Token.java -index 3378409ca1c..7602a92a252 100644 +index a6f5f0a8764..9a07c96ca4e 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Token.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Token.java @@ -33,6 +33,7 @@ import java.lang.ref.*; @@ -3251,7 +3252,7 @@ index 3378409ca1c..7602a92a252 100644 } diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java -index 4b06daaf264..55e14945469 100644 +index 0fd13fd6fa6..3c959c942a1 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java @@ -49,6 +49,9 @@ package sun.security.pkcs11.wrapper; @@ -3311,7 +3312,7 @@ index 4b06daaf264..55e14945469 100644 } if (omitInitialize == false) { try { -@@ -1976,4 +2004,194 @@ static class SynchronizedPKCS11 extends PKCS11 { +@@ -2012,4 +2040,194 @@ static class SynchronizedPKCS11 extends PKCS11 { super.C_GenerateRandom(hSession, randomData); } } diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 667c736..59554cb 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -36,10 +36,9 @@ # Build with system libraries %bcond_with system_libs - -%if (0%{?rhel} > 0 && 0%{?rhel} < 8) # This is RHEL 7 specific as it doesn't seem to have the # __brp_strip_static_archive macro. +%if 0%{?rhel} == 7 %define __os_install_post %{nil} %endif @@ -147,7 +146,7 @@ # However, it does segfault on the Zero assembler port, so currently JIT only %global share_arches %{jit_arches} # Set of architectures for which we build the Shenandoah garbage collector -%global shenandoah_arches x86_64 %{aarch64} +%global shenandoah_arches x86_64 %{aarch64} riscv64 # Set of architectures for which we build the Z garbage collector %global zgc_arches x86_64 riscv64 # Set of architectures for which alt-java has SSB mitigation @@ -337,7 +336,7 @@ # New Version-String scheme-style defines %global featurever 24 %global interimver 0 -%global updatever 1 +%global updatever 2 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, @@ -387,7 +386,7 @@ # Define IcedTea version used for SystemTap tapsets and desktop file %global icedteaver 6.0.0pre00-c848b93a8598 # Define current Git revision for the FIPS support patches -%global fipsver 75ffdc48eda +%global fipsver 9203d50836c # Define JDK versions %global newjavaver %{featurever}.%{interimver}.%{updatever}.%{patchver} %global javaver %{featurever} @@ -401,8 +400,8 @@ %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 9 -%global rpmrelease 2 +%global buildver 12 +%global rpmrelease 1 #%%global tagsuffix %%{nil} # 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 @@ -647,7 +646,6 @@ Source18: TestTranslations.java # RPM/distribution specific patches # ############################################ - # Crypto policy and FIPS support patches # Patch is generated from the fips-21u tree at https://github.com/rh-openjdk/jdk/tree/fips-21u # as follows: git diff %%{vcstag} src make test > fips-21u-$(git show -s --format=%h HEAD).patch @@ -701,12 +699,8 @@ Patch1100: 0001-Fix-name-class-of-uabs-with-GCC-15.patch # OpenJDK patches which missed last update # ############################################# -# JDK-8350137: After JDK-8348975, Linux builds contain man pages for windows only tools -Patch2000: 0001-8350137-After-JDK-8348975-Linux-builds-contain-man-p.patch -# JDK-8353185: Introduce the concept of upgradeable files in context of JEP 493 -Patch2001: 0001-8353185-Introduce-the-concept-of-upgradeable-files-i.patch -# JDK-8355524: Only every second line in upgradeable files is being used -Patch2002: 0001-8355524-Only-every-second-line-in-upgradeable-files-.patch + +# Currently empty ############################################# # @@ -791,19 +785,22 @@ BuildRequires: harfbuzz-devel BuildRequires: lcms2-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel +BuildRequires: zlib-devel %else # Version in src/java.desktop/share/legal/freetype.md -Provides: bundled(freetype) = 2.13.0 +Provides: bundled(freetype) = 2.13.3 # Version in src/java.desktop/share/native/libsplashscreen/giflib/gif_lib.h -Provides: bundled(giflib) = 5.2.1 +Provides: bundled(giflib) = 5.2.2 # Version in src/java.desktop/share/native/libharfbuzz/hb-version.h -Provides: bundled(harfbuzz) = 8.2.2 +Provides: bundled(harfbuzz) = 10.4.0 # Version in src/java.desktop/share/native/liblcms/lcms2.h -Provides: bundled(lcms2) = 2.15.0 +Provides: bundled(lcms2) = 2.17.0 # Version in src/java.desktop/share/native/libjavajpeg/jpeglib.h Provides: bundled(libjpeg) = 6b # Version in src/java.desktop/share/native/libsplashscreen/libpng/png.h -Provides: bundled(libpng) = 1.6.40 +Provides: bundled(libpng) = 1.6.47 +# Version in src/java.base/share/native/libzip/zlib/zlib.h +Provides: bundled(zlib) = 1.3.1 # We link statically against libstdc++ to increase portability BuildRequires: libstdc++-static %endif @@ -982,6 +979,7 @@ echo "WARNING: The build of a fresh libjvm has been disabled due to a JDK versio echo "Build JDK version is %{buildjdkver}, feature JDK version is %{featurever}" %endif +export XZ_OPT="-T0" %setup -q -c -n %{uniquesuffix ""} -T -a 0 # https://bugzilla.redhat.com/show_bug.cgi?id=1189084 prioritylength=`expr length %{priority}` @@ -1002,11 +1000,6 @@ pushd %{top_level_dir_name} # Skipping fips patch whil eit is not ready for jdk22 %%patch -P1001 -p1 # Patches in need of upstreaming %patch -P1100 -p1 - -# Patches not yet in 24.0.1 -%patch -P2000 -p1 -%patch -P2001 -p1 -%patch -P2002 -p1 popd # openjdk @@ -1369,6 +1362,7 @@ packFullPatchedSources %if %{build_hotspot_first} # Build a fresh libjvm.so first and use it to bootstrap + echo "Building HotSpot only for the latest libjvm.so" cp -LR --preserve=mode,timestamps %{bootjdk} newboot systemjdk=$(pwd)/newboot buildjdk build/newboot ${systemjdk} %{hotspot_target} "release" "bundled" "internal" @@ -1428,7 +1422,6 @@ for suffix in %{build_loop} ; do findgeneratedsources ${installdir} ${builddir} $(pwd)/%{top_level_dir_name} installjdk ${builddir} ${installdir} fi - packagejdk ${installdir} ${packagesdir} %{altjavaoutputdir} %if %{system_libs} diff --git a/openjdk_news.sh b/openjdk_news.sh deleted file mode 100755 index d1bd061..0000000 --- a/openjdk_news.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2022 Red Hat, Inc. -# Written by Andrew John Hughes , 2012-2022 -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - -OLD_RELEASE=$1 -NEW_RELEASE=$2 -REPO=$3 -SUBDIR=$4 -SCRIPT_DIR=$(dirname ${0}) - -if test "x${SUBDIR}" = "x"; then - echo "No subdirectory specified; using ."; - SUBDIR="."; -fi - -if test "x$REPO" = "x"; then - echo "No repository specified; using ${PWD}" - REPO=${PWD} -fi - -if test x${TMPDIR} = x; then - TMPDIR=/tmp; -fi - -echo "Repository: ${REPO}" - -if [ -e ${REPO}/.git ] ; then - TYPE=git; -elif [ -e ${REPO}/.hg ] ; then - TYPE=hg; -else - echo "No Mercurial or Git repository detected."; - exit 1; -fi - -if test "x$OLD_RELEASE" = "x" || test "x$NEW_RELEASE" = "x"; then - echo "ERROR: Need to specify old and new release"; - exit 2; -fi - -echo "Listing fixes between $OLD_RELEASE and $NEW_RELEASE in $REPO" -rm -f ${TMPDIR}/fixes2 ${TMPDIR}/fixes3 ${TMPDIR}/fixes -for repos in . $(${SCRIPT_DIR}/discover_trees.sh ${REPO}); -do - if test "x$TYPE" = "xhg"; then - hg log -r "tag('$NEW_RELEASE'):tag('$OLD_RELEASE') - tag('$OLD_RELEASE')" -R $REPO/$repos -G -M ${REPO}/${SUBDIR} | \ - grep -E '^[o:| ]*summary'|grep -v 'Added tag'|sed -r 's#^[o:| ]*summary:\W*([0-9])# - JDK-\1#'| \ - sed 's#^[o:| ]*summary:\W*# - #' >> ${TMPDIR}/fixes2; - hg log -v -r "tag('$NEW_RELEASE'):tag('$OLD_RELEASE') - tag('$OLD_RELEASE')" -R $REPO/$repos -G -M ${REPO}/${SUBDIR} | \ - grep -E '^[o:| ]*[0-9]{7}'|sed -r 's#^[o:| ]*([0-9]{7})# - JDK-\1#' >> ${TMPDIR}/fixes3; - else - git -C ${REPO} log --no-merges --pretty=format:%B ${NEW_RELEASE}...${OLD_RELEASE} -- ${SUBDIR} |grep -E '^[0-9]{7}' | \ - sed -r 's#^([0-9])# - JDK-\1#' >> ${TMPDIR}/fixes2; - touch ${TMPDIR}/fixes3 ; # unused - fi -done - -sort ${TMPDIR}/fixes2 ${TMPDIR}/fixes3 | uniq > ${TMPDIR}/fixes -rm -f ${TMPDIR}/fixes2 ${TMPDIR}/fixes3 - -echo "In ${TMPDIR}/fixes:" -cat ${TMPDIR}/fixes diff --git a/discover_trees.sh b/scripts/discover_trees.sh similarity index 57% rename from discover_trees.sh rename to scripts/discover_trees.sh index 8c31278..7a0b800 100755 --- a/discover_trees.sh +++ b/scripts/discover_trees.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2020 Red Hat, Inc. +# Copyright (C) 2024 Red Hat, Inc. # Written by Andrew John Hughes . # # This program is free software: you can redistribute it and/or modify @@ -18,37 +18,44 @@ TREE=${1} -if test "x${TREE}" = "x"; then +if test "${TREE}" = ""; then TREE=${PWD} fi -if [ -e ${TREE}/nashorn/.hg -o -e ${TREE}/nashorn/merge.changeset ] ; then +if [ -e "${TREE}"/nashorn/.hg ] || [ -e "${TREE}"/nashorn/merge.changeset ] ; then NASHORN="nashorn" ; fi -if [ -e ${TREE}/corba/.hg -o -e ${TREE}/corba/merge.changeset ] ; then +if [ -e "${TREE}"/corba/.hg ] || [ -e "${TREE}"/corba/merge.changeset ] ; then CORBA="corba"; fi -if [ -e ${TREE}/jaxp/.hg -o -e ${TREE}/jaxp/merge.changeset ] ; then +if [ -e "${TREE}"/jaxp/.hg ] || [ -e "${TREE}"/jaxp/merge.changeset ] ; then JAXP="jaxp"; fi -if [ -e ${TREE}/jaxws/.hg -o -e ${TREE}/jaxws/merge.changeset ] ; then +if [ -e "${TREE}"/jaxws/.hg ] || [ -e "${TREE}"/jaxws/merge.changeset ] ; then JAXWS="jaxws"; fi -if [ -e ${TREE}/langtools/.hg -o -e ${TREE}/langtools/merge.changeset ] ; then +if [ -e "${TREE}"/langtools/.hg ] || [ -e "${TREE}"/langtools/merge.changeset ] ; then LANGTOOLS="langtools"; fi -if [ -e ${TREE}/jdk/.hg -o -e ${TREE}/jdk/merge.changeset ] ; then +if [ -e "${TREE}"/jdk/.hg ] || [ -e "${TREE}"/jdk/merge.changeset ] ; then JDK="jdk"; fi -if [ -e ${TREE}/hotspot/.hg -o -e ${TREE}/hotspot/merge.changeset ] ; then +if [ -e "${TREE}"/hotspot/.hg ] || [ -e "${TREE}"/hotspot/merge.changeset ] ; then HOTSPOT="hotspot"; fi SUBTREES="${CORBA} ${JAXP} ${JAXWS} ${LANGTOOLS} ${NASHORN} ${JDK} ${HOTSPOT}"; -echo ${SUBTREES} +echo "${SUBTREES}" + +# Local Variables: +# compile-command: "shellcheck discover_trees.sh" +# fill-column: 80 +# indent-tabs-mode: nil +# sh-basic-offset: 4 +# End: diff --git a/generate_source_tarball.sh b/scripts/generate_source_tarball.sh similarity index 70% rename from generate_source_tarball.sh rename to scripts/generate_source_tarball.sh index 9a0e233..ad163f3 100755 --- a/generate_source_tarball.sh +++ b/scripts/generate_source_tarball.sh @@ -1,6 +1,10 @@ #!/bin/bash # Copyright (C) 2024 Red Hat, Inc. +# Written by: +# Andrew John Hughes +# Thomas Fitzsimmons +# Jiri Vanek # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -15,42 +19,46 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -# Generates the 'source tarball' for JDK projects. +# Generates the source tarball for OpenJDK projects. +# +# There are multiple ways to specify the source code location and version: +# +# 1. Specify the version (VERSION), the location of the Git repository +# (REPO_ROOT) and the root of the output tarball name (FILE_NAME_ROOT) +# 2. Specify the version (VERSION) along with an upstream project name +# (PROJECT_NAME) and repository name (REPO_NAME) that can be used +# to construct the URL of the upstream OpenJDK repository. +# 3. Specify OPENJDK_LATEST=1 and allow the script to obtain the JDK +# feature version from the spec file, which is then used to +# obtain the latest build promotion from the upstream repository. +# +# An appropriate bootstrap JDK is also required for when ./configure +# is run within the checked out repository to generate the .src-rev. +# file. This can be specified by setting BOOT_JDK. # # Example 1: -# When used from local repo set REPO_ROOT pointing to file:// with your repo. -# If your local repo follows upstream forests conventions, it may be enough to -# set OPENJDK_URL. +# This will check out the specified version from the specified +# repository and construct a tarball called openjdk-17.0.3+5.tar.xz: +# +# $ VERSION=jdk-17.0.3+5 FILE_NAME_ROOT=open${VERSION} \ +# REPO_ROOT=$HOME/projects/openjdk/upstream/17u \ +# BOOT_JDK=/usr/lib/jvm/java-17-openjdk ./generate_source_tarball.sh # # Example 2: +# This will check out the same version as example 1, but from the +# upstream repository: +# +# $ VERSION=jdk-17.0.3+5 PROJECT_NAME=openjdk REPO_NAME=jdk17u \ +# BOOT_JDK=/usr/lib/jvm/java-17-openjdk ./generate_source_tarball.sh +# +# Example 3: # This will read the OpenJDK feature version from the spec file, then create a # tarball from the most recent tag for that version in the upstream Git # repository. # -# $ OPENJDK_LATEST=1 ./generate_source_tarball.sh -# [...] -# Tarball is: temp-generated-source-tarball-ujD/openjdk-17.0.10+6-ea.tar.xz +# $ OPENJDK_LATEST=1 \ +# BOOT_JDK=/usr/lib/jvm/java-17-openjdk ./generate_source_tarball.sh # -# Unless you use OPENJDK_LATEST, you have to set PROJECT_NAME, REPO_NAME and -# VERSION, e.g.: -# -# PROJECT_NAME=openjdk -# REPO_NAME=jdk24u -# VERSION=jdk-24.0.1+9 -# -# or to e.g., prepare systemtap, icedtea7's jstack and other tapsets: -# -# VERSION=6327cf1cea9e -# REPO_NAME=icedtea7-2.6 -# PROJECT_NAME=release -# OPENJDK_URL=http://icedtea.classpath.org/hg/ -# TO_COMPRESS="*/tapset" -# -# They are used to create correct name and are used in construction of sources -# URL (unless REPO_ROOT is set). -# -# This script creates a single source tarball out of the repository based on the -# given tag and removes code not allowed in Fedora/RHEL. set -e @@ -114,7 +122,7 @@ if [ "$OPENJDK_LATEST" != "" ] ; then fi if [ "$WITH_TEMP" != "" ] ; then - pushd "$(mktemp --directory temp-generated-source-tarball-XXX)" + pushd "$(mktemp --directory --tmpdir temp-generated-source-tarball-XXX)" fi if [ "$VERSION" = "" ] ; then @@ -200,18 +208,25 @@ echo -e "\tFILE_NAME_ROOT: ${FILE_NAME_ROOT}" echo -e "\tREPO_ROOT: ${REPO_ROOT}" echo -e "\tTO_COMPRESS: ${TO_COMPRESS}" echo -e "\tBOOT_JDK: ${BOOT_JDK}" +echo -e "\tWITH_TEMP: ${WITH_TEMP}" +echo -e "\tOPENJDK_LATEST: ${OPENJDK_LATEST}" if [ -d "${FILE_NAME_ROOT}" ] ; then - echo "exists exists exists exists exists exists exists " - echo "reusing reusing reusing reusing reusing reusing " - echo "${FILE_NAME_ROOT}" + echo "Reusing existing ${FILE_NAME_ROOT}" STAT_TIME="$(stat --format=%Y "${FILE_NAME_ROOT}")" TAR_TIME="$(date --date=@"${STAT_TIME}" --iso-8601=seconds)" else mkdir "${FILE_NAME_ROOT}" pushd "${FILE_NAME_ROOT}" echo "Cloning ${VERSION} root repository from ${REPO_ROOT}" - git clone --depth=1 -b "${VERSION}" "${REPO_ROOT}" "${VERSION}" + if realpath -q "${REPO_ROOT}"; then + echo "Local path detected; not adding depth argument"; + DEPTH="--"; + else + DEPTH="--depth=1"; + echo "Remote repository detected; adding ${DEPTH}"; + fi + git clone -b "${VERSION}" "${DEPTH}" "${REPO_ROOT}" "${VERSION}" pushd "${VERSION}" TAR_TIME="$(git log --max-count 1 --format=%cI)" popd @@ -227,39 +242,44 @@ pushd "${FILE_NAME_ROOT}" popd rm -rf build - EA_PART="$(awk -F= \ - '/^DEFAULT_PROMOTED_VERSION_PRE/ { if ($2) print "-"$2 }' \ - "${VERSION}"/make/conf/version-numbers.conf)" - TARBALL_BASE=${FILE_NAME_ROOT}${EA_PART}.tar - pushd "${VERSION}" - # Omit commit checks, history, and GHA from archive. - for skip in .jcheck .hgtags .hgignore .gitattributes .gitignore .github - do - echo "${skip}"" export-ignore" >> .git/info/attributes - done - # Do not bother with --mtime here; specify it to tar below. - # Unforunately, git-archive sorts added files like .src-rev at the end; - # retar below to use GNU tar --sort=name ordering which sorts .src-rev - # at the start. - git archive --output "${TARBALL_BASE}" --prefix="${VERSION}"/ \ - --add-file=.src-rev --format=tar "${VERSION}" - popd - mv "${VERSION}" "${VERSION}".git - tar xf "${VERSION}".git/"${TARBALL_BASE}" + # Remove commit checks + echo "Removing $(find "${VERSION}" -name '.jcheck' -print)" + find "${VERSION}" -name '.jcheck' -print0 | xargs -0 rm -r + + # Remove history and GHA + echo "find ${VERSION} -name '.hgtags'" + find "${VERSION}" -name '.hgtags' -exec rm -v '{}' '+' + echo "find ${VERSION} -name '.hgignore'" + find "${VERSION}" -name '.hgignore' -exec rm -v '{}' '+' + echo "find ${VERSION} -name '.gitattributes'" + find "${VERSION}" -name '.gitattributes' -exec rm -v '{}' '+' + echo "find ${VERSION} -name '.gitignore'" + find "${VERSION}" -name '.gitignore' -exec rm -v '{}' '+' + # Work around some Git objects not having write permissions. + echo "chmod --recursive u+w ${VERSION}/.git" + chmod --recursive u+w "${VERSION}"/.git + echo "find ${VERSION} -name '.git'" + find "${VERSION}" -name '.git' -exec rm -rv '{}' '+' + echo "find ${VERSION} -name '.github'" + find "${VERSION}" -name '.github' -exec rm -rv '{}' '+' + echo "Compressing remaining forest" if [ "$COMPRESSION" = "xz" ] ; then SWITCH=cJf else SWITCH=czf fi - TARBALL_NAME=`echo ${TARBALL_BASE}.${COMPRESSION} | sed "s/-jdk-/-/g"` + EA_PART="$(awk -F= \ + '/^DEFAULT_PROMOTED_VERSION_PRE/ { if ($2) print "-"$2 }' \ + "${VERSION}"/make/conf/version-numbers.conf)" + TARBALL_NAME=${FILE_NAME_ROOT}${EA_PART}.tar.${COMPRESSION} XZ_OPT=${XZ_OPT-"-T0"} \ tar --mtime="${TAR_TIME}" --owner=root --group=root --sort=name \ - -$SWITCH "${TARBALL_NAME}" "${TO_COMPRESS}" + --exclude-vcs -$SWITCH "${TARBALL_NAME}" "${TO_COMPRESS}" mv "${TARBALL_NAME}" .. popd if [ "$WITH_TEMP" != "" ] ; then - echo "Tarball is: $(realpath --relative-to=.. .)/${TARBALL_NAME}" + echo "Tarball is: $(realpath .)/${TARBALL_NAME}" popd else echo -n "Done. You may want to remove the uncompressed version" diff --git a/icedtea_sync.sh b/scripts/icedtea_sync.sh similarity index 100% rename from icedtea_sync.sh rename to scripts/icedtea_sync.sh diff --git a/scripts/openjdk_news.sh b/scripts/openjdk_news.sh new file mode 100755 index 0000000..9574915 --- /dev/null +++ b/scripts/openjdk_news.sh @@ -0,0 +1,114 @@ +#!/bin/bash + +# Copyright (C) 2024 Red Hat, Inc. +# Written by Andrew John Hughes , 2012-2022 +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +OLD_RELEASE=$1 +NEW_RELEASE=$2 +REPO=$3 +SUBDIR=$4 +SCRIPT_DIR=$(dirname "${0}") + +if test "${SUBDIR}" = ""; then + echo "No subdirectory specified; using ."; + SUBDIR="."; +fi + +if test "$REPO" = ""; then + echo "No repository specified; using ${PWD}" + REPO=${PWD} +fi + +if test "${TMPDIR}" = ""; then + TMPDIR=/tmp; +fi + +echo "Repository: ${REPO}" + +if [ -e "${REPO}/.git" ] ; then + TYPE=git; +elif [ -e "${REPO}/.hg" ] ; then + TYPE=hg; +else + echo "No Mercurial or Git repository detected."; + exit 1; +fi + +if test "$OLD_RELEASE" = "" || test "$NEW_RELEASE" = ""; then + echo "ERROR: Need to specify old and new release"; + exit 2; +fi + +echo "Listing fixes between $OLD_RELEASE and $NEW_RELEASE in $REPO" +rm -f "${TMPDIR}/fixes2" "${TMPDIR}/fixes3" "${TMPDIR}/fixes" +for repos in . $("${SCRIPT_DIR}/discover_trees.sh" "${REPO}"); +do + if test "$TYPE" = "hg"; then + hg log -r "tag('$NEW_RELEASE'):tag('$OLD_RELEASE') - tag('$OLD_RELEASE')" -R "$REPO/$repos" -G -M "${REPO}/${SUBDIR}" | \ + grep -E '^[o:| ]*summary'|grep -v 'Added tag'|sed -r 's#^[o:| ]*summary:\W*([0-9])# - JDK-\1#'| \ + sed 's#^[o:| ]*summary:\W*# - #' >> "${TMPDIR}/fixes2"; + hg log -v -r "tag('$NEW_RELEASE'):tag('$OLD_RELEASE') - tag('$OLD_RELEASE')" -R "$REPO/$repos" -G -M "${REPO}/${SUBDIR}" | \ + grep -E '^[o:| ]*[0-9]{7}'|sed -r 's#^[o:| ]*([0-9]{7})# - JDK-\1#' >> "${TMPDIR}/fixes3"; + else + git -C "${REPO}" log --no-merges --pretty=format:%B "${NEW_RELEASE}...${OLD_RELEASE}" -- "${SUBDIR}" |grep -E '^[0-9]{7}' | \ + sed -r 's#^([0-9])# - JDK-\1#' >> "${TMPDIR}/fixes2"; + touch "${TMPDIR}/fixes3" ; # unused + fi +done + +sort "${TMPDIR}/fixes2" "${TMPDIR}/fixes3" > "${TMPDIR}/fixes4" +uniq "${TMPDIR}/fixes4" > "${TMPDIR}/fixes" +rm -f "${TMPDIR}/fixes2" "${TMPDIR}/fixes3" + +if ! [ -s "${TMPDIR}/fixes" ] ; then + echo "Failed to obtain fixes."; + exit 3; +fi + +echo "In ${TMPDIR}/fixes:" +cat "${TMPDIR}/fixes" + +printf "\nChecking for duplicates..."; +if uniq -d "${TMPDIR}/fixes4" | grep 'JDK' > "${TMPDIR}/dupes"; then + printf "found.\nWARNING: Review the following duplicates:\n"; + cat "${TMPDIR}/dupes"; +else + echo "No apparent duplicates."; +fi +rm -f "${TMPDIR}/fixes4"; + +printf "\nChecking for backouts..."; +if grep -i 'backout' "${TMPDIR}/fixes" > "${TMPDIR}/backouts"; then + printf "found.\nWARNING: Review the following backouts:\n" + cat "${TMPDIR}/backouts"; +else + echo "No apparent backouts."; +fi +printf "\nChecking for bundled library updates..."; +if grep -iE ':( \(tz\))? update.*(freetype|gif|harfbuzz|lcms|jpeg|png|timezone|zlib)' "${TMPDIR}/fixes" > "${TMPDIR}/bundles"; then + printf "found.\nWARNING: Review the following with respect to bundled provides:\n"; + cat "${TMPDIR}/bundles"; + echo "Compare the output of $(dirname "${0}")/get_bundle_versions.sh with the RPM using the JDK source tree" +else + echo "No apparent library updates."; +fi + +# Local Variables: +# compile-command: "shellcheck openjdk_news.sh" +# fill-column: 80 +# indent-tabs-mode: nil +# sh-basic-offset: 4 +# End: diff --git a/sources b/sources index d00eba7..f50b623 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-24.0.1+9.tar.xz) = 44bd46f4478d6c466850c39bfefd575bf05f349f58512ecb4ec441eebc7282e27b8dc521a3e7b9d086ada0b43f7399f2258a4237b635a891727144b67911a185 +SHA512 (openjdk-24.0.2+12.tar.xz) = 92dc174ad4fedb1138bc183a390a85a76fcc3aa1508d4d00f49012b28a8e3a5a1739b349f0fb03dedc6f7977eafa472c5f7608c61ae656c0ecf795b9e96a95ae From 8ff1c844a9b0eddaef4eb9c735aff84c0a21b2fb Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 21 Jul 2025 20:14:30 +0200 Subject: [PATCH 74/86] Reverted JDK-8350202 can not build on epel8 --- NEWS | 1 - java-latest-openjdk-portable.spec | 3 ++- revert8350202.patch | 31 +++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 revert8350202.patch diff --git a/NEWS b/NEWS index 8a27fc4..12d32ec 100644 --- a/NEWS +++ b/NEWS @@ -132,7 +132,6 @@ New in release OpenJDK 24.0.2+12 (2025-7-15): - JDK-8350103: Test containers/systemd/SystemdMemoryAwarenessTest.java fails on Linux ppc64le SLES15 SP6 - JDK-8350137: After JDK-8348975, Linux builds contain man pages for windows only tools - JDK-8350201: Out of bounds access on Linux aarch64 in os::print_register_info - - JDK-8350202: Tune for Power10 CPUs on Linux ppc64le - JDK-8350211: CTW: Attempt to preload all classes in constant pool - JDK-8350260: Improve HTML instruction formatting in PassFailJFrame - JDK-8350313: Include timings for leaving safepoint in safepoint logging diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 59554cb..8164525 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -707,8 +707,8 @@ Patch1100: 0001-Fix-name-class-of-uabs-with-GCC-15.patch # Portable build specific patches # ############################################# +Patch1101: revert8350202.patch -# Currently empty BuildRequires: autoconf BuildRequires: automake @@ -1000,6 +1000,7 @@ pushd %{top_level_dir_name} # Skipping fips patch whil eit is not ready for jdk22 %%patch -P1001 -p1 # Patches in need of upstreaming %patch -P1100 -p1 +%patch -P1101 -p1 popd # openjdk diff --git a/revert8350202.patch b/revert8350202.patch new file mode 100644 index 0000000..e325128 --- /dev/null +++ b/revert8350202.patch @@ -0,0 +1,31 @@ +From 3b9470ab57d45e491e18e2e86d9f349312016d81 Mon Sep 17 00:00:00 2001 +From: duke +Date: Fri, 7 Mar 2025 15:23:06 +0000 +Subject: [REVERT] Backport e1d0a9c832ef3e92faaed7f290ff56c0ed8a9d94 + +--- + make/autoconf/flags-cflags.m4 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 +index 7f92bd015d3..a740de222d0 100644 +--- a/make/autoconf/flags-cflags.m4 ++++ b/make/autoconf/flags-cflags.m4 +@@ -743,7 +743,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], + elif test "x$FLAGS_CPU" = xppc64le; then + # Little endian machine uses ELFv2 ABI. + # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. +- $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power10" ++ $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8" + fi + elif test "x$FLAGS_CPU" = xs390x; then + $1_CFLAGS_CPU="-mbackchain -march=z10" +@@ -764,7 +764,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], + if test "x$FLAGS_CPU" = xppc64le; then + # Little endian machine uses ELFv2 ABI. + # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. +- $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power10" ++ $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8" + fi + fi + if test "x$OPENJDK_TARGET_OS" = xaix; then From 1d7ca7d82ef2c8c676b4aa5021e95b6812f83390 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 17:55:42 +0000 Subject: [PATCH 75/86] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- java-latest-openjdk-portable.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 8164525..c658ed7 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -568,7 +568,7 @@ Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as # java-X-openjdk. See: https://bugzilla.redhat.com/show_bug.cgi?id=1647298 -Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist} +Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist}.1 # 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 # also included the epoch in their virtual provides. This created a @@ -1734,4 +1734,7 @@ done %endif %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 1:24.0.2.0.12-1.rolling.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + %autochangelog From 05a84d9ee26eb0ff738c645d02795ca1324098ca Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 22 Sep 2025 11:36:37 +0200 Subject: [PATCH 76/86] Bumped to jdk25 --- .gitignore | 5 + ...K-8348975-Linux-builds-contain-man-p.patch | 55 - ...e-the-concept-of-upgradeable-files-i.patch | 381 -- ...ry-second-line-in-upgradeable-files-.patch | 38 - 0001-Fix-name-class-of-uabs-with-GCC-15.patch | 172 - NEWS | 276 +- README.md | 4 +- fips-21u-9203d50836c.patch | 4234 ----------------- java-latest-openjdk-portable.spec | 20 +- jconsole.desktop.in | 1 - revert8350202.patch | 31 - scripts/generate_source_tarball.sh | 4 +- sources | 2 +- 13 files changed, 43 insertions(+), 5180 deletions(-) delete mode 100644 0001-8350137-After-JDK-8348975-Linux-builds-contain-man-p.patch delete mode 100644 0001-8353185-Introduce-the-concept-of-upgradeable-files-i.patch delete mode 100644 0001-8355524-Only-every-second-line-in-upgradeable-files-.patch delete mode 100644 0001-Fix-name-class-of-uabs-with-GCC-15.patch delete mode 100644 fips-21u-9203d50836c.patch delete mode 100644 jconsole.desktop.in delete mode 100644 revert8350202.patch diff --git a/.gitignore b/.gitignore index 7829d87..e5f004c 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,8 @@ /openjdk-24+36.tar.xz /openjdk-24.0.1+9.tar.xz /openjdk-24.0.2+12.tar.xz +/openjdk-25+13-ea.tar.xz +/openjdk-25+26-ea.tar.xz +/openjdk-25+32-ea.tar.xz +/openjdk-jdk-25+36.tar.xz +/openjdk-25+36.tar.xz diff --git a/0001-8350137-After-JDK-8348975-Linux-builds-contain-man-p.patch b/0001-8350137-After-JDK-8348975-Linux-builds-contain-man-p.patch deleted file mode 100644 index c5a9c5c..0000000 --- a/0001-8350137-After-JDK-8348975-Linux-builds-contain-man-p.patch +++ /dev/null @@ -1,55 +0,0 @@ -From ef35e66937108b56742e4f1b9faddf7379aed805 Mon Sep 17 00:00:00 2001 -From: Nizar Benalla -Date: Wed, 26 Feb 2025 17:16:16 +0000 -Subject: [PATCH] 8350137: After JDK-8348975, Linux builds contain man pages - for windows only tools - -Backport-of: 53db57648a09c4c380064eea11fcdb680011d741 ---- - make/Docs.gmk | 2 +- - make/common/Modules.gmk | 9 ++++++++- - 2 files changed, 9 insertions(+), 2 deletions(-) - -diff --git a/make/Docs.gmk b/make/Docs.gmk -index fb2726e6dad..a75d8c74b7c 100644 ---- a/make/Docs.gmk -+++ b/make/Docs.gmk -@@ -680,7 +680,7 @@ ifeq ($(ENABLE_PANDOC), true) - - $(foreach m, $(ALL_MODULES), \ - $(eval MAN_$m := $(call ApplySpecFilter, $(filter %.md, $(call FindFiles, \ -- $(call FindModuleManDirs, $m))))) \ -+ $(call FindModuleManDirsForDocs, $m))))) \ - $(if $(MAN_$m), \ - $(eval $(call SetupProcessMarkdown, MAN_TO_HTML_$m, \ - FILES := $(MAN_$m), \ -diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk -index c8c78ed8041..f87e240ad62 100644 ---- a/make/common/Modules.gmk -+++ b/make/common/Modules.gmk -@@ -92,7 +92,10 @@ SRC_SUBDIRS += share/classes - - SPEC_SUBDIRS += share/specs - --MAN_SUBDIRS += share/man windows/man -+MAN_SUBDIRS += share/man $(TARGET_OS)/man -+ -+# The docs should include the sum of all man pages for all platforms -+MAN_DOCS_SUBDIRS += share/man windows/man - - # Find all module-info.java files for the current build target platform and - # configuration. -@@ -158,6 +161,10 @@ FindModuleManDirs = \ - $(strip $(wildcard \ - $(foreach sub, $(MAN_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS))))) - -+FindModuleManDirsForDocs = \ -+ $(strip $(wildcard \ -+ $(foreach sub, $(MAN_DOCS_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS))))) -+ - # Construct the complete module source path - GetModuleSrcPath = \ - $(call PathList, \ --- -2.49.0 - diff --git a/0001-8353185-Introduce-the-concept-of-upgradeable-files-i.patch b/0001-8353185-Introduce-the-concept-of-upgradeable-files-i.patch deleted file mode 100644 index 829dc76..0000000 --- a/0001-8353185-Introduce-the-concept-of-upgradeable-files-i.patch +++ /dev/null @@ -1,381 +0,0 @@ -From 2c314dcb723d9c5df255761c3016b25fd8fb501e Mon Sep 17 00:00:00 2001 -From: Severin Gehwolf -Date: Thu, 17 Apr 2025 11:44:15 +0000 -Subject: [PATCH] 8353185: Introduce the concept of upgradeable files in - context of JEP 493 - -Backport-of: 4e24dc003c2304041b342371adf430b120a9fec8 ---- - make/modules/jdk.jlink/Java.gmk | 32 ++++ - .../jdk/tools/jlink/internal/JRTArchive.java | 22 ++- - .../jlink/internal/LinkableRuntimeImage.java | 47 +++++- - .../runtimelink/upgrade_files_java.base.conf | 4 + - .../UpgradeableFileCacertsTest.java | 153 ++++++++++++++++++ - 5 files changed, 254 insertions(+), 4 deletions(-) - create mode 100644 make/modules/jdk.jlink/Java.gmk - create mode 100644 src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf - create mode 100644 test/jdk/tools/jlink/runtimeImage/UpgradeableFileCacertsTest.java - -diff --git a/make/modules/jdk.jlink/Java.gmk b/make/modules/jdk.jlink/Java.gmk -new file mode 100644 -index 00000000000..4ddd1eab03d ---- /dev/null -+++ b/make/modules/jdk.jlink/Java.gmk -@@ -0,0 +1,32 @@ -+# -+# Copyright (c) 2025, 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 -+# 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. -+# -+ -+################################################################################ -+ -+# Instruct SetupJavaCompilation for the jdk.jlink module to include -+# upgrade_files_.conf files -+COPY += .conf -+ -+################################################################################ -diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java -index df7d35ac777..aac220e5b94 100644 ---- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java -+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JRTArchive.java -@@ -45,6 +45,7 @@ - import java.util.List; - import java.util.Map; - import java.util.Objects; -+import java.util.Set; - import java.util.function.Function; - import java.util.function.Predicate; - import java.util.stream.Collectors; -@@ -76,6 +77,7 @@ public class JRTArchive implements Archive { - private final Map resDiff; - private final boolean errorOnModifiedFile; - private final TaskHelper taskHelper; -+ private final Set upgradeableFiles; - - /** - * JRTArchive constructor -@@ -86,12 +88,15 @@ public class JRTArchive implements Archive { - * install aborts the link. - * @param perModDiff The lib/modules (a.k.a jimage) diff for this module, - * possibly an empty list if there are no differences. -+ * @param taskHelper The task helper instance. -+ * @param upgradeableFiles The set of files that are allowed for upgrades. - */ - JRTArchive(String module, - Path path, - boolean errorOnModifiedFile, - List perModDiff, -- TaskHelper taskHelper) { -+ TaskHelper taskHelper, -+ Set upgradeableFiles) { - this.module = module; - this.path = path; - this.ref = ModuleFinder.ofSystem() -@@ -105,6 +110,7 @@ public class JRTArchive implements Archive { - this.resDiff = Objects.requireNonNull(perModDiff).stream() - .collect(Collectors.toMap(ResourceDiff::getName, Function.identity())); - this.taskHelper = taskHelper; -+ this.upgradeableFiles = upgradeableFiles; - } - - @Override -@@ -217,7 +223,8 @@ private void addNonClassResources() { - - // Read from the base JDK image. - Path path = BASE.resolve(m.resPath); -- if (shaSumMismatch(path, m.hashOrTarget, m.symlink)) { -+ if (!isUpgradeableFile(m.resPath) && -+ shaSumMismatch(path, m.hashOrTarget, m.symlink)) { - if (errorOnModifiedFile) { - String msg = taskHelper.getMessage("err.runtime.link.modified.file", path.toString()); - IOException cause = new IOException(msg); -@@ -239,6 +246,17 @@ private void addNonClassResources() { - } - } - -+ /** -+ * Certain files in a module are considered upgradeable. That is, -+ * their hash sums aren't checked. -+ * -+ * @param resPath The resource path of the file to check for upgradeability. -+ * @return {@code true} if the file is upgradeable. {@code false} otherwise. -+ */ -+ private boolean isUpgradeableFile(String resPath) { -+ return upgradeableFiles.contains(resPath); -+ } -+ - static boolean shaSumMismatch(Path res, String expectedSha, boolean isSymlink) { - if (isSymlink) { - return false; -diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java -index 935af4585ad..d564ed0bad8 100644 ---- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java -+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java -@@ -28,7 +28,10 @@ - import java.io.IOException; - import java.io.InputStream; - import java.nio.file.Path; -+import java.util.HashSet; - import java.util.List; -+import java.util.Scanner; -+import java.util.Set; - - import jdk.tools.jlink.internal.runtimelink.ResourceDiff; - -@@ -42,6 +45,9 @@ public class LinkableRuntimeImage { - public static final String RESPATH_PATTERN = "jdk/tools/jlink/internal/runtimelink/fs_%s_files"; - // The diff files per module for supporting linking from the run-time image - public static final String DIFF_PATTERN = "jdk/tools/jlink/internal/runtimelink/diff_%s"; -+ // meta data for upgradable files -+ private static final String UPGRADEABLE_FILES_PATTERN = "jdk/tools/jlink/internal/runtimelink/upgrade_files_%s.conf"; -+ private static final Module JDK_JLINK_MOD = LinkableRuntimeImage.class.getModule(); - - /** - * In order to be able to show whether or not a runtime is capable of -@@ -62,7 +68,38 @@ public static boolean isLinkableRuntime() { - - private static InputStream getDiffInputStream(String module) throws IOException { - String resourceName = String.format(DIFF_PATTERN, module); -- return LinkableRuntimeImage.class.getModule().getResourceAsStream(resourceName); -+ return JDK_JLINK_MOD.getResourceAsStream(resourceName); -+ } -+ -+ private static Set upgradeableFiles(String module) { -+ String resourceName = String.format(UPGRADEABLE_FILES_PATTERN, module); -+ InputStream filesIn = null; -+ try { -+ filesIn = JDK_JLINK_MOD.getResourceAsStream(resourceName); -+ } catch (IOException e) { -+ throw new AssertionError("Unexpected IO error getting res stream"); -+ } -+ if (filesIn == null) { -+ // no upgradeable files -+ return Set.of(); -+ } -+ Set upgradeableFiles = new HashSet<>(); -+ final InputStream in = filesIn; -+ try (in; -+ Scanner scanner = new Scanner(filesIn)) { -+ while (scanner.hasNextLine()) { -+ String line = scanner.nextLine(); -+ if (line.trim().startsWith("#")) { -+ // Skip comments -+ continue; -+ } -+ upgradeableFiles.add(scanner.nextLine()); -+ } -+ } catch (IOException e) { -+ throw new AssertionError("Failure to retrieve upgradeable files for " + -+ "module " + module, e); -+ } -+ return upgradeableFiles; - } - - public static Archive newArchive(String module, -@@ -81,7 +118,13 @@ public static Archive newArchive(String module, - throw new AssertionError("Failure to retrieve resource diff for " + - "module " + module, e); - } -- return new JRTArchive(module, path, !ignoreModifiedRuntime, perModuleDiff, taskHelper); -+ Set upgradeableFiles = upgradeableFiles(module); -+ return new JRTArchive(module, -+ path, -+ !ignoreModifiedRuntime, -+ perModuleDiff, -+ taskHelper, -+ upgradeableFiles); - } - - -diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf -new file mode 100644 -index 00000000000..df2ca809f08 ---- /dev/null -+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf -@@ -0,0 +1,4 @@ -+# Configuration for resource paths of files allowed to be -+# upgraded (in java.base) -+lib/tzdb.dat -+lib/security/cacerts -diff --git a/test/jdk/tools/jlink/runtimeImage/UpgradeableFileCacertsTest.java b/test/jdk/tools/jlink/runtimeImage/UpgradeableFileCacertsTest.java -new file mode 100644 -index 00000000000..86e0f8cefd5 ---- /dev/null -+++ b/test/jdk/tools/jlink/runtimeImage/UpgradeableFileCacertsTest.java -@@ -0,0 +1,153 @@ -+/* -+ * Copyright (c) 2025, Red Hat, Inc. -+ * 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. -+ * -+ * 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. -+ */ -+ -+import java.io.ByteArrayInputStream; -+import java.io.ByteArrayOutputStream; -+import java.io.FileInputStream; -+import java.io.FileOutputStream; -+import java.io.IOException; -+import java.io.InputStream; -+import java.nio.file.Path; -+import java.security.KeyStore; -+import java.security.cert.Certificate; -+import java.security.cert.CertificateException; -+import java.security.cert.CertificateFactory; -+import java.security.cert.X509Certificate; -+ -+import jdk.test.lib.process.OutputAnalyzer; -+import tests.Helper; -+ -+/* -+ * @test -+ * @summary Verify that no errors are reported for files that have been -+ * upgraded when linking from the run-time image -+ * @requires (vm.compMode != "Xcomp" & os.maxMemory >= 2g) -+ * @library ../../lib /test/lib -+ * @modules java.base/jdk.internal.jimage -+ * jdk.jlink/jdk.tools.jlink.internal -+ * jdk.jlink/jdk.tools.jlink.plugin -+ * jdk.jlink/jdk.tools.jimage -+ * @build tests.* jdk.test.lib.process.OutputAnalyzer -+ * jdk.test.lib.process.ProcessTools -+ * @run main/othervm -Xmx1g UpgradeableFileCacertsTest -+ */ -+public class UpgradeableFileCacertsTest extends ModifiedFilesTest { -+ -+ /* -+ * Generated with: -+ * $ rm -f server.keystore && keytool -genkey -alias jlink-upgrade-test \ -+ * -keyalg RSA -dname CN=jlink-upgrade-test \ -+ * -storepass changeit -keysize 3072 -sigalg SHA512withRSA \ -+ * -validity 7300 -keystore server.keystore -+ * $ keytool -export -alias jlink-upgrade-test -storepass changeit \ -+ * -keystore server.keystore -rfc -+ */ -+ private static final String CERT = """ -+ -----BEGIN CERTIFICATE----- -+ MIID3jCCAkagAwIBAgIJALiT/+HXBkSIMA0GCSqGSIb3DQEBDQUAMB0xGzAZBgNV -+ BAMTEmpsaW5rLXVwZ3JhZGUtdGVzdDAeFw0yNTA0MDQxMjA3MjJaFw00NTAzMzAx -+ MjA3MjJaMB0xGzAZBgNVBAMTEmpsaW5rLXVwZ3JhZGUtdGVzdDCCAaIwDQYJKoZI -+ hvcNAQEBBQADggGPADCCAYoCggGBANmrnCDKqSXEJRIiSi4yHWN97ILls3RqYjED -+ la3AZTeXnZrrEIgSjVFUMxCztYqbWoVzKa2lov42Vue2BXVYffcQ8TKc2EJDNO+2 -+ uRKQZpsN7RI4QoVBR2Rq8emrO8CrdOQT7Hh4agxkN9AOvGKMFdt+fXeCIPIuflKP -+ f+RfvhLfC2A70Y+Uu74C5uWgLloA/HF0SsVxf9KmqS9fZBQaiTYhKyoDghCRlWpa -+ nPIHB1XVaRdw8aSpCuzIOQzSCTTlLcammJkBjbFwMZdQG7eglTWzIYryZwe/cyY2 -+ xctLVW3xhUHvnMFG+MajeFny2mxNu163Rxf/rBu4e7jRC/LGSU784nJGapq5K170 -+ WbaeceKp+YORJBviFFORrmkPIwIgE+iGCD6PD6Xwu8vcpeuTVDgsSWMlfgCL3NoI -+ GXmdGiI2Xc/hQX7uzu3UBF6IcPDMTcYr2JKYbgu3v2/vDlJu3qO2ycUeePo5jhuG -+ X2WgcHkb6uOU4W5qdbCA+wFPVZBuwQIDAQABoyEwHzAdBgNVHQ4EFgQUtMJM0+ct -+ ssKqryRckk4YEWdYAZkwDQYJKoZIhvcNAQENBQADggGBAI8A6gJQ8wDx12sy2ZI4 -+ 1q9b+WG6w3LcFEF6Fko5NBizhtfmVycQv4mBa/NJgx4DZmd+5d60gJcTp/hJXGY0 -+ LZyFilm/AgxsLNUUQLbHAV6TWqd3ODWwswAuew9sFU6izl286a9W65tbMWL5r1EA -+ t34ZYVWZYbCS9+czU98WomH4uarRAOlzcEUui3ZX6ZcQxWbz/R2wtKcUPUAYnsqH -+ JPivpE25G5xW2Dp/yeQTrlffq9OLgZWVz0jtOguBUMnsUsgCcpQZtqZX08//wtpz -+ ohLHFGvpXTPbRumRasWWtnRR/QqGRT66tYDqybXXz37UtKZ8VKW0sv2ypVbmAEs5 -+ pLkA/3XiXlstJuCD6cW0Gfbpb5rrPPD46O3FDVlmqlTH3b/MsiQREdydqGzqY7uG -+ AA2GFVaKFASA5ls01CfHLAcrKxSVixditXvsjeIqhddB7Pnbsx20RdzPQoeo9/hF -+ WeIrh4zePDPZChuLR8ZyxeVJhLB71nTrTDDjwXarVez9Xw== -+ -----END CERTIFICATE----- -+ """; -+ -+ private static final String CERT_ALIAS = "jlink-upgrade-test"; -+ -+ public static void main(String[] args) throws Exception { -+ UpgradeableFileCacertsTest test = new UpgradeableFileCacertsTest(); -+ test.run(); -+ } -+ -+ @Override -+ String initialImageName() { -+ return "java-base-jlink-upgrade-cacerts"; -+ } -+ -+ @Override -+ void testAndAssert(Path modifiedFile, Helper helper, Path initialImage) throws Exception { -+ CapturingHandler handler = new CapturingHandler(); -+ jlinkUsingImage(new JlinkSpecBuilder() -+ .helper(helper) -+ .imagePath(initialImage) -+ .name("java-base-jlink-upgrade-cacerts-target") -+ .addModule("java.base") -+ .validatingModule("java.base") -+ .build(), handler); -+ OutputAnalyzer analyzer = handler.analyzer(); -+ // verify we don't get any modified warning -+ analyzer.stdoutShouldNotContain(modifiedFile.toString() + " has been modified"); -+ analyzer.stdoutShouldNotContain("java.lang.IllegalArgumentException"); -+ analyzer.stdoutShouldNotContain("IOException"); -+ } -+ -+ // Add an extra certificate in the cacerts file so that it no longer matches -+ // the recorded hash sum at build time. -+ protected Path modifyFileInImage(Path jmodLessImg) -+ throws IOException, AssertionError { -+ Path cacerts = jmodLessImg.resolve(Path.of("lib", "security", "cacerts")); -+ try (FileInputStream fin = new FileInputStream(cacerts.toFile())) { -+ KeyStore certStore = KeyStore.getInstance(cacerts.toFile(), -+ (char[])null); -+ certStore.load(fin, (char[])null); -+ X509Certificate cert; -+ try (ByteArrayInputStream bin = new ByteArrayInputStream(CERT.getBytes())) { -+ cert = (X509Certificate)generateCertificate(bin); -+ } catch (ClassCastException | CertificateException ce) { -+ throw new AssertionError("Test failed unexpectedly", ce); -+ } -+ certStore.setCertificateEntry(CERT_ALIAS, cert); -+ ByteArrayOutputStream bout = new ByteArrayOutputStream(); -+ certStore.store(bout, (char[])null); -+ try (FileOutputStream fout = new FileOutputStream(cacerts.toFile())) { -+ fout.write(bout.toByteArray()); -+ } -+ } catch (Exception e) { -+ throw new AssertionError("Test failed unexpectedly: ", e); -+ } -+ return cacerts; -+ } -+ -+ private Certificate generateCertificate(InputStream in) -+ throws CertificateException, IOException { -+ byte[] data = in.readAllBytes(); -+ return CertificateFactory.getInstance("X.509") -+ .generateCertificate(new ByteArrayInputStream(data)); -+ } -+} --- -2.49.0 - diff --git a/0001-8355524-Only-every-second-line-in-upgradeable-files-.patch b/0001-8355524-Only-every-second-line-in-upgradeable-files-.patch deleted file mode 100644 index 6c1c4e9..0000000 --- a/0001-8355524-Only-every-second-line-in-upgradeable-files-.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 89f9268ed7c2cb86891f23a10482cd459454bd32 Mon Sep 17 00:00:00 2001 -From: Severin Gehwolf -Date: Fri, 25 Apr 2025 08:20:51 +0000 -Subject: [PATCH] 8355524: Only every second line in upgradeable files is being - used - -Reviewed-by: shade, alanb ---- - .../classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java | 2 +- - .../jlink/internal/runtimelink/upgrade_files_java.base.conf | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java -index d564ed0bad8..30c37961829 100644 ---- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java -+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java -@@ -93,7 +93,7 @@ private static Set upgradeableFiles(String module) { - // Skip comments - continue; - } -- upgradeableFiles.add(scanner.nextLine()); -+ upgradeableFiles.add(line); - } - } catch (IOException e) { - throw new AssertionError("Failure to retrieve upgradeable files for " + -diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf -index df2ca809f08..fc5e7b4f328 100644 ---- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf -+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/upgrade_files_java.base.conf -@@ -1,4 +1,4 @@ - # Configuration for resource paths of files allowed to be - # upgraded (in java.base) --lib/tzdb.dat - lib/security/cacerts -+lib/tzdb.dat --- -2.49.0 - diff --git a/0001-Fix-name-class-of-uabs-with-GCC-15.patch b/0001-Fix-name-class-of-uabs-with-GCC-15.patch deleted file mode 100644 index a5031f9..0000000 --- a/0001-Fix-name-class-of-uabs-with-GCC-15.patch +++ /dev/null @@ -1,172 +0,0 @@ -diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp -index b03344f2d80..ec4f2a0d6c3 100644 ---- a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp -+++ b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp -@@ -456,7 +456,7 @@ void Assembler::bang_stack_with_offset(int offset) { Unimplemented(); } - - bool asm_util::operand_valid_for_immediate_bits(int64_t imm, unsigned nbits) { - guarantee(nbits == 8 || nbits == 12, "invalid nbits value"); -- uint64_t uimm = (uint64_t)uabs((jlong)imm); -+ uint64_t uimm = (uint64_t)g_uabs((jlong)imm); - if (uimm < (UCONST64(1) << nbits)) - return true; - if (uimm < (UCONST64(1) << (2 * nbits)) -diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp -index 5c02e30963e..aee4a30b649 100644 ---- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp -+++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp -@@ -932,7 +932,7 @@ class Assembler : public AbstractAssembler { - static const uint64_t branch_range = NOT_DEBUG(128 * M) DEBUG_ONLY(2 * M); - - static bool reachable_from_branch_at(address branch, address target) { -- return uabs(target - branch) < branch_range; -+ return g_uabs(target - branch) < branch_range; - } - - // Unconditional branch (immediate) -diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp -index fd6af0b9b4b..b6aa54b27a4 100644 ---- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp -+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp -@@ -3267,7 +3267,7 @@ void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, uint64_t im - if (fits) { - (this->*insn1)(Rd, Rn, imm); - } else { -- if (uabs(imm) < (1 << 24)) { -+ if (g_uabs(imm) < (1 << 24)) { - (this->*insn1)(Rd, Rn, imm & -(1 << 12)); - (this->*insn1)(Rd, Rd, imm & ((1 << 12)-1)); - } else { -diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp -index f5567dcc03a..0843489900c 100644 ---- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp -+++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp -@@ -1162,7 +1162,7 @@ class StubGenerator: public StubCodeGenerator { - - void copy_memory_small(DecoratorSet decorators, BasicType type, Register s, Register d, Register count, int step) { - bool is_backwards = step < 0; -- size_t granularity = uabs(step); -+ size_t granularity = g_uabs(step); - int direction = is_backwards ? -1 : 1; - - Label Lword, Lint, Lshort, Lbyte; -@@ -1221,7 +1221,7 @@ class StubGenerator: public StubCodeGenerator { - Register s, Register d, Register count, int step) { - copy_direction direction = step < 0 ? copy_backwards : copy_forwards; - bool is_backwards = step < 0; -- unsigned int granularity = uabs(step); -+ unsigned int granularity = g_uabs(step); - const Register t0 = r3, t1 = r4; - - // <= 80 (or 96 for SIMD) bytes do inline. Direction doesn't matter because we always -diff --git a/src/hotspot/cpu/riscv/assembler_riscv.hpp b/src/hotspot/cpu/riscv/assembler_riscv.hpp -index 4773043e1ba..4a19b577d9f 100644 ---- a/src/hotspot/cpu/riscv/assembler_riscv.hpp -+++ b/src/hotspot/cpu/riscv/assembler_riscv.hpp -@@ -3818,7 +3818,7 @@ enum Nf { - static const unsigned long branch_range = 1 * M; - - static bool reachable_from_branch_at(address branch, address target) { -- return uabs(target - branch) < branch_range; -+ return g_uabs(target - branch) < branch_range; - } - - // Decode the given instruction, checking if it's a 16-bit compressed -diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp -index fb4539267ae..e6bbd32bd3e 100644 ---- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp -+++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp -@@ -886,7 +886,7 @@ class StubGenerator: public StubCodeGenerator { - - void copy_memory_v(Register s, Register d, Register count, int step) { - bool is_backward = step < 0; -- int granularity = uabs(step); -+ int granularity = g_uabs(step); - - const Register src = x30, dst = x31, vl = x14, cnt = x15, tmp1 = x16, tmp2 = x17; - assert_different_registers(s, d, cnt, vl, tmp1, tmp2); -@@ -948,7 +948,7 @@ class StubGenerator: public StubCodeGenerator { - } - - bool is_backwards = step < 0; -- int granularity = uabs(step); -+ int granularity = g_uabs(step); - - const Register src = x30, dst = x31, cnt = x15, tmp3 = x16, tmp4 = x17, tmp5 = x14, tmp6 = x13; - const Register gct1 = x28, gct2 = x29, gct3 = t2; -diff --git a/src/hotspot/share/opto/mulnode.cpp b/src/hotspot/share/opto/mulnode.cpp -index 72562a657ea..4691c6a45b0 100644 ---- a/src/hotspot/share/opto/mulnode.cpp -+++ b/src/hotspot/share/opto/mulnode.cpp -@@ -258,7 +258,7 @@ Node *MulINode::Ideal(PhaseGVN *phase, bool can_reshape) { - // Check for negative constant; if so negate the final result - bool sign_flip = false; - -- unsigned int abs_con = uabs(con); -+ unsigned int abs_con = g_uabs(con); - if (abs_con != (unsigned int)con) { - sign_flip = true; - } -@@ -493,7 +493,7 @@ Node *MulLNode::Ideal(PhaseGVN *phase, bool can_reshape) { - - // Check for negative constant; if so negate the final result - bool sign_flip = false; -- julong abs_con = uabs(con); -+ julong abs_con = g_uabs(con); - if (abs_con != (julong)con) { - sign_flip = true; - } -diff --git a/src/hotspot/share/opto/subnode.cpp b/src/hotspot/share/opto/subnode.cpp -index d1384384101..aaf53f80b8b 100644 ---- a/src/hotspot/share/opto/subnode.cpp -+++ b/src/hotspot/share/opto/subnode.cpp -@@ -1943,14 +1943,14 @@ const Type* AbsNode::Value(PhaseGVN* phase) const { - case Type::Int: { - const TypeInt* ti = t1->is_int(); - if (ti->is_con()) { -- return TypeInt::make(uabs(ti->get_con())); -+ return TypeInt::make(g_uabs(ti->get_con())); - } - break; - } - case Type::Long: { - const TypeLong* tl = t1->is_long(); - if (tl->is_con()) { -- return TypeLong::make(uabs(tl->get_con())); -+ return TypeLong::make(g_uabs(tl->get_con())); - } - break; - } -diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp -index cc5f3ebb291..4ec61babec3 100644 ---- a/src/hotspot/share/utilities/globalDefinitions.hpp -+++ b/src/hotspot/share/utilities/globalDefinitions.hpp -@@ -1118,7 +1118,7 @@ inline bool is_even(intx x) { return !is_odd(x); } - - // abs methods which cannot overflow and so are well-defined across - // the entire domain of integer types. --static inline unsigned int uabs(unsigned int n) { -+static inline unsigned int g_uabs(unsigned int n) { - union { - unsigned int result; - int value; -@@ -1127,7 +1127,7 @@ static inline unsigned int uabs(unsigned int n) { - if (value < 0) result = 0-result; - return result; - } --static inline julong uabs(julong n) { -+static inline julong g_uabs(julong n) { - union { - julong result; - jlong value; -@@ -1136,8 +1136,8 @@ static inline julong uabs(julong n) { - if (value < 0) result = 0-result; - return result; - } --static inline julong uabs(jlong n) { return uabs((julong)n); } --static inline unsigned int uabs(int n) { return uabs((unsigned int)n); } -+static inline julong g_uabs(jlong n) { return g_uabs((julong)n); } -+static inline unsigned int g_uabs(int n) { return g_uabs((unsigned int)n); } - - // "to" should be greater than "from." - inline size_t byte_size(void* from, void* to) { diff --git a/NEWS b/NEWS index 12d32ec..d44c7e0 100644 --- a/NEWS +++ b/NEWS @@ -3,255 +3,33 @@ Key: JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY JEP-XYZ: https://openjdk.org/jeps/XYZ -New in release OpenJDK 24.0.2+12 (2025-7-15): -=========================================== -* CVEs - - CVE-2025-30749 - - CVE-2025-30754 - - CVE-2025-50059 - - CVE-2025-50106 -* Changes - - JDK-8217914: java/net/httpclient/ConnectTimeoutHandshakeSync.java failed on connection refused while doing POST - - JDK-8276995: Bug in jdk.jfr.event.gc.collection.TestSystemGC - - JDK-8280991: [XWayland] No displayChanged event after setDisplayMode call - - JDK-8281511: java/net/ipv6tests/UdpTest.java fails with checkTime failed - - JDK-8286204: [Accessibility,macOS,VoiceOver] VoiceOver reads the spinner value 10 as 1 when user iterates to 10 for the first time on macOS - - JDK-8294155: Exception thrown before awaitAndCheck hangs PassFailJFrame - - JDK-8303770: Remove Baltimore root certificate expiring in May 2025 - - JDK-8305010: Test vmTestbase/nsk/jvmti/scenarios/sampling/SP05/sp05t003/TestDescription.java timed out: thread not suspended - - JDK-8314840: 3 gc/epsilon tests ignore external vm options - - JDK-8322983: Virtual Threads: exclude 2 tests - - JDK-8330598: java/net/httpclient/Http1ChunkedTest.java fails with java.util.MissingFormatArgumentException: Format specifier '%s' - - JDK-8330936: [ubsan] exclude function BilinearInterp and ShapeSINextSpan in libawt java2d from ubsan checks - - JDK-8334644: Automate javax/print/attribute/PageRangesException.java - - JDK-8336042: Caller/callee param size mismatch in deoptimization causes crash - - JDK-8338303: Linux ppc64le with toolchain clang - detection failure in early JVM startup - - JDK-8339889: Several compiler tests ignore vm flags and not marked as flagless - - JDK-8340784: Remove PassFailJFrame constructor with screenshots - - JDK-8342524: Use latch in AbstractButton/bug6298940.java instead of delay - - JDK-8342775: [Graal] java/util/concurrent/locks/Lock/OOMEInAQS.java fails OOME thrown from the UncaughtExceptionHandler - - JDK-8343191: Cgroup v1 subsystem fails to set subsystem path - - JDK-8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 - - JDK-8343607: C2: Shenandoah crashes during barrier expansion in Continuation::enter - - JDK-8343882: BasicAnnoTests doesn't handle multiple annotations at the same position - - JDK-8343978: Update the default value of CodeEntryAlignment for Ampere-1A and 1B - - JDK-8344316: security/auth/callback/TextCallbackHandler/Password.java make runnable with JTReg and add the UI - - JDK-8344453: Test jdk/jfr/event/oldobject/TestSanityDefault.java timed out - - JDK-8344581: [TESTBUG] java/awt/Robot/ScreenCaptureRobotTest.java failing on macOS - - JDK-8344629: SSLSocketNoServerHelloClientShutdown test timeout - - JDK-8344892: beans/finder/MethodFinder.findMethod incorrectly returns null - - JDK-8344925: translet-name ignored when package-name is also set - - JDK-8345133: Test sun/security/tools/jarsigner/TsacertOptionTest.java failed: Warning found in stdout - - JDK-8345134: Test sun/security/tools/jarsigner/ConciseJarsigner.java failed: unable to find valid certification path to requested target - - JDK-8345185: Update jpackage to not include service bindings by default - - JDK-8345276: Remove EA from the JDK 24 version string with first RC promotion - - JDK-8345368: java/io/File/createTempFile/SpecialTempFile.java fails on Windows Server 2025 - - JDK-8345569: [ubsan] adjustments to filemap.cpp and virtualspace.cpp for macOS aarch64 - - JDK-8345590: AIX 'make all' fails after JDK-8339480 - - JDK-8345625: Better HTTP connections - - JDK-8345676: [ubsan] ProcessImpl_md.c:561:40: runtime error: applying zero offset to null pointer on macOS aarch64 - - JDK-8345728: [Accessibility,macOS,Screen Magnifier]: JCheckbox unchecked state does not magnify but works for checked state - - JDK-8346049: jdk/test/lib/security/timestamp/TsaServer.java warnings - - JDK-8346264: "Total compile time" counter should include time spent in failing/bailout compiles - - JDK-8346285: Update jarsigner compatibility test for change in default digest algorithm - - JDK-8346581: JRadioButton/ButtonGroupFocusTest.java fails in CI on Linux - - JDK-8346587: Distrust TLS server certificates anchored by Camerfirma Root CAs - - JDK-8346671: java/nio/file/Files/probeContentType/Basic.java fails on Windows 2025 - - JDK-8346705: SNI not sent with Java 22+ using java.net.http.HttpClient.Builder#sslParameters - - JDK-8346832: runtime/CompressedOops/CompressedCPUSpecificClassSpaceReservation.java fails on RISC-V - - JDK-8346880: [aix] java/lang/ProcessHandle/InfoTest.java still fails: "reported cputime less than expected" - - JDK-8346881: [ubsan] logSelection.cpp:154:24 / logSelectionList.cpp:72:94 : runtime error: applying non-zero offset 1 to null pointer - - JDK-8346888: [ubsan] block.cpp:1617:30: runtime error: 9.97582e+36 is outside the range of representable values of type 'int' - - JDK-8346972: Test java/nio/channels/FileChannel/LoopingTruncate.java fails sometimes with IOException: There is not enough space on the disk - - JDK-8347000: Bug in com/sun/net/httpserver/bugs/B6361557.java test - - JDK-8347018: C2: Insertion of Assertion Predicates ignores the effects of PhaseIdealLoop::clone_up_backedge_goo() - - JDK-8347038: [JMH] jdk.incubator.vector.SpiltReplicate fails NoClassDefFoundError - - JDK-8347126: gc/stress/TestStressG1Uncommit.java gets OOM-killed - - JDK-8347171: (dc) java/nio/channels/DatagramChannel/InterruptibleOrNot.java fails with virtual thread factory - - JDK-8347173: java/net/DatagramSocket/InterruptibleDatagramSocket.java fails with virtual thread factory - - JDK-8347267: [macOS]: UnixOperatingSystem.c:67:40: runtime error: division by zero - - JDK-8347268: [ubsan] logOutput.cpp:357:21: runtime error: applying non-zero offset 1 to null pointer - - JDK-8347286: (fs) Remove some extensions from java/nio/file/Files/probeContentType/Basic.java - - JDK-8347296: WinInstallerUiTest fails in local test runs if the path to test work directory is longer that regular - - JDK-8347298: Bug in JPackageCommand.ignoreFakeRuntime() - - JDK-8347300: Don't exclude the "PATH" var from the environment when running app launchers in jpackage tests - - JDK-8347302: Mark test tools/jimage/JImageToolTest.java as flagless - - JDK-8347373: HTTP/2 flow control checks may count unprocessed data twice - - JDK-8347377: Add validation checks for ICC_Profile header fields - - JDK-8347427: JTabbedPane/8134116/Bug8134116.java has no license header - - JDK-8347564: ZGC: Crash in DependencyContext::clean_unloading_dependents - - JDK-8347576: Error output in libjsound has non matching format strings - - JDK-8347629: Test FailOverDirectExecutionControlTest.java fails with -Xcomp - - JDK-8347718: Unexpected NullPointerException in C2 compiled code due to ReduceAllocationMerges - - JDK-8347740: java/io/File/createTempFile/SpecialTempFile.java failing - - JDK-8347847: Enhance jar file support - - JDK-8347995: Race condition in jdk/java/net/httpclient/offline/FixedResponseHttpClient.java - - JDK-8347997: assert(false) failed: EA: missing memory path - - JDK-8348102: java/net/httpclient/HttpClientSNITest.java fails intermittently - - JDK-8348110: Update LCMS to 2.17 - - JDK-8348261: assert(n->is_Mem()) failed: memory node required - - JDK-8348299: Update List/ItemEventTest/ItemEventTest.java - - JDK-8348323: Corrupted timezone string in JVM crash log - - JDK-8348356: Update the release version after forking Apr CPU25_04 - - JDK-8348562: ZGC: segmentation fault due to missing node type check in barrier elision analysis - - JDK-8348582: Set -fstack-protector when building with clang - - JDK-8348596: Update FreeType to 2.13.3 - - JDK-8348597: Update HarfBuzz to 10.4.0 - - JDK-8348598: Update Libpng to 1.6.47 - - JDK-8348600: Update PipeWire to 1.3.81 - - JDK-8348675: TrayIcon tests fail in Ubuntu 24.10 Wayland - - JDK-8348936: [Accessibility,macOS,VoiceOver] VoiceOver doesn't announce untick on toggling the checkbox with "space" key on macOS - - JDK-8348989: Better Glyph drawing - - JDK-8349002: GenShen: Deadlock during shutdown - - JDK-8349039: Adjust exception No type named in database - - JDK-8349058: 'internal proprietary API' warnings make javac warnings unusable - - JDK-8349084: Update vectors used in several PQC benchmarks - - JDK-8349111: Enhance Swing supports - - JDK-8349150: Support precompiled headers on AIX - - JDK-8349183: [BACKOUT] Optimization for StringBuilder append boolean & null - - JDK-8349200: [JMH] time.format.ZonedDateTimeFormatterBenchmark fails - - JDK-8349213: G1: Clearing bitmaps during collection set merging not claimed by region - - JDK-8349214: Improve size optimization flags for MSVC builds - - JDK-8349239: [BACKOUT] Reuse StringLatin1::putCharsAt and StringUTF16::putCharsAt - - JDK-8349348: Refactor ClassLoaderDeadlock.sh and Deadlock.sh to run fully in java - - JDK-8349358: [JMH] Cannot access class jdk.internal.vm.ContinuationScope - - JDK-8349370: Bump version numbers for 24.0.2 - - JDK-8349375: Cleanup AIX special file build settings - - JDK-8349378: Build splashscreen lib with SIZE optimization - - JDK-8349492: Update sun/security/pkcs12/KeytoolOpensslInteropTest.java to use a recent Openssl version - - JDK-8349501: Relocate supporting classes in security/testlibrary to test/lib/jdk tree - - JDK-8349551: Failures in tests after JDK-8345625 - - JDK-8349584: Improve compiler processing - - JDK-8349594: Enhance TLS protocol support - - JDK-8349623: [ASAN] Gtest os_linux.glibc_mallinfo_wrapper_vm fails - - JDK-8349637: Integer.numberOfLeadingZeros outputs incorrectly in certain cases - - JDK-8349751: AIX build failure after upgrade pipewire to 1.3.81 - - JDK-8349753: Incorrect use of CodeBlob::is_buffer_blob() in few places - - JDK-8349787: java/lang/Thread/virtual/ThreadPollOnYield.java#default passes unexpectedly without libVThreadPinner.so - - JDK-8349943: [JMH] Use jvmArgs consistently - - JDK-8350103: Test containers/systemd/SystemdMemoryAwarenessTest.java fails on Linux ppc64le SLES15 SP6 - - JDK-8350137: After JDK-8348975, Linux builds contain man pages for windows only tools - - JDK-8350201: Out of bounds access on Linux aarch64 in os::print_register_info - - JDK-8350211: CTW: Attempt to preload all classes in constant pool - - JDK-8350260: Improve HTML instruction formatting in PassFailJFrame - - JDK-8350313: Include timings for leaving safepoint in safepoint logging - - JDK-8350386: Test TestCodeCacheFull.java fails with option -XX:-UseCodeCacheFlushing - - JDK-8350483: AArch64: turn on signum intrinsics by default on Ampere CPUs - - JDK-8350498: Remove two Camerfirma root CA certificates - - JDK-8350499: Minimal build fails with slowdebug builds - - JDK-8350546: Several java/net/InetAddress tests fails UnknownHostException - - JDK-8350682: [JMH] vector.IndexInRangeBenchmark failed with IndexOutOfBoundsException for size=1024 - - JDK-8350683: Non-C2 / minimal JVM crashes in the build on ppc64 platforms - - JDK-8350786: Some java/lang jtreg tests miss requires vm.hasJFR - - JDK-8350820: OperatingSystemMXBean CpuLoad() methods return -1.0 on Windows - - JDK-8350924: javax/swing/JMenu/4213634/bug4213634.java fails - - JDK-8350991: Improve HTTP client header handling - - JDK-8351033: RISC-V: TestFloat16ScalarOperations asserts with offset (4210) is too large to be patched in one beq/bge/bgeu/blt/bltu/bne instruction! - - JDK-8351223: Update localized resources in keytool and jarsigner - - JDK-8351233: [ASAN] avx2-emu-funcs.hpp:151:20: error: ‘D.82188’ is used uninitialized - - JDK-8351277: Remove pipewire from AIX build - - JDK-8351382: New test containers/docker/TestMemoryWithSubgroups.java is failing - - JDK-8351500: G1: NUMA migrations cause crashes in region allocation - - JDK-8351639: Improve debuggability of test/langtools/jdk/jshell/JdiHangingListenExecutionControlTest.java test - - JDK-8351665: Remove unused UseNUMA in os_aix.cpp - - JDK-8351933: Inaccurate masking of TC subfield decrement in ForkJoinPool - - JDK-8352109: java/awt/Desktop/MailTest.java fails in platforms where Action.MAIL is not supported - - JDK-8352302: Test sun/security/tools/jarsigner/TimestampCheck.java is failing - - JDK-8352508: [Redo] G1: Pinned regions with pinned objects only reachable by native code crash VM - - JDK-8352512: TestVectorZeroCount: counter not reset between iterations - - JDK-8352706: httpclient HeadTest does not run on HTTP2 - - JDK-8352716: (tz) Update Timezone Data to 2025b - - JDK-8352946: SEGV_BND signal code of SIGSEGV missing from our signal-code table - - JDK-8353053: (fs) Add support for UserDefinedFileAttributeView on AIX - - JDK-8353066: Properly detect Windows/aarch64 as build platform - - JDK-8353185: Introduce the concept of upgradeable files in context of JEP 493 - - JDK-8353261: Problemlist 5 tests due to failures in the CI pipeline - - JDK-8353274: [PPC64] Bug related to -XX:+UseCompactObjectHeaders -XX:-UseSIGTRAP in JDK-8305895 - - JDK-8353329: Small memory leak when create GrowableArray with initial size 0 - - JDK-8353709: Debug symbols bundle should contain full debug files when building --with-external-symbols-in-bundles=public - - JDK-8353740: Problemlist 2 tests due to failures in the CI pipeline - - JDK-8353787: Increased number of SHA-384-Digest java.util.jar.Attributes$Name instances leading to higher memory footprint - - JDK-8353861: Problemlist 1 test due to failures in the CI pipeline - - JDK-8353946: Incorrect WINDOWS ifdef in os::build_agent_function_name - - JDK-8354657: Problemlist 2 tests due to failures in the CI pipeline - - JDK-8354831: Problemlist 2 tests due to failures in the CI pipeline - - JDK-8354861: Change milestone to fcs for all releases - - JDK-8354904: [Backout] JDK-8345625: Better HTTP connections - - JDK-8355524: Only every second line in upgradeable files is being used - - JDK-8355884: [macos] java/awt/Frame/I18NTitle.java fails on MacOS - - JDK-8356096: ISO 4217 Amendment 179 Update - - JDK-8359170: Add 2 TLS and 2 CS Sectigo roots - - JDK-8360147: Better Glyph drawing redux -New in release OpenJDK 24.0.1+9 (2025-4-16): +New in release OpenJDK 25.0.0+32 (2025-06-9): =========================================== - - JDK-8211851: (ch) java/nio/channels/AsynchronousSocketChannel/StressLoopback.java times out (aix) - - JDK-8290043: serviceability/attach/ConcAttachTest.java failed "guarantee(!CheckJNICalls) failed: Attached JNI thread exited without being detached" - - JDK-8337494: Clarify JarInputStream behavior - - JDK-8337692: Better TLS connection support - - JDK-8338430: Improve compiler transformations - - JDK-8339356: Test javax/net/ssl/SSLSocket/Tls13PacketSize.java failed with java.net.SocketException: An established connection was aborted by the software in your host machine - - JDK-8342562: Enhance Deflater operations - - JDK-8343007: Enhance Buffered Image handling - - JDK-8344361: Restore null return for invalid services from legacy providers - - JDK-8345276: Remove EA from the JDK 24 version string with first RC promotion - - JDK-8345614: Improve AnnotationFormatError message for duplicate annotation interfaces - - JDK-8345684: OperatingSystemMXBean.getSystemCpuLoad() throws NPE - - JDK-8345959: Make JVM_IsStaticallyLinked JVM_LEAF - - JDK-8346014: Bump version numbers for 24.0.1 - - JDK-8346082: Output JVMTI agent information in hserr files - - JDK-8346239: Improve memory efficiency of JimageDiffGenerator - - JDK-8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI - - JDK-8346587: Distrust TLS server certificates anchored by Camerfirma Root CAs - - JDK-8346688: GenShen: Missing metadata trigger log message - - JDK-8346690: Shenandoah: Fix log message for end of GC usage report - - JDK-8346712: Remove com/sun/net/httpserver/TcpNoDelayNotRequired.java test - - JDK-8346713: [testsuite] NeverActAsServerClassMachine breaks TestPLABAdaptToMinTLABSize.java TestPinnedHumongousFragmentation.java TestPinnedObjectContents.java - - JDK-8346868: RISC-V: compiler/sharedstubs tests fail after JDK-8332689 - - JDK-8346887: DrawFocusRect() may cause an assertion failure - - JDK-8347124: Clean tests with --enable-linkable-runtime - - JDK-8347129: cpuset cgroups controller is required for no good reason - - JDK-8347256: Epsilon: Demote heap size and AlwaysPreTouch warnings to info level - - JDK-8347299: Add annotations to test cases in LicenseTest - - JDK-8347334: JimageDiffGenerator code clean-ups - - JDK-8347424: Fix and rewrite sun/security/x509/DNSName/LeadingPeriod.java test - - JDK-8347496: Test jdk/jfr/jvm/TestModularImage.java fails after JDK-8347124: No javac - - JDK-8347506: Compatible OCSP readtimeout property with OCSP timeout - - JDK-8347564: ZGC: Crash in DependencyContext::clean_unloading_dependents - - JDK-8347847: Enhance jar file support - - JDK-8347911: Limit the length of inflated text chunks - - JDK-8347965: (tz) Update Timezone Data to 2025a - - JDK-8348562: ZGC: segmentation fault due to missing node type check in barrier elision analysis - - JDK-8349058: 'internal proprietary API' warnings make javac warnings unusable - - JDK-8349084: Update vectors used in several PQC benchmarks - - JDK-8349183: [BACKOUT] Optimization for StringBuilder append boolean & null - - JDK-8349239: [BACKOUT] Reuse StringLatin1::putCharsAt and StringUTF16::putCharsAt - - JDK-8349828: Redo - Change milestone to fcs for newly created jdk24.0.1 branch - - JDK-8350820: OperatingSystemMXBean CpuLoad() methods return -1.0 on Windows +JDK 25 is in Rampdown Phase One. The overall feature set is frozen. No further JEPs will be targeted to this release. +The stabilization branch, jdk25, is open for select bug fixes and, with approval, late enhancements per the JDK Release Process (JEP 3). Integrate most stabilization changes via backports from the main line. -New in release OpenJDK 24.0.0+34 (2025-03-18): -=========================================== - - 404: Generational Shenandoah (Experimental) - - 450: Compact Object Headers (Experimental) - - 472: Prepare to Restrict the Use of JNI - - 475: Late Barrier Expansion for G1 - - 478: Key Derivation Function API (Preview) - - 479: Remove the Windows 32-bit x86 Port - - 483: Ahead-of-Time Class Loading & Linking - - 484: Class-File API - - 485: Stream Gatherers - - 486: Permanently Disable the Security Manager - - 487: Scoped Values (Fourth Preview) - - 488: Primitive Types in Patterns, instanceof, and switch (Second Preview) - - 489: Vector API (Ninth Incubator) - - 490: ZGC: Remove the Non-Generational Mode - - 491: Synchronize Virtual Threads without Pinning - - 492: Flexible Constructor Bodies (Third Preview) - - 493: Linking Run-Time Images without JMODs - - 494: Module Import Declarations (Second Preview) - - 495: Simple Source Files and Instance Main Methods (Fourth Preview) - - 496: Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism - - 497: Quantum-Resistant Module-Lattice-Based Digital Signature Algorithm - - 498: Warn upon Use of Memory-Access Methods in sun.misc.Unsafe - - 499: Structured Concurrency (Fourth Preview) - - 501: Deprecate the 32-bit x86 Port for Removal + - JEP-470: PEM Encodings of Cryptographic Objects (Preview) + - JEP-502: Stable Values (Preview) + - JEP-503: Remove the 32-bit x86 Port + - JEP-505: Structured Concurrency (Fifth Preview) + - JEP-506: Scoped Values + - JEP-507: Primitive Types in Patterns, instanceof, and switch (Third Preview) + - JEP-508: Vector API (Tenth Incubator) + - JEP-509: JFR CPU-Time Profiling (Experimental) + - JEP-510: Key Derivation Function API + - JEP-511: Module Import Declarations + - JEP-512: Compact Source Files and Instance Main Methods + - JEP-513: Flexible Constructor Bodies + - JEP-514: Ahead-of-Time Command-Line Ergonomics + - JEP-515: Ahead-of-Time Method Profiling + - JEP-518: JFR Cooperative Sampling + - JEP-519: Compact Object Headers + - JEP-520: JFR Method Timing & Tracing + - JEP-521: Generational Shenandoah + ++ https://openjdk.org/projects/jdk/25/ ++ https://openjdk.org/projects/jdk/24/ ++ https://openjdk.org/projects/jdk/23/ ++ https://openjdk.org/projects/jdk/22/ +In case yo uare moving directly from jdk21 diff --git a/README.md b/README.md index 34d9d78..9a97482 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ This package contains the latest rolling release of OpenJDK. OpenJDK has a release cadence of six months, with a new release in March and September each year. -The current release is OpenJDK 23. For a list of major changes from +The current release is OpenJDK 25. For a list of major changes from OpenJDK 21, see the NEWS file included in this package and the upstream release page: -https://openjdk.org/projects/jdk/23/ +https://openjdk.org/projects/jdk/25/ This package is intended for those who want to follow the latest OpenJDK releases. Long term support versions of OpenJDK are available diff --git a/fips-21u-9203d50836c.patch b/fips-21u-9203d50836c.patch deleted file mode 100644 index 9966391..0000000 --- a/fips-21u-9203d50836c.patch +++ /dev/null @@ -1,4234 +0,0 @@ -diff --git a/make/autoconf/build-aux/pkg.m4 b/make/autoconf/build-aux/pkg.m4 -index 5f4b22bb27f..1ca9f5b8ffe 100644 ---- a/make/autoconf/build-aux/pkg.m4 -+++ b/make/autoconf/build-aux/pkg.m4 -@@ -179,3 +179,19 @@ else - ifelse([$3], , :, [$3]) - fi[]dnl - ])# PKG_CHECK_MODULES -+ -+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -+dnl ------------------------------------------- -+dnl Since: 0.28 -+dnl -+dnl Retrieves the value of the pkg-config variable for the given module. -+AC_DEFUN([PKG_CHECK_VAR], -+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl -+ -+_PKG_CONFIG([$1], [variable="][$3]["], [$2]) -+AS_VAR_COPY([$1], [pkg_cv_][$1]) -+ -+AS_VAR_IF([$1], [""], [$5], [$4])dnl -+])dnl PKG_CHECK_VAR -diff --git a/make/autoconf/lib-sysconf.m4 b/make/autoconf/lib-sysconf.m4 -new file mode 100644 -index 00000000000..f48fc7f7e80 ---- /dev/null -+++ b/make/autoconf/lib-sysconf.m4 -@@ -0,0 +1,87 @@ -+# -+# Copyright (c) 2021, Red Hat, Inc. -+# 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. -+# -+ -+################################################################################ -+# Setup system configuration libraries -+################################################################################ -+AC_DEFUN_ONCE([LIB_SETUP_SYSCONF_LIBS], -+[ -+ ############################################################################### -+ # -+ # Check for the NSS library -+ # -+ AC_MSG_CHECKING([for NSS library directory]) -+ PKG_CHECK_VAR(NSS_LIBDIR, nss, libdir, [AC_MSG_RESULT([$NSS_LIBDIR])], [AC_MSG_RESULT([not found])]) -+ -+ AC_MSG_CHECKING([whether to link the system NSS library with the System Configurator (libsysconf)]) -+ -+ # default is not available -+ DEFAULT_SYSCONF_NSS=no -+ -+ AC_ARG_ENABLE([sysconf-nss], [AS_HELP_STRING([--enable-sysconf-nss], -+ [build the System Configurator (libsysconf) using the system NSS library if available @<:@disabled@:>@])], -+ [ -+ case "${enableval}" in -+ yes) -+ sysconf_nss=yes -+ ;; -+ *) -+ sysconf_nss=no -+ ;; -+ esac -+ ], -+ [ -+ sysconf_nss=${DEFAULT_SYSCONF_NSS} -+ ]) -+ AC_MSG_RESULT([$sysconf_nss]) -+ -+ USE_SYSCONF_NSS=false -+ if test "x${sysconf_nss}" = "xyes"; then -+ PKG_CHECK_MODULES(NSS, nss >= 3.53, [NSS_FOUND=yes], [NSS_FOUND=no]) -+ if test "x${NSS_FOUND}" = "xyes"; then -+ AC_MSG_CHECKING([for system FIPS support in NSS]) -+ saved_libs="${LIBS}" -+ saved_cflags="${CFLAGS}" -+ CFLAGS="${CFLAGS} ${NSS_CFLAGS}" -+ LIBS="${LIBS} ${NSS_LIBS}" -+ AC_LANG_PUSH([C]) -+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], -+ [[SECMOD_GetSystemFIPSEnabled()]])], -+ [AC_MSG_RESULT([yes])], -+ [AC_MSG_RESULT([no]) -+ AC_MSG_ERROR([System NSS FIPS detection unavailable])]) -+ AC_LANG_POP([C]) -+ CFLAGS="${saved_cflags}" -+ LIBS="${saved_libs}" -+ USE_SYSCONF_NSS=true -+ else -+ dnl NSS 3.53 is the one that introduces the SECMOD_GetSystemFIPSEnabled API -+ dnl in nss3/pk11pub.h. -+ AC_MSG_ERROR([--enable-sysconf-nss specified, but NSS 3.53 or above not found.]) -+ fi -+ fi -+ AC_SUBST(USE_SYSCONF_NSS) -+ AC_SUBST(NSS_LIBDIR) -+]) -diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4 -index 51d4f724c33..feb0bcf3e75 100644 ---- a/make/autoconf/libraries.m4 -+++ b/make/autoconf/libraries.m4 -@@ -35,6 +35,7 @@ m4_include([lib-std.m4]) - m4_include([lib-x11.m4]) - - m4_include([lib-tests.m4]) -+m4_include([lib-sysconf.m4]) - - ################################################################################ - # Determine which libraries are needed for this configuration -@@ -128,6 +129,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES], - LIB_SETUP_X11 - - LIB_TESTS_SETUP_GTEST -+ LIB_SETUP_SYSCONF_LIBS - - BASIC_JDKLIB_LIBS="" - BASIC_JDKLIB_LIBS_TARGET="" -diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in -index f6def153c82..4d7abc33427 100644 ---- a/make/autoconf/spec.gmk.in -+++ b/make/autoconf/spec.gmk.in -@@ -873,6 +873,11 @@ INSTALL_SYSCONFDIR=@sysconfdir@ - # Libraries - # - -+USE_SYSCONF_NSS:=@USE_SYSCONF_NSS@ -+NSS_LIBS:=@NSS_LIBS@ -+NSS_CFLAGS:=@NSS_CFLAGS@ -+NSS_LIBDIR:=@NSS_LIBDIR@ -+ - USE_EXTERNAL_LCMS:=@USE_EXTERNAL_LCMS@ - LCMS_CFLAGS:=@LCMS_CFLAGS@ - LCMS_LIBS:=@LCMS_LIBS@ -diff --git a/make/modules/java.base/Gendata.gmk b/make/modules/java.base/Gendata.gmk -index 9e5cfe2d0fc..434ade8e182 100644 ---- a/make/modules/java.base/Gendata.gmk -+++ b/make/modules/java.base/Gendata.gmk -@@ -98,3 +98,17 @@ $(GENDATA_JAVA_SECURITY): $(BUILD_TOOLS_JDK) $(GENDATA_JAVA_SECURITY_SRC) $(REST - TARGETS += $(GENDATA_JAVA_SECURITY) - - ################################################################################ -+ -+GENDATA_NSS_FIPS_CFG_SRC := $(TOPDIR)/src/java.base/share/conf/security/nss.fips.cfg.in -+GENDATA_NSS_FIPS_CFG := $(SUPPORT_OUTPUTDIR)/modules_conf/java.base/security/nss.fips.cfg -+ -+$(GENDATA_NSS_FIPS_CFG): $(GENDATA_NSS_FIPS_CFG_SRC) -+ $(call LogInfo, Generating nss.fips.cfg) -+ $(call MakeTargetDir) -+ $(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/gensrc/java.base/_$(@F), \ -+ ( $(SED) -e 's:@NSS_LIBDIR@:$(NSS_LIBDIR):g' $< ) > $@ \ -+ ) -+ -+TARGETS += $(GENDATA_NSS_FIPS_CFG) -+ -+################################################################################ -diff --git a/make/modules/java.base/Lib.gmk b/make/modules/java.base/Lib.gmk -index 1e0f66726d0..59fe923f2c5 100644 ---- a/make/modules/java.base/Lib.gmk -+++ b/make/modules/java.base/Lib.gmk -@@ -163,6 +163,29 @@ ifeq ($(call isTargetOsType, unix), true) - endif - endif - -+################################################################################ -+# Create the systemconf library -+ -+LIBSYSTEMCONF_CFLAGS := -+LIBSYSTEMCONF_CXXFLAGS := -+ -+ifeq ($(USE_SYSCONF_NSS), true) -+ LIBSYSTEMCONF_CFLAGS += $(NSS_CFLAGS) -DSYSCONF_NSS -+ LIBSYSTEMCONF_CXXFLAGS += $(NSS_CFLAGS) -DSYSCONF_NSS -+endif -+ -+$(eval $(call SetupJdkLibrary, BUILD_LIBSYSTEMCONF, \ -+ NAME := systemconf, \ -+ OPTIMIZATION := LOW, \ -+ CFLAGS := $(CFLAGS_JDKLIB) $(LIBSYSTEMCONF_CFLAGS), \ -+ CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBSYSTEMCONF_CXXFLAGS), \ -+ LDFLAGS := $(LDFLAGS_JDKLIB) \ -+ $(call SET_SHARED_LIBRARY_ORIGIN), \ -+ LIBS_unix := $(LIBDL) $(NSS_LIBS), \ -+)) -+ -+TARGETS += $(BUILD_LIBSYSTEMCONF) -+ - ################################################################################ - # Create the symbols file for static builds. - -diff --git a/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java b/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java -index 10093137151..b023c63ae58 100644 ---- a/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java -+++ b/src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java -@@ -31,6 +31,7 @@ import java.security.SecureRandom; - import java.security.PrivilegedAction; - import java.util.HashMap; - import java.util.List; -+import jdk.internal.access.SharedSecrets; - import static sun.security.util.SecurityConstants.PROVIDER_VER; - import static sun.security.util.SecurityProviderConstants.*; - -@@ -82,6 +83,10 @@ import static sun.security.util.SecurityProviderConstants.*; - - public final class SunJCE extends Provider { - -+ private static final boolean systemFipsEnabled = -+ SharedSecrets.getJavaSecuritySystemConfiguratorAccess() -+ .isSystemFipsEnabled(); -+ - @java.io.Serial - private static final long serialVersionUID = 6812507587804302833L; - -@@ -147,298 +152,299 @@ public final class SunJCE extends Provider { - void putEntries() { - // reuse attribute map and reset before each reuse - HashMap attrs = new HashMap<>(3); -- attrs.put("SupportedModes", "ECB"); -- attrs.put("SupportedPaddings", "NOPADDING|PKCS1PADDING|OAEPPADDING" -- + "|OAEPWITHMD5ANDMGF1PADDING" -- + "|OAEPWITHSHA1ANDMGF1PADDING" -- + "|OAEPWITHSHA-1ANDMGF1PADDING" -- + "|OAEPWITHSHA-224ANDMGF1PADDING" -- + "|OAEPWITHSHA-256ANDMGF1PADDING" -- + "|OAEPWITHSHA-384ANDMGF1PADDING" -- + "|OAEPWITHSHA-512ANDMGF1PADDING" -- + "|OAEPWITHSHA-512/224ANDMGF1PADDING" -- + "|OAEPWITHSHA-512/256ANDMGF1PADDING"); -- attrs.put("SupportedKeyClasses", -- "java.security.interfaces.RSAPublicKey" + -- "|java.security.interfaces.RSAPrivateKey"); -- ps("Cipher", "RSA", -- "com.sun.crypto.provider.RSACipher", null, attrs); -- -- // common block cipher modes, pads -- final String BLOCK_MODES = "ECB|CBC|PCBC|CTR|CTS|CFB|OFB" + -- "|CFB8|CFB16|CFB24|CFB32|CFB40|CFB48|CFB56|CFB64" + -- "|OFB8|OFB16|OFB24|OFB32|OFB40|OFB48|OFB56|OFB64"; -- final String BLOCK_MODES128 = BLOCK_MODES + -- "|CFB72|CFB80|CFB88|CFB96|CFB104|CFB112|CFB120|CFB128" + -- "|OFB72|OFB80|OFB88|OFB96|OFB104|OFB112|OFB120|OFB128"; -- final String BLOCK_PADS = "NOPADDING|PKCS5PADDING|ISO10126PADDING"; -- -- attrs.clear(); -- attrs.put("SupportedModes", BLOCK_MODES); -- attrs.put("SupportedPaddings", BLOCK_PADS); -- attrs.put("SupportedKeyFormats", "RAW"); -- ps("Cipher", "DES", -- "com.sun.crypto.provider.DESCipher", null, attrs); -- psA("Cipher", "DESede", "com.sun.crypto.provider.DESedeCipher", -- attrs); -- ps("Cipher", "Blowfish", -- "com.sun.crypto.provider.BlowfishCipher", null, attrs); -- -- ps("Cipher", "RC2", -- "com.sun.crypto.provider.RC2Cipher", null, attrs); -- -- attrs.clear(); -- attrs.put("SupportedModes", BLOCK_MODES128); -- attrs.put("SupportedPaddings", BLOCK_PADS); -- attrs.put("SupportedKeyFormats", "RAW"); -- psA("Cipher", "AES", -- "com.sun.crypto.provider.AESCipher$General", attrs); -- -- attrs.clear(); -- attrs.put("SupportedKeyFormats", "RAW"); -- psA("Cipher", "AES/KW/NoPadding", -- "com.sun.crypto.provider.KeyWrapCipher$AES_KW_NoPadding", -- attrs); -- ps("Cipher", "AES/KW/PKCS5Padding", -- "com.sun.crypto.provider.KeyWrapCipher$AES_KW_PKCS5Padding", -- null, attrs); -- psA("Cipher", "AES/KWP/NoPadding", -- "com.sun.crypto.provider.KeyWrapCipher$AES_KWP_NoPadding", -- attrs); -- -- psA("Cipher", "AES_128/ECB/NoPadding", -- "com.sun.crypto.provider.AESCipher$AES128_ECB_NoPadding", -- attrs); -- psA("Cipher", "AES_128/CBC/NoPadding", -- "com.sun.crypto.provider.AESCipher$AES128_CBC_NoPadding", -- attrs); -- psA("Cipher", "AES_128/OFB/NoPadding", -- "com.sun.crypto.provider.AESCipher$AES128_OFB_NoPadding", -- attrs); -- psA("Cipher", "AES_128/CFB/NoPadding", -- "com.sun.crypto.provider.AESCipher$AES128_CFB_NoPadding", -- attrs); -- psA("Cipher", "AES_128/KW/NoPadding", -- "com.sun.crypto.provider.KeyWrapCipher$AES128_KW_NoPadding", -- attrs); -- ps("Cipher", "AES_128/KW/PKCS5Padding", -- "com.sun.crypto.provider.KeyWrapCipher$AES128_KW_PKCS5Padding", -- null, attrs); -- psA("Cipher", "AES_128/KWP/NoPadding", -- "com.sun.crypto.provider.KeyWrapCipher$AES128_KWP_NoPadding", -- attrs); -- -- psA("Cipher", "AES_192/ECB/NoPadding", -- "com.sun.crypto.provider.AESCipher$AES192_ECB_NoPadding", -- attrs); -- psA("Cipher", "AES_192/CBC/NoPadding", -- "com.sun.crypto.provider.AESCipher$AES192_CBC_NoPadding", -- attrs); -- psA("Cipher", "AES_192/OFB/NoPadding", -- "com.sun.crypto.provider.AESCipher$AES192_OFB_NoPadding", -- attrs); -- psA("Cipher", "AES_192/CFB/NoPadding", -- "com.sun.crypto.provider.AESCipher$AES192_CFB_NoPadding", -- attrs); -- psA("Cipher", "AES_192/KW/NoPadding", -- "com.sun.crypto.provider.KeyWrapCipher$AES192_KW_NoPadding", -- attrs); -- ps("Cipher", "AES_192/KW/PKCS5Padding", -- "com.sun.crypto.provider.KeyWrapCipher$AES192_KW_PKCS5Padding", -- null, attrs); -- psA("Cipher", "AES_192/KWP/NoPadding", -- "com.sun.crypto.provider.KeyWrapCipher$AES192_KWP_NoPadding", -- attrs); -- -- psA("Cipher", "AES_256/ECB/NoPadding", -- "com.sun.crypto.provider.AESCipher$AES256_ECB_NoPadding", -- attrs); -- psA("Cipher", "AES_256/CBC/NoPadding", -- "com.sun.crypto.provider.AESCipher$AES256_CBC_NoPadding", -- attrs); -- psA("Cipher", "AES_256/OFB/NoPadding", -- "com.sun.crypto.provider.AESCipher$AES256_OFB_NoPadding", -- attrs); -- psA("Cipher", "AES_256/CFB/NoPadding", -- "com.sun.crypto.provider.AESCipher$AES256_CFB_NoPadding", -- attrs); -- psA("Cipher", "AES_256/KW/NoPadding", -- "com.sun.crypto.provider.KeyWrapCipher$AES256_KW_NoPadding", -- attrs); -- ps("Cipher", "AES_256/KW/PKCS5Padding", -- "com.sun.crypto.provider.KeyWrapCipher$AES256_KW_PKCS5Padding", -- null, attrs); -- psA("Cipher", "AES_256/KWP/NoPadding", -- "com.sun.crypto.provider.KeyWrapCipher$AES256_KWP_NoPadding", -- attrs); -- -- attrs.clear(); -- attrs.put("SupportedModes", "GCM"); -- attrs.put("SupportedKeyFormats", "RAW"); -- -- ps("Cipher", "AES/GCM/NoPadding", -- "com.sun.crypto.provider.GaloisCounterMode$AESGCM", null, -- attrs); -- psA("Cipher", "AES_128/GCM/NoPadding", -- "com.sun.crypto.provider.GaloisCounterMode$AES128", -- attrs); -- psA("Cipher", "AES_192/GCM/NoPadding", -- "com.sun.crypto.provider.GaloisCounterMode$AES192", -- attrs); -- psA("Cipher", "AES_256/GCM/NoPadding", -- "com.sun.crypto.provider.GaloisCounterMode$AES256", -- attrs); -- -- attrs.clear(); -- attrs.put("SupportedModes", "CBC"); -- attrs.put("SupportedPaddings", "NOPADDING"); -- attrs.put("SupportedKeyFormats", "RAW"); -- ps("Cipher", "DESedeWrap", -- "com.sun.crypto.provider.DESedeWrapCipher", null, attrs); -- -- attrs.clear(); -- attrs.put("SupportedModes", "ECB"); -- attrs.put("SupportedPaddings", "NOPADDING"); -- attrs.put("SupportedKeyFormats", "RAW"); -- psA("Cipher", "ARCFOUR", -- "com.sun.crypto.provider.ARCFOURCipher", attrs); -- -- attrs.clear(); -- attrs.put("SupportedKeyFormats", "RAW"); -- ps("Cipher", "ChaCha20", -- "com.sun.crypto.provider.ChaCha20Cipher$ChaCha20Only", -- null, attrs); -- psA("Cipher", "ChaCha20-Poly1305", -- "com.sun.crypto.provider.ChaCha20Cipher$ChaCha20Poly1305", -- attrs); -- -- // PBES1 -- psA("Cipher", "PBEWithMD5AndDES", -- "com.sun.crypto.provider.PBEWithMD5AndDESCipher", -- null); -- ps("Cipher", "PBEWithMD5AndTripleDES", -- "com.sun.crypto.provider.PBEWithMD5AndTripleDESCipher"); -- psA("Cipher", "PBEWithSHA1AndDESede", -- "com.sun.crypto.provider.PKCS12PBECipherCore$PBEWithSHA1AndDESede", -- null); -- psA("Cipher", "PBEWithSHA1AndRC2_40", -- "com.sun.crypto.provider.PKCS12PBECipherCore$PBEWithSHA1AndRC2_40", -- null); -- psA("Cipher", "PBEWithSHA1AndRC2_128", -- "com.sun.crypto.provider.PKCS12PBECipherCore$PBEWithSHA1AndRC2_128", -- null); -- psA("Cipher", "PBEWithSHA1AndRC4_40", -- "com.sun.crypto.provider.PKCS12PBECipherCore$PBEWithSHA1AndRC4_40", -- null); -- -- psA("Cipher", "PBEWithSHA1AndRC4_128", -- "com.sun.crypto.provider.PKCS12PBECipherCore$PBEWithSHA1AndRC4_128", -- null); -- -- // PBES2 -- ps("Cipher", "PBEWithHmacSHA1AndAES_128", -- "com.sun.crypto.provider.PBES2Core$HmacSHA1AndAES_128"); -- -- ps("Cipher", "PBEWithHmacSHA224AndAES_128", -- "com.sun.crypto.provider.PBES2Core$HmacSHA224AndAES_128"); -- -- ps("Cipher", "PBEWithHmacSHA256AndAES_128", -- "com.sun.crypto.provider.PBES2Core$HmacSHA256AndAES_128"); -- -- ps("Cipher", "PBEWithHmacSHA384AndAES_128", -- "com.sun.crypto.provider.PBES2Core$HmacSHA384AndAES_128"); -- -- ps("Cipher", "PBEWithHmacSHA512AndAES_128", -- "com.sun.crypto.provider.PBES2Core$HmacSHA512AndAES_128"); -- -- ps("Cipher", "PBEWithHmacSHA512/224AndAES_128", -- "com.sun.crypto.provider.PBES2Core$HmacSHA512_224AndAES_128"); -- -- ps("Cipher", "PBEWithHmacSHA512/256AndAES_128", -- "com.sun.crypto.provider.PBES2Core$HmacSHA512_256AndAES_128"); -- -- -- ps("Cipher", "PBEWithHmacSHA1AndAES_256", -- "com.sun.crypto.provider.PBES2Core$HmacSHA1AndAES_256"); -- -- ps("Cipher", "PBEWithHmacSHA224AndAES_256", -- "com.sun.crypto.provider.PBES2Core$HmacSHA224AndAES_256"); -- -- ps("Cipher", "PBEWithHmacSHA256AndAES_256", -- "com.sun.crypto.provider.PBES2Core$HmacSHA256AndAES_256"); -- -- ps("Cipher", "PBEWithHmacSHA384AndAES_256", -- "com.sun.crypto.provider.PBES2Core$HmacSHA384AndAES_256"); -- -- ps("Cipher", "PBEWithHmacSHA512AndAES_256", -- "com.sun.crypto.provider.PBES2Core$HmacSHA512AndAES_256"); -- -- ps("Cipher", "PBEWithHmacSHA512/224AndAES_256", -- "com.sun.crypto.provider.PBES2Core$HmacSHA512_224AndAES_256"); -- -- ps("Cipher", "PBEWithHmacSHA512/256AndAES_256", -- "com.sun.crypto.provider.PBES2Core$HmacSHA512_256AndAES_256"); -- -- /* -- * Key(pair) Generator engines -- */ -- ps("KeyGenerator", "DES", -- "com.sun.crypto.provider.DESKeyGenerator"); -- psA("KeyGenerator", "DESede", -- "com.sun.crypto.provider.DESedeKeyGenerator", -- null); -- ps("KeyGenerator", "Blowfish", -- "com.sun.crypto.provider.BlowfishKeyGenerator"); -- psA("KeyGenerator", "AES", -- "com.sun.crypto.provider.AESKeyGenerator", -- null); -- ps("KeyGenerator", "RC2", -- "com.sun.crypto.provider.KeyGeneratorCore$RC2KeyGenerator"); -- psA("KeyGenerator", "ARCFOUR", -- "com.sun.crypto.provider.KeyGeneratorCore$ARCFOURKeyGenerator", -- null); -- ps("KeyGenerator", "ChaCha20", -- "com.sun.crypto.provider.KeyGeneratorCore$ChaCha20KeyGenerator"); -- ps("KeyGenerator", "HmacMD5", -- "com.sun.crypto.provider.HmacMD5KeyGenerator"); -- -- psA("KeyGenerator", "HmacSHA1", -- "com.sun.crypto.provider.HmacSHA1KeyGenerator", null); -- psA("KeyGenerator", "HmacSHA224", -- "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA224", -- null); -- psA("KeyGenerator", "HmacSHA256", -- "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA256", -- null); -- psA("KeyGenerator", "HmacSHA384", -- "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA384", -- null); -- psA("KeyGenerator", "HmacSHA512", -- "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA512", -- null); -- psA("KeyGenerator", "HmacSHA512/224", -- "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA512_224", -- null); -- psA("KeyGenerator", "HmacSHA512/256", -- "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA512_256", -- null); -- -- psA("KeyGenerator", "HmacSHA3-224", -- "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA3_224", -- null); -- psA("KeyGenerator", "HmacSHA3-256", -- "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA3_256", -- null); -- psA("KeyGenerator", "HmacSHA3-384", -- "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA3_384", -- null); -- psA("KeyGenerator", "HmacSHA3-512", -- "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA3_512", -- null); -- -- psA("KeyPairGenerator", "DiffieHellman", -- "com.sun.crypto.provider.DHKeyPairGenerator", -- null); -+ if (!systemFipsEnabled) { -+ attrs.put("SupportedModes", "ECB"); -+ attrs.put("SupportedPaddings", "NOPADDING|PKCS1PADDING|OAEPPADDING" -+ + "|OAEPWITHMD5ANDMGF1PADDING" -+ + "|OAEPWITHSHA1ANDMGF1PADDING" -+ + "|OAEPWITHSHA-1ANDMGF1PADDING" -+ + "|OAEPWITHSHA-224ANDMGF1PADDING" -+ + "|OAEPWITHSHA-256ANDMGF1PADDING" -+ + "|OAEPWITHSHA-384ANDMGF1PADDING" -+ + "|OAEPWITHSHA-512ANDMGF1PADDING" -+ + "|OAEPWITHSHA-512/224ANDMGF1PADDING" -+ + "|OAEPWITHSHA-512/256ANDMGF1PADDING"); -+ attrs.put("SupportedKeyClasses", -+ "java.security.interfaces.RSAPublicKey" + -+ "|java.security.interfaces.RSAPrivateKey"); -+ ps("Cipher", "RSA", -+ "com.sun.crypto.provider.RSACipher", null, attrs); -+ -+ // common block cipher modes, pads -+ final String BLOCK_MODES = "ECB|CBC|PCBC|CTR|CTS|CFB|OFB" + -+ "|CFB8|CFB16|CFB24|CFB32|CFB40|CFB48|CFB56|CFB64" + -+ "|OFB8|OFB16|OFB24|OFB32|OFB40|OFB48|OFB56|OFB64"; -+ final String BLOCK_MODES128 = BLOCK_MODES + -+ "|CFB72|CFB80|CFB88|CFB96|CFB104|CFB112|CFB120|CFB128" + -+ "|OFB72|OFB80|OFB88|OFB96|OFB104|OFB112|OFB120|OFB128"; -+ final String BLOCK_PADS = "NOPADDING|PKCS5PADDING|ISO10126PADDING"; -+ -+ attrs.clear(); -+ attrs.put("SupportedModes", BLOCK_MODES); -+ attrs.put("SupportedPaddings", BLOCK_PADS); -+ attrs.put("SupportedKeyFormats", "RAW"); -+ ps("Cipher", "DES", -+ "com.sun.crypto.provider.DESCipher", null, attrs); -+ psA("Cipher", "DESede", "com.sun.crypto.provider.DESedeCipher", -+ attrs); -+ ps("Cipher", "Blowfish", -+ "com.sun.crypto.provider.BlowfishCipher", null, attrs); -+ -+ ps("Cipher", "RC2", -+ "com.sun.crypto.provider.RC2Cipher", null, attrs); -+ -+ attrs.clear(); -+ attrs.put("SupportedModes", BLOCK_MODES128); -+ attrs.put("SupportedPaddings", BLOCK_PADS); -+ attrs.put("SupportedKeyFormats", "RAW"); -+ psA("Cipher", "AES", -+ "com.sun.crypto.provider.AESCipher$General", attrs); -+ -+ attrs.clear(); -+ attrs.put("SupportedKeyFormats", "RAW"); -+ psA("Cipher", "AES/KW/NoPadding", -+ "com.sun.crypto.provider.KeyWrapCipher$AES_KW_NoPadding", -+ attrs); -+ ps("Cipher", "AES/KW/PKCS5Padding", -+ "com.sun.crypto.provider.KeyWrapCipher$AES_KW_PKCS5Padding", -+ null, attrs); -+ psA("Cipher", "AES/KWP/NoPadding", -+ "com.sun.crypto.provider.KeyWrapCipher$AES_KWP_NoPadding", -+ attrs); -+ -+ psA("Cipher", "AES_128/ECB/NoPadding", -+ "com.sun.crypto.provider.AESCipher$AES128_ECB_NoPadding", -+ attrs); -+ psA("Cipher", "AES_128/CBC/NoPadding", -+ "com.sun.crypto.provider.AESCipher$AES128_CBC_NoPadding", -+ attrs); -+ psA("Cipher", "AES_128/OFB/NoPadding", -+ "com.sun.crypto.provider.AESCipher$AES128_OFB_NoPadding", -+ attrs); -+ psA("Cipher", "AES_128/CFB/NoPadding", -+ "com.sun.crypto.provider.AESCipher$AES128_CFB_NoPadding", -+ attrs); -+ psA("Cipher", "AES_128/KW/NoPadding", -+ "com.sun.crypto.provider.KeyWrapCipher$AES128_KW_NoPadding", -+ attrs); -+ ps("Cipher", "AES_128/KW/PKCS5Padding", -+ "com.sun.crypto.provider.KeyWrapCipher$AES128_KW_PKCS5Padding", -+ null, attrs); -+ psA("Cipher", "AES_128/KWP/NoPadding", -+ "com.sun.crypto.provider.KeyWrapCipher$AES128_KWP_NoPadding", -+ attrs); -+ -+ psA("Cipher", "AES_192/ECB/NoPadding", -+ "com.sun.crypto.provider.AESCipher$AES192_ECB_NoPadding", -+ attrs); -+ psA("Cipher", "AES_192/CBC/NoPadding", -+ "com.sun.crypto.provider.AESCipher$AES192_CBC_NoPadding", -+ attrs); -+ psA("Cipher", "AES_192/OFB/NoPadding", -+ "com.sun.crypto.provider.AESCipher$AES192_OFB_NoPadding", -+ attrs); -+ psA("Cipher", "AES_192/CFB/NoPadding", -+ "com.sun.crypto.provider.AESCipher$AES192_CFB_NoPadding", -+ attrs); -+ psA("Cipher", "AES_192/KW/NoPadding", -+ "com.sun.crypto.provider.KeyWrapCipher$AES192_KW_NoPadding", -+ attrs); -+ ps("Cipher", "AES_192/KW/PKCS5Padding", -+ "com.sun.crypto.provider.KeyWrapCipher$AES192_KW_PKCS5Padding", -+ null, attrs); -+ psA("Cipher", "AES_192/KWP/NoPadding", -+ "com.sun.crypto.provider.KeyWrapCipher$AES192_KWP_NoPadding", -+ attrs); -+ -+ psA("Cipher", "AES_256/ECB/NoPadding", -+ "com.sun.crypto.provider.AESCipher$AES256_ECB_NoPadding", -+ attrs); -+ psA("Cipher", "AES_256/CBC/NoPadding", -+ "com.sun.crypto.provider.AESCipher$AES256_CBC_NoPadding", -+ attrs); -+ psA("Cipher", "AES_256/OFB/NoPadding", -+ "com.sun.crypto.provider.AESCipher$AES256_OFB_NoPadding", -+ attrs); -+ psA("Cipher", "AES_256/CFB/NoPadding", -+ "com.sun.crypto.provider.AESCipher$AES256_CFB_NoPadding", -+ attrs); -+ psA("Cipher", "AES_256/KW/NoPadding", -+ "com.sun.crypto.provider.KeyWrapCipher$AES256_KW_NoPadding", -+ attrs); -+ ps("Cipher", "AES_256/KW/PKCS5Padding", -+ "com.sun.crypto.provider.KeyWrapCipher$AES256_KW_PKCS5Padding", -+ null, attrs); -+ psA("Cipher", "AES_256/KWP/NoPadding", -+ "com.sun.crypto.provider.KeyWrapCipher$AES256_KWP_NoPadding", -+ attrs); -+ -+ attrs.clear(); -+ attrs.put("SupportedModes", "GCM"); -+ attrs.put("SupportedKeyFormats", "RAW"); -+ -+ ps("Cipher", "AES/GCM/NoPadding", -+ "com.sun.crypto.provider.GaloisCounterMode$AESGCM", null, -+ attrs); -+ psA("Cipher", "AES_128/GCM/NoPadding", -+ "com.sun.crypto.provider.GaloisCounterMode$AES128", -+ attrs); -+ psA("Cipher", "AES_192/GCM/NoPadding", -+ "com.sun.crypto.provider.GaloisCounterMode$AES192", -+ attrs); -+ psA("Cipher", "AES_256/GCM/NoPadding", -+ "com.sun.crypto.provider.GaloisCounterMode$AES256", -+ attrs); -+ -+ attrs.clear(); -+ attrs.put("SupportedModes", "CBC"); -+ attrs.put("SupportedPaddings", "NOPADDING"); -+ attrs.put("SupportedKeyFormats", "RAW"); -+ ps("Cipher", "DESedeWrap", -+ "com.sun.crypto.provider.DESedeWrapCipher", null, attrs); -+ -+ attrs.clear(); -+ attrs.put("SupportedModes", "ECB"); -+ attrs.put("SupportedPaddings", "NOPADDING"); -+ attrs.put("SupportedKeyFormats", "RAW"); -+ psA("Cipher", "ARCFOUR", -+ "com.sun.crypto.provider.ARCFOURCipher", attrs); -+ -+ attrs.clear(); -+ attrs.put("SupportedKeyFormats", "RAW"); -+ ps("Cipher", "ChaCha20", -+ "com.sun.crypto.provider.ChaCha20Cipher$ChaCha20Only", -+ null, attrs); -+ psA("Cipher", "ChaCha20-Poly1305", -+ "com.sun.crypto.provider.ChaCha20Cipher$ChaCha20Poly1305", -+ attrs); -+ -+ // PBES1 -+ psA("Cipher", "PBEWithMD5AndDES", -+ "com.sun.crypto.provider.PBEWithMD5AndDESCipher", -+ null); -+ ps("Cipher", "PBEWithMD5AndTripleDES", -+ "com.sun.crypto.provider.PBEWithMD5AndTripleDESCipher"); -+ psA("Cipher", "PBEWithSHA1AndDESede", -+ "com.sun.crypto.provider.PKCS12PBECipherCore$PBEWithSHA1AndDESede", -+ null); -+ psA("Cipher", "PBEWithSHA1AndRC2_40", -+ "com.sun.crypto.provider.PKCS12PBECipherCore$PBEWithSHA1AndRC2_40", -+ null); -+ psA("Cipher", "PBEWithSHA1AndRC2_128", -+ "com.sun.crypto.provider.PKCS12PBECipherCore$PBEWithSHA1AndRC2_128", -+ null); -+ psA("Cipher", "PBEWithSHA1AndRC4_40", -+ "com.sun.crypto.provider.PKCS12PBECipherCore$PBEWithSHA1AndRC4_40", -+ null); -+ -+ psA("Cipher", "PBEWithSHA1AndRC4_128", -+ "com.sun.crypto.provider.PKCS12PBECipherCore$PBEWithSHA1AndRC4_128", -+ null); -+ -+ // PBES2 -+ ps("Cipher", "PBEWithHmacSHA1AndAES_128", -+ "com.sun.crypto.provider.PBES2Core$HmacSHA1AndAES_128"); -+ -+ ps("Cipher", "PBEWithHmacSHA224AndAES_128", -+ "com.sun.crypto.provider.PBES2Core$HmacSHA224AndAES_128"); -+ -+ ps("Cipher", "PBEWithHmacSHA256AndAES_128", -+ "com.sun.crypto.provider.PBES2Core$HmacSHA256AndAES_128"); -+ -+ ps("Cipher", "PBEWithHmacSHA384AndAES_128", -+ "com.sun.crypto.provider.PBES2Core$HmacSHA384AndAES_128"); -+ -+ ps("Cipher", "PBEWithHmacSHA512AndAES_128", -+ "com.sun.crypto.provider.PBES2Core$HmacSHA512AndAES_128"); -+ -+ ps("Cipher", "PBEWithHmacSHA512/224AndAES_128", -+ "com.sun.crypto.provider.PBES2Core$HmacSHA512_224AndAES_128"); -+ -+ ps("Cipher", "PBEWithHmacSHA512/256AndAES_128", -+ "com.sun.crypto.provider.PBES2Core$HmacSHA512_256AndAES_128"); -+ -+ ps("Cipher", "PBEWithHmacSHA1AndAES_256", -+ "com.sun.crypto.provider.PBES2Core$HmacSHA1AndAES_256"); -+ -+ ps("Cipher", "PBEWithHmacSHA224AndAES_256", -+ "com.sun.crypto.provider.PBES2Core$HmacSHA224AndAES_256"); -+ -+ ps("Cipher", "PBEWithHmacSHA256AndAES_256", -+ "com.sun.crypto.provider.PBES2Core$HmacSHA256AndAES_256"); -+ -+ ps("Cipher", "PBEWithHmacSHA384AndAES_256", -+ "com.sun.crypto.provider.PBES2Core$HmacSHA384AndAES_256"); -+ -+ ps("Cipher", "PBEWithHmacSHA512AndAES_256", -+ "com.sun.crypto.provider.PBES2Core$HmacSHA512AndAES_256"); -+ -+ ps("Cipher", "PBEWithHmacSHA512/224AndAES_256", -+ "com.sun.crypto.provider.PBES2Core$HmacSHA512_224AndAES_256"); -+ -+ ps("Cipher", "PBEWithHmacSHA512/256AndAES_256", -+ "com.sun.crypto.provider.PBES2Core$HmacSHA512_256AndAES_256"); -+ -+ /* -+ * Key(pair) Generator engines -+ */ -+ ps("KeyGenerator", "DES", -+ "com.sun.crypto.provider.DESKeyGenerator"); -+ psA("KeyGenerator", "DESede", -+ "com.sun.crypto.provider.DESedeKeyGenerator", -+ null); -+ ps("KeyGenerator", "Blowfish", -+ "com.sun.crypto.provider.BlowfishKeyGenerator"); -+ psA("KeyGenerator", "AES", -+ "com.sun.crypto.provider.AESKeyGenerator", -+ null); -+ ps("KeyGenerator", "RC2", -+ "com.sun.crypto.provider.KeyGeneratorCore$RC2KeyGenerator"); -+ psA("KeyGenerator", "ARCFOUR", -+ "com.sun.crypto.provider.KeyGeneratorCore$ARCFOURKeyGenerator", -+ null); -+ ps("KeyGenerator", "ChaCha20", -+ "com.sun.crypto.provider.KeyGeneratorCore$ChaCha20KeyGenerator"); -+ ps("KeyGenerator", "HmacMD5", -+ "com.sun.crypto.provider.HmacMD5KeyGenerator"); -+ -+ psA("KeyGenerator", "HmacSHA1", -+ "com.sun.crypto.provider.HmacSHA1KeyGenerator", null); -+ psA("KeyGenerator", "HmacSHA224", -+ "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA224", -+ null); -+ psA("KeyGenerator", "HmacSHA256", -+ "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA256", -+ null); -+ psA("KeyGenerator", "HmacSHA384", -+ "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA384", -+ null); -+ psA("KeyGenerator", "HmacSHA512", -+ "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA512", -+ null); -+ psA("KeyGenerator", "HmacSHA512/224", -+ "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA512_224", -+ null); -+ psA("KeyGenerator", "HmacSHA512/256", -+ "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA512_256", -+ null); -+ -+ psA("KeyGenerator", "HmacSHA3-224", -+ "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA3_224", -+ null); -+ psA("KeyGenerator", "HmacSHA3-256", -+ "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA3_256", -+ null); -+ psA("KeyGenerator", "HmacSHA3-384", -+ "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA3_384", -+ null); -+ psA("KeyGenerator", "HmacSHA3-512", -+ "com.sun.crypto.provider.KeyGeneratorCore$HmacKG$SHA3_512", -+ null); -+ -+ psA("KeyPairGenerator", "DiffieHellman", -+ "com.sun.crypto.provider.DHKeyPairGenerator", -+ null); -+ } - - /* - * Algorithm parameter generation engines -@@ -447,15 +453,17 @@ public final class SunJCE extends Provider { - "DiffieHellman", "com.sun.crypto.provider.DHParameterGenerator", - null); - -- /* -- * Key Agreement engines -- */ -- attrs.clear(); -- attrs.put("SupportedKeyClasses", "javax.crypto.interfaces.DHPublicKey" + -- "|javax.crypto.interfaces.DHPrivateKey"); -- psA("KeyAgreement", "DiffieHellman", -- "com.sun.crypto.provider.DHKeyAgreement", -- attrs); -+ if (!systemFipsEnabled) { -+ /* -+ * Key Agreement engines -+ */ -+ attrs.clear(); -+ attrs.put("SupportedKeyClasses", "javax.crypto.interfaces.DHPublicKey" + -+ "|javax.crypto.interfaces.DHPrivateKey"); -+ psA("KeyAgreement", "DiffieHellman", -+ "com.sun.crypto.provider.DHKeyAgreement", -+ attrs); -+ } - - /* - * Algorithm Parameter engines -@@ -625,10 +633,10 @@ public final class SunJCE extends Provider { - "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512AndAES_128"); - - ps("SecretKeyFactory", "PBEWithHmacSHA512/224AndAES_128", -- "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_224AndAES_128"); -+ "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_224AndAES_128"); - - ps("SecretKeyFactory", "PBEWithHmacSHA512/256AndAES_128", -- "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_256AndAES_128"); -+ "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_256AndAES_128"); - - ps("SecretKeyFactory", "PBEWithHmacSHA1AndAES_256", - "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA1AndAES_256"); -@@ -651,136 +659,137 @@ public final class SunJCE extends Provider { - ps("SecretKeyFactory", "PBEWithHmacSHA512/256AndAES_256", - "com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_256AndAES_256"); - -- // PBKDF2 -- psA("SecretKeyFactory", "PBKDF2WithHmacSHA1", -- "com.sun.crypto.provider.PBKDF2Core$HmacSHA1", -- null); -- ps("SecretKeyFactory", "PBKDF2WithHmacSHA224", -- "com.sun.crypto.provider.PBKDF2Core$HmacSHA224"); -- ps("SecretKeyFactory", "PBKDF2WithHmacSHA256", -- "com.sun.crypto.provider.PBKDF2Core$HmacSHA256"); -- ps("SecretKeyFactory", "PBKDF2WithHmacSHA384", -- "com.sun.crypto.provider.PBKDF2Core$HmacSHA384"); -- ps("SecretKeyFactory", "PBKDF2WithHmacSHA512", -- "com.sun.crypto.provider.PBKDF2Core$HmacSHA512"); -- ps("SecretKeyFactory", "PBKDF2WithHmacSHA512/224", -- "com.sun.crypto.provider.PBKDF2Core$HmacSHA512_224"); -- ps("SecretKeyFactory", "PBKDF2WithHmacSHA512/256", -- "com.sun.crypto.provider.PBKDF2Core$HmacSHA512_256"); -- -- /* -- * MAC -- */ -- attrs.clear(); -- attrs.put("SupportedKeyFormats", "RAW"); -- ps("Mac", "HmacMD5", "com.sun.crypto.provider.HmacMD5", null, attrs); -- psA("Mac", "HmacSHA1", "com.sun.crypto.provider.HmacSHA1", -- attrs); -- psA("Mac", "HmacSHA224", -- "com.sun.crypto.provider.HmacCore$HmacSHA224", attrs); -- psA("Mac", "HmacSHA256", -- "com.sun.crypto.provider.HmacCore$HmacSHA256", attrs); -- psA("Mac", "HmacSHA384", -- "com.sun.crypto.provider.HmacCore$HmacSHA384", attrs); -- psA("Mac", "HmacSHA512", -- "com.sun.crypto.provider.HmacCore$HmacSHA512", attrs); -- psA("Mac", "HmacSHA512/224", -- "com.sun.crypto.provider.HmacCore$HmacSHA512_224", attrs); -- psA("Mac", "HmacSHA512/256", -- "com.sun.crypto.provider.HmacCore$HmacSHA512_256", attrs); -- psA("Mac", "HmacSHA3-224", -- "com.sun.crypto.provider.HmacCore$HmacSHA3_224", attrs); -- psA("Mac", "HmacSHA3-256", -- "com.sun.crypto.provider.HmacCore$HmacSHA3_256", attrs); -- psA("Mac", "HmacSHA3-384", -- "com.sun.crypto.provider.HmacCore$HmacSHA3_384", attrs); -- psA("Mac", "HmacSHA3-512", -- "com.sun.crypto.provider.HmacCore$HmacSHA3_512", attrs); -- -- ps("Mac", "HmacPBESHA1", -- "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA1", -- null, attrs); -- ps("Mac", "HmacPBESHA224", -- "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA224", -- null, attrs); -- ps("Mac", "HmacPBESHA256", -- "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA256", -- null, attrs); -- ps("Mac", "HmacPBESHA384", -- "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA384", -- null, attrs); -- ps("Mac", "HmacPBESHA512", -- "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA512", -- null, attrs); -- ps("Mac", "HmacPBESHA512/224", -- "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA512_224", -- null, attrs); -- ps("Mac", "HmacPBESHA512/256", -- "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA512_256", -- null, attrs); -- -- -- // PBMAC1 -- ps("Mac", "PBEWithHmacSHA1", -- "com.sun.crypto.provider.PBMAC1Core$HmacSHA1", null, attrs); -- ps("Mac", "PBEWithHmacSHA224", -- "com.sun.crypto.provider.PBMAC1Core$HmacSHA224", null, attrs); -- ps("Mac", "PBEWithHmacSHA256", -- "com.sun.crypto.provider.PBMAC1Core$HmacSHA256", null, attrs); -- ps("Mac", "PBEWithHmacSHA384", -- "com.sun.crypto.provider.PBMAC1Core$HmacSHA384", null, attrs); -- ps("Mac", "PBEWithHmacSHA512", -- "com.sun.crypto.provider.PBMAC1Core$HmacSHA512", null, attrs); -- ps("Mac", "PBEWithHmacSHA512/224", -- "com.sun.crypto.provider.PBMAC1Core$HmacSHA512_224", null, attrs); -- ps("Mac", "PBEWithHmacSHA512/256", -- "com.sun.crypto.provider.PBMAC1Core$HmacSHA512_256", null, attrs); -- -- ps("Mac", "SslMacMD5", -- "com.sun.crypto.provider.SslMacCore$SslMacMD5", null, attrs); -- ps("Mac", "SslMacSHA1", -- "com.sun.crypto.provider.SslMacCore$SslMacSHA1", null, attrs); -- -- /* -- * KeyStore -- */ -- ps("KeyStore", "JCEKS", -- "com.sun.crypto.provider.JceKeyStore"); -- -- /* -- * KEMs -- */ -- attrs.clear(); -- attrs.put("ImplementedIn", "Software"); -- attrs.put("SupportedKeyClasses", "java.security.interfaces.ECKey" + -- "|java.security.interfaces.XECKey"); -- ps("KEM", "DHKEM", "com.sun.crypto.provider.DHKEM", null, attrs); -- -- /* -- * SSL/TLS mechanisms -- * -- * These are strictly internal implementations and may -- * be changed at any time. These names were chosen -- * because PKCS11/SunPKCS11 does not yet have TLS1.2 -- * mechanisms, and it will cause calls to come here. -- */ -- ps("KeyGenerator", "SunTlsPrf", -- "com.sun.crypto.provider.TlsPrfGenerator$V10"); -- ps("KeyGenerator", "SunTls12Prf", -- "com.sun.crypto.provider.TlsPrfGenerator$V12"); -- -- ps("KeyGenerator", "SunTlsMasterSecret", -- "com.sun.crypto.provider.TlsMasterSecretGenerator", -- List.of("SunTls12MasterSecret", "SunTlsExtendedMasterSecret"), -- null); -- -- ps("KeyGenerator", "SunTlsKeyMaterial", -- "com.sun.crypto.provider.TlsKeyMaterialGenerator", -- List.of("SunTls12KeyMaterial"), null); -- -- ps("KeyGenerator", "SunTlsRsaPremasterSecret", -- "com.sun.crypto.provider.TlsRsaPremasterSecretGenerator", -- List.of("SunTls12RsaPremasterSecret"), null); -+ if (!systemFipsEnabled) { -+ // PBKDF2 -+ psA("SecretKeyFactory", "PBKDF2WithHmacSHA1", -+ "com.sun.crypto.provider.PBKDF2Core$HmacSHA1", -+ null); -+ ps("SecretKeyFactory", "PBKDF2WithHmacSHA224", -+ "com.sun.crypto.provider.PBKDF2Core$HmacSHA224"); -+ ps("SecretKeyFactory", "PBKDF2WithHmacSHA256", -+ "com.sun.crypto.provider.PBKDF2Core$HmacSHA256"); -+ ps("SecretKeyFactory", "PBKDF2WithHmacSHA384", -+ "com.sun.crypto.provider.PBKDF2Core$HmacSHA384"); -+ ps("SecretKeyFactory", "PBKDF2WithHmacSHA512", -+ "com.sun.crypto.provider.PBKDF2Core$HmacSHA512"); -+ ps("SecretKeyFactory", "PBKDF2WithHmacSHA512/224", -+ "com.sun.crypto.provider.PBKDF2Core$HmacSHA512_224"); -+ ps("SecretKeyFactory", "PBKDF2WithHmacSHA512/256", -+ "com.sun.crypto.provider.PBKDF2Core$HmacSHA512_256"); -+ -+ /* -+ * MAC -+ */ -+ attrs.clear(); -+ attrs.put("SupportedKeyFormats", "RAW"); -+ ps("Mac", "HmacMD5", "com.sun.crypto.provider.HmacMD5", null, attrs); -+ psA("Mac", "HmacSHA1", "com.sun.crypto.provider.HmacSHA1", -+ attrs); -+ psA("Mac", "HmacSHA224", -+ "com.sun.crypto.provider.HmacCore$HmacSHA224", attrs); -+ psA("Mac", "HmacSHA256", -+ "com.sun.crypto.provider.HmacCore$HmacSHA256", attrs); -+ psA("Mac", "HmacSHA384", -+ "com.sun.crypto.provider.HmacCore$HmacSHA384", attrs); -+ psA("Mac", "HmacSHA512", -+ "com.sun.crypto.provider.HmacCore$HmacSHA512", attrs); -+ psA("Mac", "HmacSHA512/224", -+ "com.sun.crypto.provider.HmacCore$HmacSHA512_224", attrs); -+ psA("Mac", "HmacSHA512/256", -+ "com.sun.crypto.provider.HmacCore$HmacSHA512_256", attrs); -+ psA("Mac", "HmacSHA3-224", -+ "com.sun.crypto.provider.HmacCore$HmacSHA3_224", attrs); -+ psA("Mac", "HmacSHA3-256", -+ "com.sun.crypto.provider.HmacCore$HmacSHA3_256", attrs); -+ psA("Mac", "HmacSHA3-384", -+ "com.sun.crypto.provider.HmacCore$HmacSHA3_384", attrs); -+ psA("Mac", "HmacSHA3-512", -+ "com.sun.crypto.provider.HmacCore$HmacSHA3_512", attrs); -+ -+ ps("Mac", "HmacPBESHA1", -+ "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA1", -+ null, attrs); -+ ps("Mac", "HmacPBESHA224", -+ "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA224", -+ null, attrs); -+ ps("Mac", "HmacPBESHA256", -+ "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA256", -+ null, attrs); -+ ps("Mac", "HmacPBESHA384", -+ "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA384", -+ null, attrs); -+ ps("Mac", "HmacPBESHA512", -+ "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA512", -+ null, attrs); -+ ps("Mac", "HmacPBESHA512/224", -+ "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA512_224", -+ null, attrs); -+ ps("Mac", "HmacPBESHA512/256", -+ "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA512_256", -+ null, attrs); -+ -+ // PBMAC1 -+ ps("Mac", "PBEWithHmacSHA1", -+ "com.sun.crypto.provider.PBMAC1Core$HmacSHA1", null, attrs); -+ ps("Mac", "PBEWithHmacSHA224", -+ "com.sun.crypto.provider.PBMAC1Core$HmacSHA224", null, attrs); -+ ps("Mac", "PBEWithHmacSHA256", -+ "com.sun.crypto.provider.PBMAC1Core$HmacSHA256", null, attrs); -+ ps("Mac", "PBEWithHmacSHA384", -+ "com.sun.crypto.provider.PBMAC1Core$HmacSHA384", null, attrs); -+ ps("Mac", "PBEWithHmacSHA512", -+ "com.sun.crypto.provider.PBMAC1Core$HmacSHA512", null, attrs); -+ ps("Mac", "PBEWithHmacSHA512/224", -+ "com.sun.crypto.provider.PBMAC1Core$HmacSHA512_224", null, attrs); -+ ps("Mac", "PBEWithHmacSHA512/256", -+ "com.sun.crypto.provider.PBMAC1Core$HmacSHA512_256", null, attrs); -+ -+ ps("Mac", "SslMacMD5", -+ "com.sun.crypto.provider.SslMacCore$SslMacMD5", null, attrs); -+ ps("Mac", "SslMacSHA1", -+ "com.sun.crypto.provider.SslMacCore$SslMacSHA1", null, attrs); -+ -+ /* -+ * KeyStore -+ */ -+ ps("KeyStore", "JCEKS", -+ "com.sun.crypto.provider.JceKeyStore"); -+ -+ /* -+ * KEMs -+ */ -+ attrs.clear(); -+ attrs.put("ImplementedIn", "Software"); -+ attrs.put("SupportedKeyClasses", "java.security.interfaces.ECKey" + -+ "|java.security.interfaces.XECKey"); -+ ps("KEM", "DHKEM", "com.sun.crypto.provider.DHKEM", null, attrs); -+ -+ /* -+ * SSL/TLS mechanisms -+ * -+ * These are strictly internal implementations and may -+ * be changed at any time. These names were chosen -+ * because PKCS11/SunPKCS11 does not yet have TLS1.2 -+ * mechanisms, and it will cause calls to come here. -+ */ -+ ps("KeyGenerator", "SunTlsPrf", -+ "com.sun.crypto.provider.TlsPrfGenerator$V10"); -+ ps("KeyGenerator", "SunTls12Prf", -+ "com.sun.crypto.provider.TlsPrfGenerator$V12"); -+ -+ ps("KeyGenerator", "SunTlsMasterSecret", -+ "com.sun.crypto.provider.TlsMasterSecretGenerator", -+ List.of("SunTls12MasterSecret", "SunTlsExtendedMasterSecret"), -+ null); -+ -+ ps("KeyGenerator", "SunTlsKeyMaterial", -+ "com.sun.crypto.provider.TlsKeyMaterialGenerator", -+ List.of("SunTls12KeyMaterial"), null); -+ -+ ps("KeyGenerator", "SunTlsRsaPremasterSecret", -+ "com.sun.crypto.provider.TlsRsaPremasterSecretGenerator", -+ List.of("SunTls12RsaPremasterSecret"), null); -+ } - } - - // Return the instance of this class or create one if needed. -diff --git a/src/java.base/share/classes/java/security/Security.java b/src/java.base/share/classes/java/security/Security.java -index 671529f71a1..af632936921 100644 ---- a/src/java.base/share/classes/java/security/Security.java -+++ b/src/java.base/share/classes/java/security/Security.java -@@ -34,6 +34,7 @@ import java.net.URL; - import jdk.internal.access.JavaSecurityPropertiesAccess; - import jdk.internal.event.EventHelper; - import jdk.internal.event.SecurityPropertyModificationEvent; -+import jdk.internal.access.JavaSecuritySystemConfiguratorAccess; - import jdk.internal.access.SharedSecrets; - import jdk.internal.util.StaticProperty; - import sun.security.util.Debug; -@@ -58,6 +59,11 @@ import sun.security.jca.*; - - public final class Security { - -+ private static final String SYS_PROP_SWITCH = -+ "java.security.disableSystemPropertiesFile"; -+ private static final String SEC_PROP_SWITCH = -+ "security.useSystemPropertiesFile"; -+ - /* Are we debugging? -- for developers */ - private static final Debug sdebug = - Debug.getInstance("properties"); -@@ -75,6 +81,19 @@ public final class Security { - } - - static { -+ // Initialise here as used by code with system properties disabled -+ SharedSecrets.setJavaSecuritySystemConfiguratorAccess( -+ new JavaSecuritySystemConfiguratorAccess() { -+ @Override -+ public boolean isSystemFipsEnabled() { -+ return SystemConfigurator.isSystemFipsEnabled(); -+ } -+ @Override -+ public boolean isPlainKeySupportEnabled() { -+ return SystemConfigurator.isPlainKeySupportEnabled(); -+ } -+ }); -+ - // doPrivileged here because there are multiple - // things in initialize that might require privs. - // (the FileInputStream call and the File.exists call, -@@ -96,6 +115,7 @@ public final class Security { - private static void initialize() { - props = new Properties(); - boolean overrideAll = false; -+ boolean systemSecPropsEnabled = false; - - // first load the system properties file - // to determine the value of security.overridePropertiesFile -@@ -116,6 +136,61 @@ public final class Security { - } - loadProps(null, extraPropFile, overrideAll); - } -+ -+ boolean sysUseProps = Boolean.valueOf(System.getProperty(SYS_PROP_SWITCH, "false")); -+ boolean secUseProps = Boolean.valueOf(props.getProperty(SEC_PROP_SWITCH)); -+ if (sdebug != null) { -+ sdebug.println(SYS_PROP_SWITCH + "=" + sysUseProps); -+ sdebug.println(SEC_PROP_SWITCH + "=" + secUseProps); -+ } -+ if (!sysUseProps && secUseProps) { -+ systemSecPropsEnabled = SystemConfigurator.configureSysProps(props); -+ if (!systemSecPropsEnabled) { -+ if (sdebug != null) { -+ sdebug.println("WARNING: System security properties could not be loaded."); -+ } -+ } -+ } else { -+ if (sdebug != null) { -+ sdebug.println("System security property support disabled by user."); -+ } -+ } -+ -+ if (systemSecPropsEnabled) { -+ boolean shouldEnable; -+ String sysProp = System.getProperty("com.redhat.fips"); -+ if (sysProp == null) { -+ shouldEnable = true; -+ if (sdebug != null) { -+ sdebug.println("com.redhat.fips unset, using default value of true"); -+ } -+ } else { -+ shouldEnable = Boolean.valueOf(sysProp); -+ if (sdebug != null) { -+ sdebug.println("com.redhat.fips set, using its value " + shouldEnable); -+ } -+ } -+ if (shouldEnable) { -+ boolean fipsEnabled = SystemConfigurator.configureFIPS(props); -+ if (sdebug != null) { -+ if (fipsEnabled) { -+ sdebug.println("FIPS mode support configured and enabled."); -+ } else { -+ sdebug.println("FIPS mode support disabled."); -+ } -+ } -+ } else { -+ if (sdebug != null ) { -+ sdebug.println("FIPS mode support disabled by user."); -+ } -+ } -+ } else { -+ if (sdebug != null) { -+ sdebug.println("WARNING: FIPS mode support can not be enabled without " + -+ "system security properties being enabled."); -+ } -+ } -+ - initialSecurityProperties = (Properties) props.clone(); - if (sdebug != null) { - for (String key : props.stringPropertyNames()) { -@@ -126,7 +201,7 @@ public final class Security { - - } - -- private static boolean loadProps(File masterFile, String extraPropFile, boolean overrideAll) { -+ static boolean loadProps(File masterFile, String extraPropFile, boolean overrideAll) { - InputStream is = null; - try { - if (masterFile != null && masterFile.exists()) { -diff --git a/src/java.base/share/classes/java/security/SystemConfigurator.java b/src/java.base/share/classes/java/security/SystemConfigurator.java -new file mode 100644 -index 00000000000..9d26a54f5d4 ---- /dev/null -+++ b/src/java.base/share/classes/java/security/SystemConfigurator.java -@@ -0,0 +1,232 @@ -+/* -+ * Copyright (c) 2019, 2021, Red Hat, Inc. -+ * -+ * 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. -+ */ -+ -+package java.security; -+ -+import java.io.BufferedInputStream; -+import java.io.FileInputStream; -+import java.io.IOException; -+ -+import java.util.Iterator; -+import java.util.Map.Entry; -+import java.util.Properties; -+ -+import sun.security.util.Debug; -+ -+/** -+ * Internal class to align OpenJDK with global crypto-policies. -+ * Called from java.security.Security class initialization, -+ * during startup. -+ * -+ */ -+ -+final class SystemConfigurator { -+ -+ private static final Debug sdebug = -+ Debug.getInstance("properties"); -+ -+ private static final String CRYPTO_POLICIES_BASE_DIR = -+ "/etc/crypto-policies"; -+ -+ private static final String CRYPTO_POLICIES_JAVA_CONFIG = -+ CRYPTO_POLICIES_BASE_DIR + "/back-ends/java.config"; -+ -+ private static boolean systemFipsEnabled = false; -+ private static boolean plainKeySupportEnabled = false; -+ -+ private static final String SYSTEMCONF_NATIVE_LIB = "systemconf"; -+ -+ private static native boolean getSystemFIPSEnabled() -+ throws IOException; -+ -+ static { -+ @SuppressWarnings("removal") -+ var dummy = AccessController.doPrivileged(new PrivilegedAction() { -+ public Void run() { -+ System.loadLibrary(SYSTEMCONF_NATIVE_LIB); -+ return null; -+ } -+ }); -+ } -+ -+ /* -+ * Invoked when java.security.Security class is initialized, if -+ * java.security.disableSystemPropertiesFile property is not set and -+ * security.useSystemPropertiesFile is true. -+ */ -+ static boolean configureSysProps(Properties props) { -+ // now load the system file, if it exists, so its values -+ // will win if they conflict with the earlier values -+ return Security.loadProps(null, CRYPTO_POLICIES_JAVA_CONFIG, false); -+ } -+ -+ /* -+ * Invoked at the end of java.security.Security initialisation -+ * if java.security properties have been loaded -+ */ -+ static boolean configureFIPS(Properties props) { -+ boolean loadedProps = false; -+ -+ try { -+ if (enableFips()) { -+ if (sdebug != null) { sdebug.println("FIPS mode detected"); } -+ // Remove all security providers -+ Iterator> i = props.entrySet().iterator(); -+ while (i.hasNext()) { -+ Entry e = i.next(); -+ if (((String) e.getKey()).startsWith("security.provider")) { -+ if (sdebug != null) { sdebug.println("Removing provider: " + e); } -+ i.remove(); -+ } -+ } -+ // Add FIPS security providers -+ String fipsProviderValue = null; -+ for (int n = 1; -+ (fipsProviderValue = (String) props.get("fips.provider." + n)) != null; n++) { -+ String fipsProviderKey = "security.provider." + n; -+ if (sdebug != null) { -+ sdebug.println("Adding provider " + n + ": " + -+ fipsProviderKey + "=" + fipsProviderValue); -+ } -+ props.put(fipsProviderKey, fipsProviderValue); -+ } -+ // Add other security properties -+ String keystoreTypeValue = (String) props.get("fips.keystore.type"); -+ if (keystoreTypeValue != null) { -+ String nonFipsKeystoreType = props.getProperty("keystore.type"); -+ props.put("keystore.type", keystoreTypeValue); -+ if (keystoreTypeValue.equals("PKCS11")) { -+ // If keystore.type is PKCS11, javax.net.ssl.keyStore -+ // must be "NONE". See JDK-8238264. -+ System.setProperty("javax.net.ssl.keyStore", "NONE"); -+ } -+ if (System.getProperty("javax.net.ssl.trustStoreType") == null) { -+ // If no trustStoreType has been set, use the -+ // previous keystore.type under FIPS mode. In -+ // a default configuration, the Trust Store will -+ // be 'cacerts' (JKS type). -+ System.setProperty("javax.net.ssl.trustStoreType", -+ nonFipsKeystoreType); -+ } -+ if (sdebug != null) { -+ sdebug.println("FIPS mode default keystore.type = " + -+ keystoreTypeValue); -+ sdebug.println("FIPS mode javax.net.ssl.keyStore = " + -+ System.getProperty("javax.net.ssl.keyStore", "")); -+ sdebug.println("FIPS mode javax.net.ssl.trustStoreType = " + -+ System.getProperty("javax.net.ssl.trustStoreType", "")); -+ } -+ } -+ loadedProps = true; -+ systemFipsEnabled = true; -+ String plainKeySupport = System.getProperty("com.redhat.fips.plainKeySupport", -+ "true"); -+ plainKeySupportEnabled = !"false".equals(plainKeySupport); -+ if (sdebug != null) { -+ if (plainKeySupportEnabled) { -+ sdebug.println("FIPS support enabled with plain key support"); -+ } else { -+ sdebug.println("FIPS support enabled without plain key support"); -+ } -+ } -+ } else { -+ if (sdebug != null) { sdebug.println("FIPS mode not detected"); } -+ } -+ } catch (Exception e) { -+ if (sdebug != null) { -+ sdebug.println("unable to load FIPS configuration"); -+ e.printStackTrace(); -+ } -+ } -+ return loadedProps; -+ } -+ -+ /** -+ * Returns whether or not global system FIPS alignment is enabled. -+ * -+ * Value is always 'false' before java.security.Security class is -+ * initialized. -+ * -+ * Call from out of this package through SharedSecrets: -+ * SharedSecrets.getJavaSecuritySystemConfiguratorAccess() -+ * .isSystemFipsEnabled(); -+ * -+ * @return a boolean value indicating whether or not global -+ * system FIPS alignment is enabled. -+ */ -+ static boolean isSystemFipsEnabled() { -+ return systemFipsEnabled; -+ } -+ -+ /** -+ * Returns {@code true} if system FIPS alignment is enabled -+ * and plain key support is allowed. Plain key support is -+ * enabled by default but can be disabled with -+ * {@code -Dcom.redhat.fips.plainKeySupport=false}. -+ * -+ * @return a boolean indicating whether plain key support -+ * should be enabled. -+ */ -+ static boolean isPlainKeySupportEnabled() { -+ return plainKeySupportEnabled; -+ } -+ -+ /** -+ * Determines whether FIPS mode should be enabled. -+ * -+ * OpenJDK FIPS mode will be enabled only if the system is in -+ * FIPS mode. -+ * -+ * Calls to this method only occur if the system property -+ * com.redhat.fips is not set to false. -+ * -+ * There are 2 possible ways in which OpenJDK detects that the system -+ * is in FIPS mode: 1) if the NSS SECMOD_GetSystemFIPSEnabled API is -+ * available at OpenJDK's built-time, it is called; 2) otherwise, the -+ * /proc/sys/crypto/fips_enabled file is read. -+ * -+ * @return true if the system is in FIPS mode -+ */ -+ private static boolean enableFips() throws Exception { -+ if (sdebug != null) { -+ sdebug.println("Calling getSystemFIPSEnabled (libsystemconf)..."); -+ } -+ try { -+ boolean fipsEnabled = getSystemFIPSEnabled(); -+ if (sdebug != null) { -+ sdebug.println("Call to getSystemFIPSEnabled (libsystemconf) returned: " -+ + fipsEnabled); -+ } -+ return fipsEnabled; -+ } catch (IOException e) { -+ if (sdebug != null) { -+ sdebug.println("Call to getSystemFIPSEnabled (libsystemconf) failed:"); -+ sdebug.println(e.getMessage()); -+ } -+ throw e; -+ } -+ } -+} -diff --git a/src/java.base/share/classes/jdk/internal/access/JavaSecuritySystemConfiguratorAccess.java b/src/java.base/share/classes/jdk/internal/access/JavaSecuritySystemConfiguratorAccess.java -new file mode 100644 -index 00000000000..3f3caac64dc ---- /dev/null -+++ b/src/java.base/share/classes/jdk/internal/access/JavaSecuritySystemConfiguratorAccess.java -@@ -0,0 +1,31 @@ -+/* -+ * Copyright (c) 2020, Red Hat, Inc. -+ * 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. -+ */ -+ -+package jdk.internal.access; -+ -+public interface JavaSecuritySystemConfiguratorAccess { -+ boolean isSystemFipsEnabled(); -+ boolean isPlainKeySupportEnabled(); -+} -diff --git a/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java b/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java -index 919d758a6e3..b1e5fbaf84a 100644 ---- a/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java -+++ b/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java -@@ -43,6 +43,7 @@ import java.io.PrintStream; - import java.io.PrintWriter; - import java.io.RandomAccessFile; - import java.security.ProtectionDomain; -+import java.security.Security; - import java.security.Signature; - - /** A repository of "shared secrets", which are a mechanism for -@@ -90,6 +91,7 @@ public class SharedSecrets { - private static JavaxCryptoSealedObjectAccess javaxCryptoSealedObjectAccess; - private static JavaxCryptoSpecAccess javaxCryptoSpecAccess; - private static JavaTemplateAccess javaTemplateAccess; -+ private static JavaSecuritySystemConfiguratorAccess javaSecuritySystemConfiguratorAccess; - - public static void setJavaUtilCollectionAccess(JavaUtilCollectionAccess juca) { - javaUtilCollectionAccess = juca; -@@ -537,4 +539,15 @@ public class SharedSecrets { - MethodHandles.lookup().ensureInitialized(c); - } catch (IllegalAccessException e) {} - } -+ -+ public static void setJavaSecuritySystemConfiguratorAccess(JavaSecuritySystemConfiguratorAccess jssca) { -+ javaSecuritySystemConfiguratorAccess = jssca; -+ } -+ -+ public static JavaSecuritySystemConfiguratorAccess getJavaSecuritySystemConfiguratorAccess() { -+ if (javaSecuritySystemConfiguratorAccess == null) { -+ ensureClassInitialized(Security.class); -+ } -+ return javaSecuritySystemConfiguratorAccess; -+ } - } -diff --git a/src/java.base/share/classes/module-info.java b/src/java.base/share/classes/module-info.java -index 06b141dcf22..e8cbf7f15d7 100644 ---- a/src/java.base/share/classes/module-info.java -+++ b/src/java.base/share/classes/module-info.java -@@ -158,6 +158,7 @@ module java.base { - java.naming, - java.rmi, - jdk.charsets, -+ jdk.crypto.ec, - jdk.jartool, - jdk.jlink, - jdk.jfr, -diff --git a/src/java.base/share/classes/sun/security/provider/SunEntries.java b/src/java.base/share/classes/sun/security/provider/SunEntries.java -index f036a411f1d..1e9de933bd9 100644 ---- a/src/java.base/share/classes/sun/security/provider/SunEntries.java -+++ b/src/java.base/share/classes/sun/security/provider/SunEntries.java -@@ -38,6 +38,7 @@ import java.util.HashMap; - import java.util.Iterator; - import java.util.LinkedHashSet; - -+import jdk.internal.access.SharedSecrets; - import jdk.internal.util.StaticProperty; - import sun.security.action.GetBooleanAction; - -@@ -91,6 +92,10 @@ import static sun.security.util.SecurityProviderConstants.getAliases; - - public final class SunEntries { - -+ private static final boolean systemFipsEnabled = -+ SharedSecrets.getJavaSecuritySystemConfiguratorAccess() -+ .isSystemFipsEnabled(); -+ - // the default algo used by SecureRandom class for new SecureRandom() calls - public static final String DEF_SECURE_RANDOM_ALGO; - -@@ -102,89 +107,92 @@ public final class SunEntries { - // common attribute map - HashMap attrs = new HashMap<>(3); - -- /* -- * SecureRandom engines -- */ -- attrs.put("ThreadSafe", "true"); -- if (NativePRNG.isAvailable()) { -- add(p, "SecureRandom", "NativePRNG", -- "sun.security.provider.NativePRNG", attrs); -- } -- if (NativePRNG.Blocking.isAvailable()) { -- add(p, "SecureRandom", "NativePRNGBlocking", -- "sun.security.provider.NativePRNG$Blocking", attrs); -- } -- if (NativePRNG.NonBlocking.isAvailable()) { -- add(p, "SecureRandom", "NativePRNGNonBlocking", -- "sun.security.provider.NativePRNG$NonBlocking", attrs); -- } -- attrs.put("ImplementedIn", "Software"); -- add(p, "SecureRandom", "DRBG", "sun.security.provider.DRBG", attrs); -- add(p, "SecureRandom", "SHA1PRNG", -- "sun.security.provider.SecureRandom", attrs); -- -- /* -- * Signature engines -- */ -- attrs.clear(); -- String dsaKeyClasses = "java.security.interfaces.DSAPublicKey" + -- "|java.security.interfaces.DSAPrivateKey"; -- attrs.put("SupportedKeyClasses", dsaKeyClasses); -- attrs.put("ImplementedIn", "Software"); -- -- attrs.put("KeySize", "1024"); // for NONE and SHA1 DSA signatures -- -- addWithAlias(p, "Signature", "SHA1withDSA", -- "sun.security.provider.DSA$SHA1withDSA", attrs); -- addWithAlias(p, "Signature", "NONEwithDSA", -- "sun.security.provider.DSA$RawDSA", attrs); -- -- // for DSA signatures with 224/256-bit digests -- attrs.put("KeySize", "2048"); -- -- addWithAlias(p, "Signature", "SHA224withDSA", -- "sun.security.provider.DSA$SHA224withDSA", attrs); -- addWithAlias(p, "Signature", "SHA256withDSA", -- "sun.security.provider.DSA$SHA256withDSA", attrs); -- -- addWithAlias(p, "Signature", "SHA3-224withDSA", -- "sun.security.provider.DSA$SHA3_224withDSA", attrs); -- addWithAlias(p, "Signature", "SHA3-256withDSA", -- "sun.security.provider.DSA$SHA3_256withDSA", attrs); -- -- attrs.put("KeySize", "3072"); // for DSA sig using 384/512-bit digests -- -- addWithAlias(p, "Signature", "SHA384withDSA", -- "sun.security.provider.DSA$SHA384withDSA", attrs); -- addWithAlias(p, "Signature", "SHA512withDSA", -- "sun.security.provider.DSA$SHA512withDSA", attrs); -- addWithAlias(p, "Signature", "SHA3-384withDSA", -- "sun.security.provider.DSA$SHA3_384withDSA", attrs); -- addWithAlias(p, "Signature", "SHA3-512withDSA", -- "sun.security.provider.DSA$SHA3_512withDSA", attrs); -+ if (!systemFipsEnabled) { -+ /* -+ * SecureRandom engines -+ */ -+ attrs.put("ThreadSafe", "true"); -+ if (NativePRNG.isAvailable()) { -+ add(p, "SecureRandom", "NativePRNG", -+ "sun.security.provider.NativePRNG", attrs); -+ } -+ if (NativePRNG.Blocking.isAvailable()) { -+ add(p, "SecureRandom", "NativePRNGBlocking", -+ "sun.security.provider.NativePRNG$Blocking", attrs); -+ } -+ if (NativePRNG.NonBlocking.isAvailable()) { -+ add(p, "SecureRandom", "NativePRNGNonBlocking", -+ "sun.security.provider.NativePRNG$NonBlocking", attrs); -+ } -+ attrs.put("ImplementedIn", "Software"); -+ add(p, "SecureRandom", "DRBG", "sun.security.provider.DRBG", attrs); -+ add(p, "SecureRandom", "SHA1PRNG", -+ "sun.security.provider.SecureRandom", attrs); - -- attrs.remove("KeySize"); -+ /* -+ * Signature engines -+ */ -+ attrs.clear(); -+ String dsaKeyClasses = "java.security.interfaces.DSAPublicKey" + -+ "|java.security.interfaces.DSAPrivateKey"; -+ attrs.put("SupportedKeyClasses", dsaKeyClasses); -+ attrs.put("ImplementedIn", "Software"); -+ -+ attrs.put("KeySize", "1024"); // for NONE and SHA1 DSA signatures -+ -+ addWithAlias(p, "Signature", "SHA1withDSA", -+ "sun.security.provider.DSA$SHA1withDSA", attrs); -+ addWithAlias(p, "Signature", "NONEwithDSA", -+ "sun.security.provider.DSA$RawDSA", attrs); -+ -+ // for DSA signatures with 224/256-bit digests -+ attrs.put("KeySize", "2048"); -+ -+ addWithAlias(p, "Signature", "SHA224withDSA", -+ "sun.security.provider.DSA$SHA224withDSA", attrs); -+ addWithAlias(p, "Signature", "SHA256withDSA", -+ "sun.security.provider.DSA$SHA256withDSA", attrs); -+ -+ addWithAlias(p, "Signature", "SHA3-224withDSA", -+ "sun.security.provider.DSA$SHA3_224withDSA", attrs); -+ addWithAlias(p, "Signature", "SHA3-256withDSA", -+ "sun.security.provider.DSA$SHA3_256withDSA", attrs); -+ -+ attrs.put("KeySize", "3072"); // for DSA sig using 384/512-bit digests -+ -+ addWithAlias(p, "Signature", "SHA384withDSA", -+ "sun.security.provider.DSA$SHA384withDSA", attrs); -+ addWithAlias(p, "Signature", "SHA512withDSA", -+ "sun.security.provider.DSA$SHA512withDSA", attrs); -+ addWithAlias(p, "Signature", "SHA3-384withDSA", -+ "sun.security.provider.DSA$SHA3_384withDSA", attrs); -+ addWithAlias(p, "Signature", "SHA3-512withDSA", -+ "sun.security.provider.DSA$SHA3_512withDSA", attrs); -+ -+ attrs.remove("KeySize"); -+ -+ add(p, "Signature", "SHA1withDSAinP1363Format", -+ "sun.security.provider.DSA$SHA1withDSAinP1363Format"); -+ add(p, "Signature", "NONEwithDSAinP1363Format", -+ "sun.security.provider.DSA$RawDSAinP1363Format"); -+ add(p, "Signature", "SHA224withDSAinP1363Format", -+ "sun.security.provider.DSA$SHA224withDSAinP1363Format"); -+ add(p, "Signature", "SHA256withDSAinP1363Format", -+ "sun.security.provider.DSA$SHA256withDSAinP1363Format"); -+ add(p, "Signature", "SHA384withDSAinP1363Format", -+ "sun.security.provider.DSA$SHA384withDSAinP1363Format"); -+ add(p, "Signature", "SHA512withDSAinP1363Format", -+ "sun.security.provider.DSA$SHA512withDSAinP1363Format"); -+ add(p, "Signature", "SHA3-224withDSAinP1363Format", -+ "sun.security.provider.DSA$SHA3_224withDSAinP1363Format"); -+ add(p, "Signature", "SHA3-256withDSAinP1363Format", -+ "sun.security.provider.DSA$SHA3_256withDSAinP1363Format"); -+ add(p, "Signature", "SHA3-384withDSAinP1363Format", -+ "sun.security.provider.DSA$SHA3_384withDSAinP1363Format"); -+ add(p, "Signature", "SHA3-512withDSAinP1363Format", -+ "sun.security.provider.DSA$SHA3_512withDSAinP1363Format"); - -- add(p, "Signature", "SHA1withDSAinP1363Format", -- "sun.security.provider.DSA$SHA1withDSAinP1363Format"); -- add(p, "Signature", "NONEwithDSAinP1363Format", -- "sun.security.provider.DSA$RawDSAinP1363Format"); -- add(p, "Signature", "SHA224withDSAinP1363Format", -- "sun.security.provider.DSA$SHA224withDSAinP1363Format"); -- add(p, "Signature", "SHA256withDSAinP1363Format", -- "sun.security.provider.DSA$SHA256withDSAinP1363Format"); -- add(p, "Signature", "SHA384withDSAinP1363Format", -- "sun.security.provider.DSA$SHA384withDSAinP1363Format"); -- add(p, "Signature", "SHA512withDSAinP1363Format", -- "sun.security.provider.DSA$SHA512withDSAinP1363Format"); -- add(p, "Signature", "SHA3-224withDSAinP1363Format", -- "sun.security.provider.DSA$SHA3_224withDSAinP1363Format"); -- add(p, "Signature", "SHA3-256withDSAinP1363Format", -- "sun.security.provider.DSA$SHA3_256withDSAinP1363Format"); -- add(p, "Signature", "SHA3-384withDSAinP1363Format", -- "sun.security.provider.DSA$SHA3_384withDSAinP1363Format"); -- add(p, "Signature", "SHA3-512withDSAinP1363Format", -- "sun.security.provider.DSA$SHA3_512withDSAinP1363Format"); -+ } - - attrs.clear(); - attrs.put("ImplementedIn", "Software"); -@@ -196,9 +204,11 @@ public final class SunEntries { - attrs.put("ImplementedIn", "Software"); - attrs.put("KeySize", "2048"); // for DSA KPG and APG only - -- String dsaKPGImplClass = "sun.security.provider.DSAKeyPairGenerator$"; -- dsaKPGImplClass += (useLegacyDSA? "Legacy" : "Current"); -- addWithAlias(p, "KeyPairGenerator", "DSA", dsaKPGImplClass, attrs); -+ if (!systemFipsEnabled) { -+ String dsaKPGImplClass = "sun.security.provider.DSAKeyPairGenerator$"; -+ dsaKPGImplClass += (useLegacyDSA? "Legacy" : "Current"); -+ addWithAlias(p, "KeyPairGenerator", "DSA", dsaKPGImplClass, attrs); -+ } - - /* - * Algorithm Parameter Generator engines -@@ -213,44 +223,46 @@ public final class SunEntries { - addWithAlias(p, "AlgorithmParameters", "DSA", - "sun.security.provider.DSAParameters", attrs); - -- /* -- * Key factories -- */ -- addWithAlias(p, "KeyFactory", "DSA", -- "sun.security.provider.DSAKeyFactory", attrs); -- addWithAlias(p, "KeyFactory", "HSS/LMS", -- "sun.security.provider.HSS$KeyFactoryImpl", attrs); -- -- /* -- * Digest engines -- */ -- addWithAlias(p, "MessageDigest", "MD2", "sun.security.provider.MD2", -- attrs); -- addWithAlias(p, "MessageDigest", "MD5", "sun.security.provider.MD5", -- attrs); -- addWithAlias(p, "MessageDigest", "SHA-1", "sun.security.provider.SHA", -- attrs); -+ if (!systemFipsEnabled) { -+ /* -+ * Key factories -+ */ -+ addWithAlias(p, "KeyFactory", "DSA", -+ "sun.security.provider.DSAKeyFactory", attrs); -+ addWithAlias(p, "KeyFactory", "HSS/LMS", -+ "sun.security.provider.HSS$KeyFactoryImpl", attrs); - -- addWithAlias(p, "MessageDigest", "SHA-224", -- "sun.security.provider.SHA2$SHA224", attrs); -- addWithAlias(p, "MessageDigest", "SHA-256", -- "sun.security.provider.SHA2$SHA256", attrs); -- addWithAlias(p, "MessageDigest", "SHA-384", -- "sun.security.provider.SHA5$SHA384", attrs); -- addWithAlias(p, "MessageDigest", "SHA-512", -- "sun.security.provider.SHA5$SHA512", attrs); -- addWithAlias(p, "MessageDigest", "SHA-512/224", -- "sun.security.provider.SHA5$SHA512_224", attrs); -- addWithAlias(p, "MessageDigest", "SHA-512/256", -- "sun.security.provider.SHA5$SHA512_256", attrs); -- addWithAlias(p, "MessageDigest", "SHA3-224", -- "sun.security.provider.SHA3$SHA224", attrs); -- addWithAlias(p, "MessageDigest", "SHA3-256", -- "sun.security.provider.SHA3$SHA256", attrs); -- addWithAlias(p, "MessageDigest", "SHA3-384", -- "sun.security.provider.SHA3$SHA384", attrs); -- addWithAlias(p, "MessageDigest", "SHA3-512", -- "sun.security.provider.SHA3$SHA512", attrs); -+ /* -+ * Digest engines -+ */ -+ addWithAlias(p, "MessageDigest", "MD2", "sun.security.provider.MD2", -+ attrs); -+ addWithAlias(p, "MessageDigest", "MD5", "sun.security.provider.MD5", -+ attrs); -+ addWithAlias(p, "MessageDigest", "SHA-1", "sun.security.provider.SHA", -+ attrs); -+ -+ addWithAlias(p, "MessageDigest", "SHA-224", -+ "sun.security.provider.SHA2$SHA224", attrs); -+ addWithAlias(p, "MessageDigest", "SHA-256", -+ "sun.security.provider.SHA2$SHA256", attrs); -+ addWithAlias(p, "MessageDigest", "SHA-384", -+ "sun.security.provider.SHA5$SHA384", attrs); -+ addWithAlias(p, "MessageDigest", "SHA-512", -+ "sun.security.provider.SHA5$SHA512", attrs); -+ addWithAlias(p, "MessageDigest", "SHA-512/224", -+ "sun.security.provider.SHA5$SHA512_224", attrs); -+ addWithAlias(p, "MessageDigest", "SHA-512/256", -+ "sun.security.provider.SHA5$SHA512_256", attrs); -+ addWithAlias(p, "MessageDigest", "SHA3-224", -+ "sun.security.provider.SHA3$SHA224", attrs); -+ addWithAlias(p, "MessageDigest", "SHA3-256", -+ "sun.security.provider.SHA3$SHA256", attrs); -+ addWithAlias(p, "MessageDigest", "SHA3-384", -+ "sun.security.provider.SHA3$SHA384", attrs); -+ addWithAlias(p, "MessageDigest", "SHA3-512", -+ "sun.security.provider.SHA3$SHA512", attrs); -+ } - - /* - * Certificates -diff --git a/src/java.base/share/classes/sun/security/rsa/SunRsaSignEntries.java b/src/java.base/share/classes/sun/security/rsa/SunRsaSignEntries.java -index 539ef1e8ee8..435f57e3ff2 100644 ---- a/src/java.base/share/classes/sun/security/rsa/SunRsaSignEntries.java -+++ b/src/java.base/share/classes/sun/security/rsa/SunRsaSignEntries.java -@@ -27,6 +27,7 @@ package sun.security.rsa; - - import java.util.*; - import java.security.Provider; -+import jdk.internal.access.SharedSecrets; - import static sun.security.util.SecurityProviderConstants.getAliases; - - /** -@@ -36,6 +37,10 @@ import static sun.security.util.SecurityProviderConstants.getAliases; - */ - public final class SunRsaSignEntries { - -+ private static final boolean systemFipsEnabled = -+ SharedSecrets.getJavaSecuritySystemConfiguratorAccess() -+ .isSystemFipsEnabled(); -+ - private void add(Provider p, String type, String algo, String cn, - List aliases, HashMap attrs) { - services.add(new Provider.Service(p, type, algo, cn, -@@ -63,42 +68,49 @@ public final class SunRsaSignEntries { - add(p, "KeyFactory", "RSA", - "sun.security.rsa.RSAKeyFactory$Legacy", - getAliases("PKCS1"), null); -- add(p, "KeyPairGenerator", "RSA", -- "sun.security.rsa.RSAKeyPairGenerator$Legacy", -- getAliases("PKCS1"), null); -- addA(p, "Signature", "MD2withRSA", -- "sun.security.rsa.RSASignature$MD2withRSA", attrs); -- addA(p, "Signature", "MD5withRSA", -- "sun.security.rsa.RSASignature$MD5withRSA", attrs); -- addA(p, "Signature", "SHA1withRSA", -- "sun.security.rsa.RSASignature$SHA1withRSA", attrs); -- addA(p, "Signature", "SHA224withRSA", -- "sun.security.rsa.RSASignature$SHA224withRSA", attrs); -- addA(p, "Signature", "SHA256withRSA", -- "sun.security.rsa.RSASignature$SHA256withRSA", attrs); -- addA(p, "Signature", "SHA384withRSA", -- "sun.security.rsa.RSASignature$SHA384withRSA", attrs); -- addA(p, "Signature", "SHA512withRSA", -- "sun.security.rsa.RSASignature$SHA512withRSA", attrs); -- addA(p, "Signature", "SHA512/224withRSA", -- "sun.security.rsa.RSASignature$SHA512_224withRSA", attrs); -- addA(p, "Signature", "SHA512/256withRSA", -- "sun.security.rsa.RSASignature$SHA512_256withRSA", attrs); -- addA(p, "Signature", "SHA3-224withRSA", -- "sun.security.rsa.RSASignature$SHA3_224withRSA", attrs); -- addA(p, "Signature", "SHA3-256withRSA", -- "sun.security.rsa.RSASignature$SHA3_256withRSA", attrs); -- addA(p, "Signature", "SHA3-384withRSA", -- "sun.security.rsa.RSASignature$SHA3_384withRSA", attrs); -- addA(p, "Signature", "SHA3-512withRSA", -- "sun.security.rsa.RSASignature$SHA3_512withRSA", attrs); -+ -+ if (!systemFipsEnabled) { -+ add(p, "KeyPairGenerator", "RSA", -+ "sun.security.rsa.RSAKeyPairGenerator$Legacy", -+ getAliases("PKCS1"), null); -+ addA(p, "Signature", "MD2withRSA", -+ "sun.security.rsa.RSASignature$MD2withRSA", attrs); -+ addA(p, "Signature", "MD5withRSA", -+ "sun.security.rsa.RSASignature$MD5withRSA", attrs); -+ addA(p, "Signature", "SHA1withRSA", -+ "sun.security.rsa.RSASignature$SHA1withRSA", attrs); -+ addA(p, "Signature", "SHA224withRSA", -+ "sun.security.rsa.RSASignature$SHA224withRSA", attrs); -+ addA(p, "Signature", "SHA256withRSA", -+ "sun.security.rsa.RSASignature$SHA256withRSA", attrs); -+ addA(p, "Signature", "SHA384withRSA", -+ "sun.security.rsa.RSASignature$SHA384withRSA", attrs); -+ addA(p, "Signature", "SHA512withRSA", -+ "sun.security.rsa.RSASignature$SHA512withRSA", attrs); -+ addA(p, "Signature", "SHA512/224withRSA", -+ "sun.security.rsa.RSASignature$SHA512_224withRSA", attrs); -+ addA(p, "Signature", "SHA512/256withRSA", -+ "sun.security.rsa.RSASignature$SHA512_256withRSA", attrs); -+ addA(p, "Signature", "SHA3-224withRSA", -+ "sun.security.rsa.RSASignature$SHA3_224withRSA", attrs); -+ addA(p, "Signature", "SHA3-256withRSA", -+ "sun.security.rsa.RSASignature$SHA3_256withRSA", attrs); -+ addA(p, "Signature", "SHA3-384withRSA", -+ "sun.security.rsa.RSASignature$SHA3_384withRSA", attrs); -+ addA(p, "Signature", "SHA3-512withRSA", -+ "sun.security.rsa.RSASignature$SHA3_512withRSA", attrs); -+ } - - addA(p, "KeyFactory", "RSASSA-PSS", - "sun.security.rsa.RSAKeyFactory$PSS", attrs); -- addA(p, "KeyPairGenerator", "RSASSA-PSS", -- "sun.security.rsa.RSAKeyPairGenerator$PSS", attrs); -- addA(p, "Signature", "RSASSA-PSS", -- "sun.security.rsa.RSAPSSSignature", attrs); -+ -+ if (!systemFipsEnabled) { -+ addA(p, "KeyPairGenerator", "RSASSA-PSS", -+ "sun.security.rsa.RSAKeyPairGenerator$PSS", attrs); -+ addA(p, "Signature", "RSASSA-PSS", -+ "sun.security.rsa.RSAPSSSignature", attrs); -+ } -+ - addA(p, "AlgorithmParameters", "RSASSA-PSS", - "sun.security.rsa.PSSParameters", null); - } -diff --git a/src/java.base/share/conf/security/java.security b/src/java.base/share/conf/security/java.security -index f8b01a4ea1e..b325bf7e9fc 100644 ---- a/src/java.base/share/conf/security/java.security -+++ b/src/java.base/share/conf/security/java.security -@@ -85,6 +85,17 @@ security.provider.tbd=Apple - #endif - security.provider.tbd=SunPKCS11 - -+# -+# Security providers used when FIPS mode support is active -+# -+fips.provider.1=SunPKCS11 ${java.home}/conf/security/nss.fips.cfg -+fips.provider.2=SUN -+fips.provider.3=SunEC -+fips.provider.4=SunJSSE -+fips.provider.5=SunJCE -+fips.provider.6=SunRsaSign -+fips.provider.7=XMLDSig -+ - # - # A list of preferred providers for specific algorithms. These providers will - # be searched for matching algorithms before the list of registered providers. -@@ -295,6 +306,47 @@ policy.ignoreIdentityScope=false - # - keystore.type=pkcs12 - -+# -+# Default keystore type used when global crypto-policies are set to FIPS. -+# -+fips.keystore.type=pkcs12 -+ -+# -+# Location of the NSS DB keystore (PKCS11) in FIPS mode. -+# -+# The syntax for this property is identical to the 'nssSecmodDirectory' -+# attribute available in the SunPKCS11 NSS configuration file. Use the -+# 'sql:' prefix to refer to an SQLite DB. -+# -+# If the system property fips.nssdb.path is also specified, it supersedes -+# the security property value defined here. -+# -+# Note: the default value for this property points to an NSS DB that might be -+# readable by multiple operating system users and unsuitable to store keys. -+# -+fips.nssdb.path=sql:/etc/pki/nssdb -+ -+# -+# PIN for the NSS DB keystore (PKCS11) in FIPS mode. -+# -+# Values must take any of the following forms: -+# 1) pin: -+# Value: clear text PIN value. -+# 2) env: -+# Value: environment variable containing the PIN value. -+# 3) file: -+# Value: path to a file containing the PIN value in its first -+# line. -+# -+# If the system property fips.nssdb.pin is also specified, it supersedes -+# the security property value defined here. -+# -+# When used as a system property, UTF-8 encoded values are valid. When -+# used as a security property (such as in this file), encode non-Basic -+# Latin Unicode characters with \uXXXX. -+# -+fips.nssdb.pin=pin: -+ - # - # Controls compatibility mode for JKS and PKCS12 keystore types. - # -@@ -332,6 +384,13 @@ package.definition=sun.misc.,\ - # - security.overridePropertiesFile=true - -+# -+# Determines whether this properties file will be appended to -+# using the system properties file stored at -+# /etc/crypto-policies/back-ends/java.config -+# -+security.useSystemPropertiesFile=false -+ - # - # Determines the default key and trust manager factory algorithms for - # the javax.net.ssl package. -diff --git a/src/java.base/share/conf/security/nss.fips.cfg.in b/src/java.base/share/conf/security/nss.fips.cfg.in -new file mode 100644 -index 00000000000..55bbba98b7a ---- /dev/null -+++ b/src/java.base/share/conf/security/nss.fips.cfg.in -@@ -0,0 +1,8 @@ -+name = NSS-FIPS -+nssLibraryDirectory = @NSS_LIBDIR@ -+nssSecmodDirectory = ${fips.nssdb.path} -+nssDbMode = readWrite -+nssModule = fips -+ -+attributes(*,CKO_SECRET_KEY,CKK_GENERIC_SECRET)={ CKA_SIGN=true } -+ -diff --git a/src/java.base/share/lib/security/default.policy b/src/java.base/share/lib/security/default.policy -index 86d45147709..22fd8675503 100644 ---- a/src/java.base/share/lib/security/default.policy -+++ b/src/java.base/share/lib/security/default.policy -@@ -130,6 +130,7 @@ grant codeBase "jrt:/jdk.charsets" { - grant codeBase "jrt:/jdk.crypto.ec" { - permission java.lang.RuntimePermission - "accessClassInPackage.sun.security.*"; -+ permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.access"; - permission java.lang.RuntimePermission "loadLibrary.sunec"; - permission java.security.SecurityPermission "putProviderProperty.SunEC"; - permission java.security.SecurityPermission "clearProviderProperties.SunEC"; -@@ -150,6 +151,8 @@ grant codeBase "jrt:/jdk.crypto.cryptoki" { - permission java.util.PropertyPermission "os.name", "read"; - permission java.util.PropertyPermission "os.arch", "read"; - permission java.util.PropertyPermission "jdk.crypto.KeyAgreement.legacyKDF", "read"; -+ permission java.util.PropertyPermission "fips.nssdb.path", "read,write"; -+ permission java.util.PropertyPermission "fips.nssdb.pin", "read"; - permission java.security.SecurityPermission "putProviderProperty.*"; - permission java.security.SecurityPermission "clearProviderProperties.*"; - permission java.security.SecurityPermission "removeProviderProperty.*"; -diff --git a/src/java.base/share/native/libsystemconf/systemconf.c b/src/java.base/share/native/libsystemconf/systemconf.c -new file mode 100644 -index 00000000000..ddf9befe5bc ---- /dev/null -+++ b/src/java.base/share/native/libsystemconf/systemconf.c -@@ -0,0 +1,236 @@ -+/* -+ * Copyright (c) 2021, Red Hat, Inc. -+ * 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. -+ */ -+ -+#include -+#include -+#include "jvm_md.h" -+#include -+ -+#ifdef LINUX -+ -+#ifdef SYSCONF_NSS -+#include -+#else -+#include -+#endif //SYSCONF_NSS -+ -+#include "java_security_SystemConfigurator.h" -+ -+#define MSG_MAX_SIZE 256 -+#define FIPS_ENABLED_PATH "/proc/sys/crypto/fips_enabled" -+ -+typedef int (SECMOD_GET_SYSTEM_FIPS_ENABLED_TYPE)(void); -+ -+static SECMOD_GET_SYSTEM_FIPS_ENABLED_TYPE *getSystemFIPSEnabled; -+static jmethodID debugPrintlnMethodID = NULL; -+static jobject debugObj = NULL; -+ -+static void dbgPrint(JNIEnv *env, const char* msg) -+{ -+ jstring jMsg; -+ if (debugObj != NULL) { -+ jMsg = (*env)->NewStringUTF(env, msg); -+ CHECK_NULL(jMsg); -+ (*env)->CallVoidMethod(env, debugObj, debugPrintlnMethodID, jMsg); -+ } -+} -+ -+static void throwIOException(JNIEnv *env, const char *msg) -+{ -+ jclass cls = (*env)->FindClass(env, "java/io/IOException"); -+ if (cls != 0) -+ (*env)->ThrowNew(env, cls, msg); -+} -+ -+static void handle_msg(JNIEnv *env, const char* msg, int msg_bytes) -+{ -+ if (msg_bytes > 0 && msg_bytes < MSG_MAX_SIZE) { -+ dbgPrint(env, msg); -+ } else { -+ dbgPrint(env, "systemconf: cannot render message"); -+ } -+} -+ -+// Only used when NSS is not linked at build time -+#ifndef SYSCONF_NSS -+ -+static void *nss_handle; -+ -+static jboolean loadNSS(JNIEnv *env) -+{ -+ char msg[MSG_MAX_SIZE]; -+ int msg_bytes; -+ const char* errmsg; -+ -+ nss_handle = dlopen(JNI_LIB_NAME("nss3"), RTLD_LAZY); -+ if (nss_handle == NULL) { -+ errmsg = dlerror(); -+ msg_bytes = snprintf(msg, MSG_MAX_SIZE, "loadNSS: dlopen: %s\n", -+ errmsg); -+ handle_msg(env, msg, msg_bytes); -+ return JNI_FALSE; -+ } -+ dlerror(); /* Clear errors */ -+ getSystemFIPSEnabled = (SECMOD_GET_SYSTEM_FIPS_ENABLED_TYPE*)dlsym(nss_handle, "SECMOD_GetSystemFIPSEnabled"); -+ if ((errmsg = dlerror()) != NULL) { -+ msg_bytes = snprintf(msg, MSG_MAX_SIZE, "loadNSS: dlsym: %s\n", -+ errmsg); -+ handle_msg(env, msg, msg_bytes); -+ return JNI_FALSE; -+ } -+ return JNI_TRUE; -+} -+ -+static void closeNSS(JNIEnv *env) -+{ -+ char msg[MSG_MAX_SIZE]; -+ int msg_bytes; -+ const char* errmsg; -+ -+ if (dlclose(nss_handle) != 0) { -+ errmsg = dlerror(); -+ msg_bytes = snprintf(msg, MSG_MAX_SIZE, "closeNSS: dlclose: %s\n", -+ errmsg); -+ handle_msg(env, msg, msg_bytes); -+ } -+} -+ -+#endif -+ -+/* -+ * Class: java_security_SystemConfigurator -+ * Method: JNI_OnLoad -+ */ -+JNIEXPORT jint JNICALL DEF_JNI_OnLoad(JavaVM *vm, void *reserved) -+{ -+ JNIEnv *env; -+ jclass sysConfCls, debugCls; -+ jfieldID sdebugFld; -+ -+ if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_2) != JNI_OK) { -+ return JNI_EVERSION; /* JNI version not supported */ -+ } -+ -+ sysConfCls = (*env)->FindClass(env,"java/security/SystemConfigurator"); -+ if (sysConfCls == NULL) { -+ printf("libsystemconf: SystemConfigurator class not found\n"); -+ return JNI_ERR; -+ } -+ sdebugFld = (*env)->GetStaticFieldID(env, sysConfCls, -+ "sdebug", "Lsun/security/util/Debug;"); -+ if (sdebugFld == NULL) { -+ printf("libsystemconf: SystemConfigurator::sdebug field not found\n"); -+ return JNI_ERR; -+ } -+ debugObj = (*env)->GetStaticObjectField(env, sysConfCls, sdebugFld); -+ if (debugObj != NULL) { -+ debugCls = (*env)->FindClass(env,"sun/security/util/Debug"); -+ if (debugCls == NULL) { -+ printf("libsystemconf: Debug class not found\n"); -+ return JNI_ERR; -+ } -+ debugPrintlnMethodID = (*env)->GetMethodID(env, debugCls, -+ "println", "(Ljava/lang/String;)V"); -+ if (debugPrintlnMethodID == NULL) { -+ printf("libsystemconf: Debug::println(String) method not found\n"); -+ return JNI_ERR; -+ } -+ debugObj = (*env)->NewGlobalRef(env, debugObj); -+ } -+ -+#ifdef SYSCONF_NSS -+ getSystemFIPSEnabled = *SECMOD_GetSystemFIPSEnabled; -+#else -+ if (loadNSS(env) == JNI_FALSE) { -+ dbgPrint(env, "libsystemconf: Failed to load NSS library."); -+ } -+#endif -+ -+ return (*env)->GetVersion(env); -+} -+ -+/* -+ * Class: java_security_SystemConfigurator -+ * Method: JNI_OnUnload -+ */ -+JNIEXPORT void JNICALL DEF_JNI_OnUnload(JavaVM *vm, void *reserved) -+{ -+ JNIEnv *env; -+ -+ if (debugObj != NULL) { -+ if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_2) != JNI_OK) { -+ return; /* Should not happen */ -+ } -+#ifndef SYSCONF_NSS -+ closeNSS(env); -+#endif -+ (*env)->DeleteGlobalRef(env, debugObj); -+ } -+} -+ -+JNIEXPORT jboolean JNICALL Java_java_security_SystemConfigurator_getSystemFIPSEnabled -+ (JNIEnv *env, jclass cls) -+{ -+ int fips_enabled; -+ char msg[MSG_MAX_SIZE]; -+ int msg_bytes; -+ -+ if (getSystemFIPSEnabled != NULL) { -+ dbgPrint(env, "getSystemFIPSEnabled: calling SECMOD_GetSystemFIPSEnabled"); -+ fips_enabled = (*getSystemFIPSEnabled)(); -+ msg_bytes = snprintf(msg, MSG_MAX_SIZE, "getSystemFIPSEnabled:" \ -+ " SECMOD_GetSystemFIPSEnabled returned 0x%x", fips_enabled); -+ handle_msg(env, msg, msg_bytes); -+ return (fips_enabled == 1 ? JNI_TRUE : JNI_FALSE); -+ } else { -+ FILE *fe; -+ -+ dbgPrint(env, "getSystemFIPSEnabled: reading " FIPS_ENABLED_PATH); -+ if ((fe = fopen(FIPS_ENABLED_PATH, "r")) == NULL) { -+ throwIOException(env, "Cannot open " FIPS_ENABLED_PATH); -+ return JNI_FALSE; -+ } -+ fips_enabled = fgetc(fe); -+ fclose(fe); -+ if (fips_enabled == EOF) { -+ throwIOException(env, "Cannot read " FIPS_ENABLED_PATH); -+ return JNI_FALSE; -+ } -+ msg_bytes = snprintf(msg, MSG_MAX_SIZE, "getSystemFIPSEnabled:" \ -+ " read character is '%c'", fips_enabled); -+ handle_msg(env, msg, msg_bytes); -+ return (fips_enabled == '1' ? JNI_TRUE : JNI_FALSE); -+ } -+} -+ -+#else // !LINUX -+ -+JNIEXPORT jboolean JNICALL Java_java_security_SystemConfigurator_getSystemFIPSEnabled -+ (JNIEnv *env, jclass cls) -+{ -+ return JNI_FALSE; -+} -+ -+#endif -diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/FIPSKeyImporter.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/FIPSKeyImporter.java -new file mode 100644 -index 00000000000..48d6d656a28 ---- /dev/null -+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/FIPSKeyImporter.java -@@ -0,0 +1,457 @@ -+/* -+ * Copyright (c) 2021, Red Hat, Inc. -+ * 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. -+ */ -+ -+package sun.security.pkcs11; -+ -+import java.math.BigInteger; -+import java.security.KeyFactory; -+import java.security.Provider; -+import java.security.Security; -+import java.security.interfaces.RSAPrivateCrtKey; -+import java.security.interfaces.RSAPrivateKey; -+import java.util.HashMap; -+import java.util.Map; -+import java.util.concurrent.locks.ReentrantLock; -+ -+import javax.crypto.Cipher; -+import javax.crypto.SecretKeyFactory; -+import javax.crypto.spec.SecretKeySpec; -+import javax.crypto.spec.IvParameterSpec; -+ -+import sun.security.jca.JCAUtil; -+import sun.security.pkcs11.TemplateManager; -+import sun.security.pkcs11.wrapper.CK_ATTRIBUTE; -+import sun.security.pkcs11.wrapper.CK_MECHANISM; -+import static sun.security.pkcs11.wrapper.PKCS11Constants.*; -+import static sun.security.pkcs11.wrapper.PKCS11Exception.RV.*; -+import sun.security.pkcs11.wrapper.PKCS11Exception; -+import sun.security.rsa.RSAPrivateCrtKeyImpl; -+import sun.security.rsa.RSAUtil; -+import sun.security.rsa.RSAUtil.KeyType; -+import sun.security.util.Debug; -+import sun.security.util.ECUtil; -+ -+final class FIPSKeyImporter { -+ -+ private static final Debug debug = -+ Debug.getInstance("sunpkcs11"); -+ -+ private static volatile P11Key importerKey = null; -+ private static SecretKeySpec exporterKey = null; -+ private static volatile P11Key exporterKeyP11 = null; -+ private static final ReentrantLock importerKeyLock = new ReentrantLock(); -+ // Do not take the exporterKeyLock with the importerKeyLock held. -+ private static final ReentrantLock exporterKeyLock = new ReentrantLock(); -+ private static volatile CK_MECHANISM importerKeyMechanism = null; -+ private static volatile CK_MECHANISM exporterKeyMechanism = null; -+ private static Cipher importerCipher = null; -+ private static Cipher exporterCipher = null; -+ -+ private static volatile Provider sunECProvider = null; -+ private static final ReentrantLock sunECProviderLock = new ReentrantLock(); -+ -+ static Long importKey(SunPKCS11 sunPKCS11, long hSession, CK_ATTRIBUTE[] attributes) -+ throws PKCS11Exception { -+ long keyID = -1; -+ Token token = sunPKCS11.getToken(); -+ if (debug != null) { -+ debug.println("Private or Secret key will be imported in" + -+ " system FIPS mode."); -+ } -+ if (importerKey == null) { -+ importerKeyLock.lock(); -+ try { -+ if (importerKey == null) { -+ if (importerKeyMechanism == null) { -+ // Importer Key creation has not been tried yet. Try it. -+ createImporterKey(token); -+ } -+ if (importerKey == null || importerCipher == null) { -+ if (debug != null) { -+ debug.println("Importer Key could not be" + -+ " generated."); -+ } -+ throw new PKCS11Exception(CKR_GENERAL_ERROR, -+ " fips key importer"); -+ } -+ if (debug != null) { -+ debug.println("Importer Key successfully" + -+ " generated."); -+ } -+ } -+ } finally { -+ importerKeyLock.unlock(); -+ } -+ } -+ long importerKeyID = importerKey.getKeyID(); -+ try { -+ byte[] keyBytes = null; -+ byte[] encKeyBytes = null; -+ long keyClass = 0L; -+ long keyType = 0L; -+ Map attrsMap = new HashMap<>(); -+ for (CK_ATTRIBUTE attr : attributes) { -+ if (attr.type == CKA_CLASS) { -+ keyClass = attr.getLong(); -+ } else if (attr.type == CKA_KEY_TYPE) { -+ keyType = attr.getLong(); -+ } -+ attrsMap.put(attr.type, attr); -+ } -+ BigInteger v = null; -+ if (keyClass == CKO_PRIVATE_KEY) { -+ if (keyType == CKK_RSA) { -+ if (debug != null) { -+ debug.println("Importing an RSA private key..."); -+ } -+ keyBytes = sun.security.rsa.RSAPrivateCrtKeyImpl.newKey( -+ KeyType.RSA, -+ null, -+ ((v = attrsMap.get(CKA_MODULUS).getBigInteger()) != null) -+ ? v : BigInteger.ZERO, -+ ((v = attrsMap.get(CKA_PUBLIC_EXPONENT).getBigInteger()) != null) -+ ? v : BigInteger.ZERO, -+ ((v = attrsMap.get(CKA_PRIVATE_EXPONENT).getBigInteger()) != null) -+ ? v : BigInteger.ZERO, -+ ((v = attrsMap.get(CKA_PRIME_1).getBigInteger()) != null) -+ ? v : BigInteger.ZERO, -+ ((v = attrsMap.get(CKA_PRIME_2).getBigInteger()) != null) -+ ? v : BigInteger.ZERO, -+ ((v = attrsMap.get(CKA_EXPONENT_1).getBigInteger()) != null) -+ ? v : BigInteger.ZERO, -+ ((v = attrsMap.get(CKA_EXPONENT_2).getBigInteger()) != null) -+ ? v : BigInteger.ZERO, -+ ((v = attrsMap.get(CKA_COEFFICIENT).getBigInteger()) != null) -+ ? v : BigInteger.ZERO -+ ).getEncoded(); -+ } else if (keyType == CKK_DSA) { -+ if (debug != null) { -+ debug.println("Importing a DSA private key..."); -+ } -+ keyBytes = new sun.security.provider.DSAPrivateKey( -+ ((v = attrsMap.get(CKA_VALUE).getBigInteger()) != null) -+ ? v : BigInteger.ZERO, -+ ((v = attrsMap.get(CKA_PRIME).getBigInteger()) != null) -+ ? v : BigInteger.ZERO, -+ ((v = attrsMap.get(CKA_SUBPRIME).getBigInteger()) != null) -+ ? v : BigInteger.ZERO, -+ ((v = attrsMap.get(CKA_BASE).getBigInteger()) != null) -+ ? v : BigInteger.ZERO -+ ).getEncoded(); -+ if (token.config.getNssNetscapeDbWorkaround() && -+ attrsMap.get(CKA_NETSCAPE_DB) == null) { -+ attrsMap.put(CKA_NETSCAPE_DB, -+ new CK_ATTRIBUTE(CKA_NETSCAPE_DB, BigInteger.ZERO)); -+ } -+ } else if (keyType == CKK_EC) { -+ if (debug != null) { -+ debug.println("Importing an EC private key..."); -+ } -+ if (sunECProvider == null) { -+ sunECProviderLock.lock(); -+ try { -+ if (sunECProvider == null) { -+ sunECProvider = Security.getProvider("SunEC"); -+ } -+ } finally { -+ sunECProviderLock.unlock(); -+ } -+ } -+ keyBytes = ECUtil.generateECPrivateKey( -+ ((v = attrsMap.get(CKA_VALUE).getBigInteger()) != null) -+ ? v : BigInteger.ZERO, -+ ECUtil.getECParameterSpec(sunECProvider, -+ attrsMap.get(CKA_EC_PARAMS).getByteArray())) -+ .getEncoded(); -+ if (token.config.getNssNetscapeDbWorkaround() && -+ attrsMap.get(CKA_NETSCAPE_DB) == null) { -+ attrsMap.put(CKA_NETSCAPE_DB, -+ new CK_ATTRIBUTE(CKA_NETSCAPE_DB, BigInteger.ZERO)); -+ } -+ } else { -+ if (debug != null) { -+ debug.println("Unrecognized private key type."); -+ } -+ throw new PKCS11Exception(CKR_GENERAL_ERROR, -+ " fips key importer"); -+ } -+ } else if (keyClass == CKO_SECRET_KEY) { -+ if (debug != null) { -+ debug.println("Importing a secret key..."); -+ } -+ keyBytes = attrsMap.get(CKA_VALUE).getByteArray(); -+ } -+ if (keyBytes == null || keyBytes.length == 0) { -+ if (debug != null) { -+ debug.println("Private or secret key plain bytes could" + -+ " not be obtained. Import failed."); -+ } -+ throw new PKCS11Exception(CKR_GENERAL_ERROR, -+ " fips key importer"); -+ } -+ attributes = new CK_ATTRIBUTE[attrsMap.size()]; -+ attrsMap.values().toArray(attributes); -+ importerKeyLock.lock(); -+ try { -+ // No need to reset the cipher object because no multi-part -+ // operations are performed. -+ encKeyBytes = importerCipher.doFinal(keyBytes); -+ } finally { -+ importerKeyLock.unlock(); -+ } -+ attributes = token.getAttributes(TemplateManager.O_IMPORT, -+ keyClass, keyType, attributes); -+ keyID = token.p11.C_UnwrapKey(hSession, -+ importerKeyMechanism, importerKeyID, encKeyBytes, attributes); -+ if (debug != null) { -+ debug.println("Imported key ID: " + keyID); -+ } -+ } catch (Throwable t) { -+ if (t instanceof PKCS11Exception) { -+ throw (PKCS11Exception)t; -+ } -+ throw new PKCS11Exception(CKR_GENERAL_ERROR, -+ t.getMessage()); -+ } finally { -+ importerKey.releaseKeyID(); -+ } -+ return Long.valueOf(keyID); -+ } -+ -+ static void exportKey(SunPKCS11 sunPKCS11, long hSession, long hObject, -+ long keyClass, long keyType, Map sensitiveAttrs) -+ throws PKCS11Exception { -+ Token token = sunPKCS11.getToken(); -+ if (debug != null) { -+ debug.println("Private or Secret key will be exported in" + -+ " system FIPS mode."); -+ } -+ if (exporterKeyP11 == null) { -+ try { -+ exporterKeyLock.lock(); -+ if (exporterKeyP11 == null) { -+ if (exporterKeyMechanism == null) { -+ // Exporter Key creation has not been tried yet. Try it. -+ createExporterKey(token); -+ } -+ if (exporterKeyP11 == null || exporterCipher == null) { -+ if (debug != null) { -+ debug.println("Exporter Key could not be" + -+ " generated."); -+ } -+ throw new PKCS11Exception(CKR_GENERAL_ERROR, -+ " fips key exporter"); -+ } -+ if (debug != null) { -+ debug.println("Exporter Key successfully" + -+ " generated."); -+ } -+ } -+ } finally { -+ exporterKeyLock.unlock(); -+ } -+ } -+ long exporterKeyID = exporterKeyP11.getKeyID(); -+ try { -+ byte[] wrappedKeyBytes = token.p11.C_WrapKey(hSession, -+ exporterKeyMechanism, exporterKeyID, hObject); -+ byte[] plainExportedKey = null; -+ exporterKeyLock.lock(); -+ try { -+ // No need to reset the cipher object because no multi-part -+ // operations are performed. -+ plainExportedKey = exporterCipher.doFinal(wrappedKeyBytes); -+ } finally { -+ exporterKeyLock.unlock(); -+ } -+ if (keyClass == CKO_PRIVATE_KEY) { -+ exportPrivateKey(sensitiveAttrs, keyType, plainExportedKey); -+ } else if (keyClass == CKO_SECRET_KEY) { -+ checkAttrs(sensitiveAttrs, "CKO_SECRET_KEY", CKA_VALUE); -+ // CKA_VALUE is guaranteed to be present, since sensitiveAttrs' -+ // size is greater than 0 and no invalid attributes exist -+ sensitiveAttrs.get(CKA_VALUE).pValue = plainExportedKey; -+ } else { -+ throw new PKCS11Exception(CKR_GENERAL_ERROR, -+ " fips key exporter"); -+ } -+ } catch (Throwable t) { -+ if (t instanceof PKCS11Exception) { -+ throw (PKCS11Exception)t; -+ } -+ throw new PKCS11Exception(CKR_GENERAL_ERROR, -+ t.getMessage()); -+ } finally { -+ exporterKeyP11.releaseKeyID(); -+ } -+ } -+ -+ private static void exportPrivateKey( -+ Map sensitiveAttrs, long keyType, -+ byte[] plainExportedKey) throws Throwable { -+ if (keyType == CKK_RSA) { -+ checkAttrs(sensitiveAttrs, "CKO_PRIVATE_KEY CKK_RSA", -+ CKA_PRIVATE_EXPONENT, CKA_PRIME_1, CKA_PRIME_2, -+ CKA_EXPONENT_1, CKA_EXPONENT_2, CKA_COEFFICIENT); -+ RSAPrivateKey rsaPKey = RSAPrivateCrtKeyImpl.newKey( -+ RSAUtil.KeyType.RSA, "PKCS#8", plainExportedKey); -+ CK_ATTRIBUTE attr; -+ if ((attr = sensitiveAttrs.get(CKA_PRIVATE_EXPONENT)) != null) { -+ attr.pValue = rsaPKey.getPrivateExponent().toByteArray(); -+ } -+ if (rsaPKey instanceof RSAPrivateCrtKey) { -+ RSAPrivateCrtKey rsaPCrtKey = (RSAPrivateCrtKey) rsaPKey; -+ if ((attr = sensitiveAttrs.get(CKA_PRIME_1)) != null) { -+ attr.pValue = rsaPCrtKey.getPrimeP().toByteArray(); -+ } -+ if ((attr = sensitiveAttrs.get(CKA_PRIME_2)) != null) { -+ attr.pValue = rsaPCrtKey.getPrimeQ().toByteArray(); -+ } -+ if ((attr = sensitiveAttrs.get(CKA_EXPONENT_1)) != null) { -+ attr.pValue = rsaPCrtKey.getPrimeExponentP().toByteArray(); -+ } -+ if ((attr = sensitiveAttrs.get(CKA_EXPONENT_2)) != null) { -+ attr.pValue = rsaPCrtKey.getPrimeExponentQ().toByteArray(); -+ } -+ if ((attr = sensitiveAttrs.get(CKA_COEFFICIENT)) != null) { -+ attr.pValue = rsaPCrtKey.getCrtCoefficient().toByteArray(); -+ } -+ } else { -+ checkAttrs(sensitiveAttrs, "CKO_PRIVATE_KEY CKK_RSA", -+ CKA_PRIVATE_EXPONENT); -+ } -+ } else if (keyType == CKK_DSA) { -+ checkAttrs(sensitiveAttrs, "CKO_PRIVATE_KEY CKK_DSA", CKA_VALUE); -+ // CKA_VALUE is guaranteed to be present, since sensitiveAttrs' -+ // size is greater than 0 and no invalid attributes exist -+ sensitiveAttrs.get(CKA_VALUE).pValue = -+ new sun.security.provider.DSAPrivateKey(plainExportedKey) -+ .getX().toByteArray(); -+ } else if (keyType == CKK_EC) { -+ checkAttrs(sensitiveAttrs, "CKO_PRIVATE_KEY CKK_EC", CKA_VALUE); -+ // CKA_VALUE is guaranteed to be present, since sensitiveAttrs' -+ // size is greater than 0 and no invalid attributes exist -+ sensitiveAttrs.get(CKA_VALUE).pValue = -+ ECUtil.decodePKCS8ECPrivateKey(plainExportedKey) -+ .getS().toByteArray(); -+ } else { -+ throw new PKCS11Exception(CKR_GENERAL_ERROR, -+ " unsupported CKO_PRIVATE_KEY key type: " + keyType); -+ } -+ } -+ -+ private static void checkAttrs(Map sensitiveAttrs, -+ String keyName, long... validAttrs) -+ throws PKCS11Exception { -+ int sensitiveAttrsCount = sensitiveAttrs.size(); -+ if (sensitiveAttrsCount <= validAttrs.length) { -+ int validAttrsCount = 0; -+ for (long validAttr : validAttrs) { -+ if (sensitiveAttrs.containsKey(validAttr)) validAttrsCount++; -+ } -+ if (validAttrsCount == sensitiveAttrsCount) return; -+ } -+ throw new PKCS11Exception(CKR_GENERAL_ERROR, -+ " invalid attribute types for a " + keyName + " key object"); -+ } -+ -+ private static void createImporterKey(Token token) { -+ if (debug != null) { -+ debug.println("Generating Importer Key..."); -+ } -+ byte[] iv = new byte[16]; -+ JCAUtil.getSecureRandom().nextBytes(iv); -+ importerKeyMechanism = new CK_MECHANISM(CKM_AES_CBC_PAD, iv); -+ try { -+ CK_ATTRIBUTE[] attributes = token.getAttributes(TemplateManager.O_GENERATE, -+ CKO_SECRET_KEY, CKK_AES, new CK_ATTRIBUTE[] { -+ new CK_ATTRIBUTE(CKA_CLASS, CKO_SECRET_KEY), -+ new CK_ATTRIBUTE(CKA_VALUE_LEN, 256 >> 3)}); -+ Session s = null; -+ try { -+ s = token.getObjSession(); -+ long keyID = token.p11.C_GenerateKey( -+ s.id(), new CK_MECHANISM(CKM_AES_KEY_GEN), -+ attributes); -+ if (debug != null) { -+ debug.println("Importer Key ID: " + keyID); -+ } -+ importerKey = (P11Key)P11Key.secretKey(s, keyID, "AES", -+ 256 >> 3, null); -+ } catch (PKCS11Exception e) { -+ // best effort -+ } finally { -+ token.releaseSession(s); -+ } -+ if (importerKey != null) { -+ importerCipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); -+ importerCipher.init(Cipher.ENCRYPT_MODE, importerKey, -+ new IvParameterSpec( -+ (byte[])importerKeyMechanism.pParameter), null); -+ } -+ } catch (Throwable t) { -+ // best effort -+ importerKey = null; -+ importerCipher = null; -+ // importerKeyMechanism value is kept initialized to indicate that -+ // Importer Key creation has been tried and failed. -+ if (debug != null) { -+ debug.println("Error generating the Importer Key"); -+ } -+ } -+ } -+ -+ private static void createExporterKey(Token token) { -+ if (debug != null) { -+ debug.println("Generating Exporter Key..."); -+ } -+ byte[] iv = new byte[16]; -+ JCAUtil.getSecureRandom().nextBytes(iv); -+ exporterKeyMechanism = new CK_MECHANISM(CKM_AES_CBC_PAD, iv); -+ byte[] exporterKeyRaw = new byte[32]; -+ JCAUtil.getSecureRandom().nextBytes(exporterKeyRaw); -+ exporterKey = new SecretKeySpec(exporterKeyRaw, "AES"); -+ try { -+ SecretKeyFactory skf = SecretKeyFactory.getInstance("AES"); -+ exporterKeyP11 = (P11Key)(skf.translateKey(exporterKey)); -+ if (exporterKeyP11 != null) { -+ exporterCipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); -+ exporterCipher.init(Cipher.DECRYPT_MODE, exporterKey, -+ new IvParameterSpec( -+ (byte[])exporterKeyMechanism.pParameter), null); -+ } -+ } catch (Throwable t) { -+ // best effort -+ exporterKey = null; -+ exporterKeyP11 = null; -+ exporterCipher = null; -+ // exporterKeyMechanism value is kept initialized to indicate that -+ // Exporter Key creation has been tried and failed. -+ if (debug != null) { -+ debug.println("Error generating the Exporter Key"); -+ } -+ } -+ } -+} -diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/FIPSTokenLoginHandler.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/FIPSTokenLoginHandler.java -new file mode 100644 -index 00000000000..f8d505ca815 ---- /dev/null -+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/FIPSTokenLoginHandler.java -@@ -0,0 +1,149 @@ -+/* -+ * Copyright (c) 2022, Red Hat, Inc. -+ * 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. -+ */ -+ -+package sun.security.pkcs11; -+ -+import java.io.BufferedReader; -+import java.io.ByteArrayInputStream; -+import java.io.InputStream; -+import java.io.InputStreamReader; -+import java.io.IOException; -+import java.nio.charset.StandardCharsets; -+import java.nio.file.Files; -+import java.nio.file.Path; -+import java.nio.file.Paths; -+import java.nio.file.StandardOpenOption; -+import java.security.ProviderException; -+ -+import javax.security.auth.callback.Callback; -+import javax.security.auth.callback.CallbackHandler; -+import javax.security.auth.callback.PasswordCallback; -+import javax.security.auth.callback.UnsupportedCallbackException; -+ -+import sun.security.util.Debug; -+import sun.security.util.SecurityProperties; -+ -+final class FIPSTokenLoginHandler implements CallbackHandler { -+ -+ private static final String FIPS_NSSDB_PIN_PROP = "fips.nssdb.pin"; -+ -+ private static final Debug debug = Debug.getInstance("sunpkcs11"); -+ -+ public void handle(Callback[] callbacks) -+ throws IOException, UnsupportedCallbackException { -+ if (!(callbacks[0] instanceof PasswordCallback)) { -+ throw new UnsupportedCallbackException(callbacks[0]); -+ } -+ PasswordCallback pc = (PasswordCallback)callbacks[0]; -+ pc.setPassword(getFipsNssdbPin()); -+ } -+ -+ private static char[] getFipsNssdbPin() throws ProviderException { -+ if (debug != null) { -+ debug.println("FIPS: Reading NSS DB PIN for token..."); -+ } -+ String pinProp = SecurityProperties -+ .privilegedGetOverridable(FIPS_NSSDB_PIN_PROP); -+ if (pinProp != null && !pinProp.isEmpty()) { -+ String[] pinPropParts = pinProp.split(":", 2); -+ if (pinPropParts.length < 2) { -+ throw new ProviderException("Invalid " + FIPS_NSSDB_PIN_PROP + -+ " property value."); -+ } -+ String prefix = pinPropParts[0].toLowerCase(); -+ String value = pinPropParts[1]; -+ String pin = null; -+ if (prefix.equals("env")) { -+ if (debug != null) { -+ debug.println("FIPS: PIN value from the '" + value + -+ "' environment variable."); -+ } -+ pin = System.getenv(value); -+ } else if (prefix.equals("file")) { -+ if (debug != null) { -+ debug.println("FIPS: PIN value from the '" + value + -+ "' file."); -+ } -+ pin = getPinFromFile(Paths.get(value)); -+ } else if (prefix.equals("pin")) { -+ if (debug != null) { -+ debug.println("FIPS: PIN value from the " + -+ FIPS_NSSDB_PIN_PROP + " property."); -+ } -+ pin = value; -+ } else { -+ throw new ProviderException("Unsupported prefix for " + -+ FIPS_NSSDB_PIN_PROP + "."); -+ } -+ if (pin != null && !pin.isEmpty()) { -+ if (debug != null) { -+ debug.println("FIPS: non-empty PIN."); -+ } -+ /* -+ * C_Login in libj2pkcs11 receives the PIN in a char[] and -+ * discards the upper byte of each char, before passing -+ * the value to the NSS Software Token. However, the -+ * NSS Software Token accepts any UTF-8 PIN value. Thus, -+ * expand the PIN here to account for later truncation. -+ */ -+ byte[] pinUtf8 = pin.getBytes(StandardCharsets.UTF_8); -+ char[] pinChar = new char[pinUtf8.length]; -+ for (int i = 0; i < pinChar.length; i++) { -+ pinChar[i] = (char)(pinUtf8[i] & 0xFF); -+ } -+ return pinChar; -+ } -+ } -+ if (debug != null) { -+ debug.println("FIPS: empty PIN."); -+ } -+ return null; -+ } -+ -+ /* -+ * This method extracts the token PIN from the first line of a password -+ * file in the same way as NSS modutil. See for example the -newpwfile -+ * argument used to change the password for an NSS DB. -+ */ -+ private static String getPinFromFile(Path f) throws ProviderException { -+ try (InputStream is = -+ Files.newInputStream(f, StandardOpenOption.READ)) { -+ /* -+ * SECU_FilePasswd in NSS (nss/cmd/lib/secutil.c), used by modutil, -+ * reads up to 4096 bytes. In addition, the NSS Software Token -+ * does not accept PINs longer than 500 bytes (see SFTK_MAX_PIN -+ * in nss/lib/softoken/pkcs11i.h). -+ */ -+ BufferedReader in = -+ new BufferedReader(new InputStreamReader( -+ new ByteArrayInputStream(is.readNBytes(4096)), -+ StandardCharsets.UTF_8)); -+ return in.readLine(); -+ } catch (IOException ioe) { -+ throw new ProviderException("Error reading " + FIPS_NSSDB_PIN_PROP + -+ " from the '" + f + "' file.", ioe); -+ } -+ } -+} -\ No newline at end of file -diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java -index 01fc06ae283..e3ca000d309 100644 ---- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java -+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java -@@ -37,6 +37,8 @@ import javax.crypto.*; - import javax.crypto.interfaces.*; - import javax.crypto.spec.*; - -+import jdk.internal.access.SharedSecrets; -+ - import sun.security.rsa.RSAUtil.KeyType; - import sun.security.rsa.RSAPublicKeyImpl; - import sun.security.rsa.RSAPrivateCrtKeyImpl; -@@ -72,6 +74,9 @@ abstract class P11Key implements Key, Length { - @Serial - private static final long serialVersionUID = -2575874101938349339L; - -+ private static final boolean plainKeySupportEnabled = SharedSecrets -+ .getJavaSecuritySystemConfiguratorAccess().isPlainKeySupportEnabled(); -+ - private static final String PUBLIC = "public"; - private static final String PRIVATE = "private"; - private static final String SECRET = "secret"; -@@ -414,9 +419,10 @@ abstract class P11Key implements Key, Length { - new CK_ATTRIBUTE(CKA_EXTRACTABLE), - }); - -- boolean keySensitive = -- (attrs[0].getBoolean() && P11Util.isNSS(session.token)) || -- attrs[1].getBoolean() || !attrs[2].getBoolean(); -+ boolean exportable = plainKeySupportEnabled && !algorithm.equals("DH"); -+ boolean keySensitive = (!exportable && -+ ((attrs[0].getBoolean() && P11Util.isNSS(session.token)) || -+ attrs[1].getBoolean() || !attrs[2].getBoolean())); - - return switch (algorithm) { - case "RSA" -> P11RSAPrivateKeyInternal.of(session, keyID, algorithm, -@@ -468,7 +474,8 @@ abstract class P11Key implements Key, Length { - - public String getFormat() { - token.ensureValid(); -- if (sensitive || !extractable || (isNSS && tokenObject)) { -+ if (!plainKeySupportEnabled && -+ (sensitive || !extractable || (isNSS && tokenObject))) { - return null; - } else { - return "RAW"; -@@ -1638,4 +1645,3 @@ final class SessionKeyRef extends PhantomReference { - this.clear(); - } - } -- -diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java -index 0a62021633f..0723b69c2bc 100644 ---- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java -+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java -@@ -26,6 +26,9 @@ - package sun.security.pkcs11; - - import java.io.*; -+import java.lang.invoke.MethodHandle; -+import java.lang.invoke.MethodHandles; -+import java.lang.invoke.MethodType; - import java.util.*; - import java.util.stream.Collectors; - import java.security.*; -@@ -42,10 +45,12 @@ import javax.security.auth.callback.PasswordCallback; - - import com.sun.crypto.provider.ChaCha20Poly1305Parameters; - -+import jdk.internal.access.SharedSecrets; - import jdk.internal.misc.InnocuousThread; - import sun.security.util.Debug; - import sun.security.util.ResourcesMgr; - import static sun.security.util.SecurityConstants.PROVIDER_VER; -+import sun.security.util.SecurityProperties; - import static sun.security.util.SecurityProviderConstants.getAliases; - - import sun.security.pkcs11.Secmod.*; -@@ -65,6 +70,39 @@ public final class SunPKCS11 extends AuthProvider { - @Serial - private static final long serialVersionUID = -1354835039035306505L; - -+ private static final boolean systemFipsEnabled = SharedSecrets -+ .getJavaSecuritySystemConfiguratorAccess().isSystemFipsEnabled(); -+ -+ private static final boolean plainKeySupportEnabled = SharedSecrets -+ .getJavaSecuritySystemConfiguratorAccess().isPlainKeySupportEnabled(); -+ -+ private static final MethodHandle fipsImportKey; -+ private static final MethodHandle fipsExportKey; -+ static { -+ MethodHandle fipsImportKeyTmp = null; -+ MethodHandle fipsExportKeyTmp = null; -+ if (plainKeySupportEnabled) { -+ try { -+ fipsImportKeyTmp = MethodHandles.lookup().findStatic( -+ FIPSKeyImporter.class, "importKey", -+ MethodType.methodType(Long.class, SunPKCS11.class, -+ long.class, CK_ATTRIBUTE[].class)); -+ fipsExportKeyTmp = MethodHandles.lookup().findStatic( -+ FIPSKeyImporter.class, "exportKey", -+ MethodType.methodType(void.class, SunPKCS11.class, -+ long.class, long.class, -+ long.class, long.class, Map.class)); -+ } catch (Throwable t) { -+ throw new SecurityException("FIPS key importer-exporter" + -+ " initialization failed", t); -+ } -+ } -+ fipsImportKey = fipsImportKeyTmp; -+ fipsExportKey = fipsExportKeyTmp; -+ } -+ -+ private static final String FIPS_NSSDB_PATH_PROP = "fips.nssdb.path"; -+ - static final Debug debug = Debug.getInstance("sunpkcs11"); - // the PKCS11 object through which we make the native calls - @SuppressWarnings("serial") // Type of field is not Serializable; -@@ -123,6 +161,29 @@ public final class SunPKCS11 extends AuthProvider { - return AccessController.doPrivileged(new PrivilegedExceptionAction<>() { - @Override - public SunPKCS11 run() throws Exception { -+ if (systemFipsEnabled) { -+ /* -+ * The nssSecmodDirectory attribute in the SunPKCS11 -+ * NSS configuration file takes the value of the -+ * fips.nssdb.path System property after expansion. -+ * Security properties expansion is unsupported. -+ */ -+ String nssdbPath = -+ SecurityProperties.privilegedGetOverridable( -+ FIPS_NSSDB_PATH_PROP); -+ if (System.getSecurityManager() != null) { -+ AccessController.doPrivileged( -+ (PrivilegedAction) () -> { -+ System.setProperty( -+ FIPS_NSSDB_PATH_PROP, -+ nssdbPath); -+ return null; -+ }); -+ } else { -+ System.setProperty( -+ FIPS_NSSDB_PATH_PROP, nssdbPath); -+ } -+ } - return new SunPKCS11(new Config(newConfigName)); - } - }); -@@ -325,9 +386,19 @@ public final class SunPKCS11 extends AuthProvider { - // request multithreaded access first - initArgs.flags = CKF_OS_LOCKING_OK; - PKCS11 tmpPKCS11; -+ MethodHandle fipsKeyImporter = null; -+ MethodHandle fipsKeyExporter = null; -+ if (plainKeySupportEnabled) { -+ fipsKeyImporter = MethodHandles.insertArguments( -+ fipsImportKey, 0, this); -+ fipsKeyExporter = MethodHandles.insertArguments( -+ fipsExportKey, 0, this); -+ } - try { -- tmpPKCS11 = PKCS11.getInstance(library, functionList, initArgs, -- config.getOmitInitialize()); -+ tmpPKCS11 = PKCS11.getInstance( -+ library, functionList, initArgs, -+ config.getOmitInitialize(), fipsKeyImporter, -+ fipsKeyExporter); - } catch (PKCS11Exception e) { - if (debug != null) { - debug.println("Multi-threaded initialization failed: " + e); -@@ -342,8 +413,9 @@ public final class SunPKCS11 extends AuthProvider { - } else { - initArgs.flags = 0; - } -- tmpPKCS11 = PKCS11.getInstance(library, functionList, initArgs, -- config.getOmitInitialize()); -+ tmpPKCS11 = PKCS11.getInstance(library, -+ functionList, initArgs, config.getOmitInitialize(), fipsKeyImporter, -+ fipsKeyExporter); - } - p11 = tmpPKCS11; - -@@ -1388,11 +1460,52 @@ public final class SunPKCS11 extends AuthProvider { - } - - @Override -+ @SuppressWarnings("removal") - public Object newInstance(Object param) - throws NoSuchAlgorithmException { - if (!token.isValid()) { - throw new NoSuchAlgorithmException("Token has been removed"); - } -+ if (systemFipsEnabled && !token.fipsLoggedIn && -+ !getType().equals("KeyStore")) { -+ /* -+ * The NSS Software Token in FIPS 140-2 mode requires a -+ * user login for most operations. See sftk_fipsCheck -+ * (nss/lib/softoken/fipstokn.c). In case of a KeyStore -+ * service, let the caller perform the login with -+ * KeyStore::load. Keytool, for example, does this to pass a -+ * PIN from either the -srcstorepass or -deststorepass -+ * argument. In case of a non-KeyStore service, perform the -+ * login now with the PIN available in the fips.nssdb.pin -+ * property. -+ */ -+ try { -+ if (System.getSecurityManager() != null) { -+ try { -+ AccessController.doPrivileged( -+ (PrivilegedExceptionAction) () -> { -+ token.ensureLoggedIn(null); -+ return null; -+ }); -+ } catch (PrivilegedActionException pae) { -+ Exception e = pae.getException(); -+ if (e instanceof LoginException le) { -+ throw le; -+ } else if (e instanceof PKCS11Exception p11e) { -+ throw p11e; -+ } else { -+ throw new RuntimeException(e); -+ } -+ } -+ } else { -+ token.ensureLoggedIn(null); -+ } -+ } catch (PKCS11Exception | LoginException e) { -+ throw new ProviderException("FIPS: error during the Token" + -+ " login required for the " + getType() + -+ " service.", e); -+ } -+ } - try { - return newInstance0(param); - } catch (PKCS11Exception e) { -@@ -1749,6 +1862,9 @@ public final class SunPKCS11 extends AuthProvider { - try { - session = token.getOpSession(); - p11.C_Logout(session.id()); -+ if (systemFipsEnabled) { -+ token.fipsLoggedIn = false; -+ } - if (debug != null) { - debug.println("logout succeeded"); - } -diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Token.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Token.java -index a6f5f0a8764..9a07c96ca4e 100644 ---- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Token.java -+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Token.java -@@ -33,6 +33,7 @@ import java.lang.ref.*; - import java.security.*; - import javax.security.auth.login.LoginException; - -+import jdk.internal.access.SharedSecrets; - import sun.security.jca.JCAUtil; - - import sun.security.pkcs11.wrapper.*; -@@ -48,6 +49,9 @@ import static sun.security.pkcs11.wrapper.PKCS11Exception.RV.*; - */ - final class Token implements Serializable { - -+ private static final boolean systemFipsEnabled = SharedSecrets -+ .getJavaSecuritySystemConfiguratorAccess().isSystemFipsEnabled(); -+ - // need to be serializable to allow SecureRandom to be serialized - @Serial - private static final long serialVersionUID = 2541527649100571747L; -@@ -125,6 +129,10 @@ final class Token implements Serializable { - // flag indicating whether we are logged in - private volatile boolean loggedIn; - -+ // Flag indicating the login status for the NSS Software Token in FIPS mode. -+ // This Token is never asynchronously removed. Used from SunPKCS11. -+ volatile boolean fipsLoggedIn; -+ - // time we last checked login status - private long lastLoginCheck; - -@@ -242,7 +250,12 @@ final class Token implements Serializable { - // call provider.login() if not - void ensureLoggedIn(Session session) throws PKCS11Exception, LoginException { - if (!isLoggedIn(session)) { -- provider.login(null, null); -+ if (systemFipsEnabled) { -+ provider.login(null, new FIPSTokenLoginHandler()); -+ fipsLoggedIn = true; -+ } else { -+ provider.login(null, null); -+ } - } - } - -diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java -index 0fd13fd6fa6..3c959c942a1 100644 ---- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java -+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java -@@ -49,6 +49,9 @@ package sun.security.pkcs11.wrapper; - - import java.io.File; - import java.io.IOException; -+import java.lang.invoke.MethodHandle; -+import java.lang.invoke.MethodHandles; -+import java.lang.invoke.MethodType; - import java.util.*; - - import java.security.AccessController; -@@ -174,18 +177,43 @@ public class PKCS11 { - return version; - } - -+ /* -+ * Compatibility wrapper to allow this method to work as before -+ * when FIPS mode support is not active. -+ */ -+ public static synchronized PKCS11 getInstance(String pkcs11ModulePath, -+ String functionList, CK_C_INITIALIZE_ARGS pInitArgs, -+ boolean omitInitialize) throws IOException, PKCS11Exception { -+ return getInstance(pkcs11ModulePath, functionList, -+ pInitArgs, omitInitialize, null, null); -+ } -+ - public static synchronized PKCS11 getInstance(String pkcs11ModulePath, - String functionList, CK_C_INITIALIZE_ARGS pInitArgs, -- boolean omitInitialize) throws IOException, PKCS11Exception { -+ boolean omitInitialize, MethodHandle fipsKeyImporter, -+ MethodHandle fipsKeyExporter) -+ throws IOException, PKCS11Exception { - // we may only call C_Initialize once per native .so/.dll - // so keep a cache using the (non-canonicalized!) path - PKCS11 pkcs11 = moduleMap.get(pkcs11ModulePath); - if (pkcs11 == null) { -+ boolean nssFipsMode = fipsKeyImporter != null && -+ fipsKeyExporter != null; - if ((pInitArgs != null) - && ((pInitArgs.flags & CKF_OS_LOCKING_OK) != 0)) { -- pkcs11 = new PKCS11(pkcs11ModulePath, functionList); -+ if (nssFipsMode) { -+ pkcs11 = new FIPSPKCS11(pkcs11ModulePath, functionList, -+ fipsKeyImporter, fipsKeyExporter); -+ } else { -+ pkcs11 = new PKCS11(pkcs11ModulePath, functionList); -+ } - } else { -- pkcs11 = new SynchronizedPKCS11(pkcs11ModulePath, functionList); -+ if (nssFipsMode) { -+ pkcs11 = new SynchronizedFIPSPKCS11(pkcs11ModulePath, -+ functionList, fipsKeyImporter, fipsKeyExporter); -+ } else { -+ pkcs11 = new SynchronizedPKCS11(pkcs11ModulePath, functionList); -+ } - } - if (omitInitialize == false) { - try { -@@ -2012,4 +2040,194 @@ static class SynchronizedPKCS11 extends PKCS11 { - super.C_GenerateRandom(hSession, randomData); - } - } -+ -+// PKCS11 subclass that allows using plain private or secret keys in -+// FIPS-configured NSS Software Tokens. Only used when System FIPS -+// is enabled. -+static class FIPSPKCS11 extends PKCS11 { -+ private MethodHandle fipsKeyImporter; -+ private MethodHandle fipsKeyExporter; -+ private MethodHandle hC_GetAttributeValue; -+ FIPSPKCS11(String pkcs11ModulePath, String functionListName, -+ MethodHandle fipsKeyImporter, MethodHandle fipsKeyExporter) -+ throws IOException { -+ super(pkcs11ModulePath, functionListName); -+ this.fipsKeyImporter = fipsKeyImporter; -+ this.fipsKeyExporter = fipsKeyExporter; -+ try { -+ hC_GetAttributeValue = MethodHandles.insertArguments( -+ MethodHandles.lookup().findSpecial(PKCS11.class, -+ "C_GetAttributeValue", MethodType.methodType( -+ void.class, long.class, long.class, -+ CK_ATTRIBUTE[].class), -+ FIPSPKCS11.class), 0, this); -+ } catch (Throwable t) { -+ throw new RuntimeException( -+ "sun.security.pkcs11.wrapper.PKCS11" + -+ "::C_GetAttributeValue method not found.", t); -+ } -+ } -+ -+ public long C_CreateObject(long hSession, -+ CK_ATTRIBUTE[] pTemplate) throws PKCS11Exception { -+ // Creating sensitive key objects from plain key material in a -+ // FIPS-configured NSS Software Token is not allowed. We apply -+ // a key-unwrapping scheme to achieve so. -+ if (FIPSPKCS11Helper.isSensitiveObject(pTemplate)) { -+ try { -+ return ((Long)fipsKeyImporter.invoke(hSession, pTemplate)) -+ .longValue(); -+ } catch (Throwable t) { -+ if (t instanceof PKCS11Exception) { -+ throw (PKCS11Exception)t; -+ } -+ throw new PKCS11Exception(CKR_GENERAL_ERROR, -+ t.getMessage()); -+ } -+ } -+ return super.C_CreateObject(hSession, pTemplate); -+ } -+ -+ public void C_GetAttributeValue(long hSession, long hObject, -+ CK_ATTRIBUTE[] pTemplate) throws PKCS11Exception { -+ FIPSPKCS11Helper.C_GetAttributeValue(hC_GetAttributeValue, -+ fipsKeyExporter, hSession, hObject, pTemplate); -+ } -+} -+ -+// FIPSPKCS11 synchronized counterpart. -+static class SynchronizedFIPSPKCS11 extends SynchronizedPKCS11 { -+ private MethodHandle fipsKeyImporter; -+ private MethodHandle fipsKeyExporter; -+ private MethodHandle hC_GetAttributeValue; -+ SynchronizedFIPSPKCS11(String pkcs11ModulePath, String functionListName, -+ MethodHandle fipsKeyImporter, MethodHandle fipsKeyExporter) -+ throws IOException { -+ super(pkcs11ModulePath, functionListName); -+ this.fipsKeyImporter = fipsKeyImporter; -+ this.fipsKeyExporter = fipsKeyExporter; -+ try { -+ hC_GetAttributeValue = MethodHandles.insertArguments( -+ MethodHandles.lookup().findSpecial(SynchronizedPKCS11.class, -+ "C_GetAttributeValue", MethodType.methodType( -+ void.class, long.class, long.class, -+ CK_ATTRIBUTE[].class), -+ SynchronizedFIPSPKCS11.class), 0, this); -+ } catch (Throwable t) { -+ throw new RuntimeException( -+ "sun.security.pkcs11.wrapper.SynchronizedPKCS11" + -+ "::C_GetAttributeValue method not found.", t); -+ } -+ } -+ -+ public synchronized long C_CreateObject(long hSession, -+ CK_ATTRIBUTE[] pTemplate) throws PKCS11Exception { -+ // See FIPSPKCS11::C_CreateObject. -+ if (FIPSPKCS11Helper.isSensitiveObject(pTemplate)) { -+ try { -+ return ((Long)fipsKeyImporter.invoke(hSession, pTemplate)) -+ .longValue(); -+ } catch (Throwable t) { -+ if (t instanceof PKCS11Exception) { -+ throw (PKCS11Exception)t; -+ } -+ throw new PKCS11Exception(CKR_GENERAL_ERROR, -+ t.getMessage()); -+ } -+ } -+ return super.C_CreateObject(hSession, pTemplate); -+ } -+ -+ public synchronized void C_GetAttributeValue(long hSession, long hObject, -+ CK_ATTRIBUTE[] pTemplate) throws PKCS11Exception { -+ FIPSPKCS11Helper.C_GetAttributeValue(hC_GetAttributeValue, -+ fipsKeyExporter, hSession, hObject, pTemplate); -+ } -+} -+ -+private static class FIPSPKCS11Helper { -+ static boolean isSensitiveObject(CK_ATTRIBUTE[] pTemplate) { -+ for (CK_ATTRIBUTE attr : pTemplate) { -+ if (attr.type == CKA_CLASS && -+ (attr.getLong() == CKO_PRIVATE_KEY || -+ attr.getLong() == CKO_SECRET_KEY)) { -+ return true; -+ } -+ } -+ return false; -+ } -+ static void C_GetAttributeValue(MethodHandle hC_GetAttributeValue, -+ MethodHandle fipsKeyExporter, long hSession, long hObject, -+ CK_ATTRIBUTE[] pTemplate) throws PKCS11Exception { -+ Map sensitiveAttrs = new HashMap<>(); -+ List nonSensitiveAttrs = new LinkedList<>(); -+ FIPSPKCS11Helper.getAttributesBySensitivity(pTemplate, -+ sensitiveAttrs, nonSensitiveAttrs); -+ try { -+ if (sensitiveAttrs.size() > 0) { -+ long keyClass = -1L; -+ long keyType = -1L; -+ try { -+ // Secret and private keys have both class and type -+ // attributes, so we can query them at once. -+ CK_ATTRIBUTE[] queryAttrs = new CK_ATTRIBUTE[]{ -+ new CK_ATTRIBUTE(CKA_CLASS), -+ new CK_ATTRIBUTE(CKA_KEY_TYPE), -+ }; -+ hC_GetAttributeValue.invoke(hSession, hObject, queryAttrs); -+ keyClass = queryAttrs[0].getLong(); -+ keyType = queryAttrs[1].getLong(); -+ } catch (PKCS11Exception e) { -+ // If the query fails, the object is neither a secret nor a -+ // private key. As this case won't be handled with the FIPS -+ // Key Exporter, we keep keyClass initialized to -1L. -+ } -+ if (keyClass == CKO_SECRET_KEY || keyClass == CKO_PRIVATE_KEY) { -+ fipsKeyExporter.invoke(hSession, hObject, keyClass, keyType, -+ sensitiveAttrs); -+ if (nonSensitiveAttrs.size() > 0) { -+ CK_ATTRIBUTE[] pNonSensitiveAttrs = -+ new CK_ATTRIBUTE[nonSensitiveAttrs.size()]; -+ int i = 0; -+ for (CK_ATTRIBUTE nonSensAttr : nonSensitiveAttrs) { -+ pNonSensitiveAttrs[i++] = nonSensAttr; -+ } -+ hC_GetAttributeValue.invoke(hSession, hObject, -+ pNonSensitiveAttrs); -+ // libj2pkcs11 allocates new CK_ATTRIBUTE objects, so we -+ // update the reference on the previous CK_ATTRIBUTEs -+ i = 0; -+ for (CK_ATTRIBUTE nonSensAttr : nonSensitiveAttrs) { -+ nonSensAttr.pValue = pNonSensitiveAttrs[i++].pValue; -+ } -+ } -+ return; -+ } -+ } -+ hC_GetAttributeValue.invoke(hSession, hObject, pTemplate); -+ } catch (Throwable t) { -+ if (t instanceof PKCS11Exception) { -+ throw (PKCS11Exception)t; -+ } -+ throw new PKCS11Exception(CKR_GENERAL_ERROR, -+ t.getMessage()); -+ } -+ } -+ private static void getAttributesBySensitivity(CK_ATTRIBUTE[] pTemplate, -+ Map sensitiveAttrs, -+ List nonSensitiveAttrs) { -+ for (CK_ATTRIBUTE attr : pTemplate) { -+ long type = attr.type; -+ // Aligned with NSS' sftk_isSensitive in lib/softoken/pkcs11u.c -+ if (type == CKA_VALUE || type == CKA_PRIVATE_EXPONENT || -+ type == CKA_PRIME_1 || type == CKA_PRIME_2 || -+ type == CKA_EXPONENT_1 || type == CKA_EXPONENT_2 || -+ type == CKA_COEFFICIENT) { -+ sensitiveAttrs.put(type, attr); -+ } else { -+ nonSensitiveAttrs.add(attr); -+ } -+ } -+ } -+} - } -diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java -index 920422376f8..6aa308fa5f8 100644 ---- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java -+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.java -@@ -215,6 +215,14 @@ public class PKCS11Exception extends Exception { - return res; - } - -+ /** -+ * Constructor taking the error code from the RV enum and -+ * extra info for error message. -+ */ -+ public PKCS11Exception(RV errorEnum, String extraInfo) { -+ this(errorEnum.value, extraInfo); -+ } -+ - /** - * Constructor taking the error code (the CKR_* constants in PKCS#11) and - * extra info for error message. -diff --git a/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java b/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java -index 7f8c4dba002..e65b11fc3ee 100644 ---- a/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java -+++ b/src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java -@@ -34,6 +34,7 @@ import java.security.ProviderException; - import java.util.HashMap; - import java.util.List; - -+import jdk.internal.access.SharedSecrets; - import sun.security.ec.ed.EdDSAKeyFactory; - import sun.security.ec.ed.EdDSAKeyPairGenerator; - import sun.security.ec.ed.EdDSASignature; -@@ -50,6 +51,10 @@ public final class SunEC extends Provider { - - private static final long serialVersionUID = -2279741672933606418L; - -+ private static final boolean systemFipsEnabled = -+ SharedSecrets.getJavaSecuritySystemConfiguratorAccess() -+ .isSystemFipsEnabled(); -+ - private static class ProviderServiceA extends ProviderService { - ProviderServiceA(Provider p, String type, String algo, String cn, - HashMap attrs) { -@@ -240,83 +245,85 @@ public final class SunEC extends Provider { - putXDHEntries(); - putEdDSAEntries(); - -- /* -- * Signature engines -- */ -- putService(new ProviderService(this, "Signature", -- "NONEwithECDSA", "sun.security.ec.ECDSASignature$Raw", -- null, ATTRS)); -- putService(new ProviderServiceA(this, "Signature", -- "SHA1withECDSA", "sun.security.ec.ECDSASignature$SHA1", -- ATTRS)); -- putService(new ProviderServiceA(this, "Signature", -- "SHA224withECDSA", "sun.security.ec.ECDSASignature$SHA224", -- ATTRS)); -- putService(new ProviderServiceA(this, "Signature", -- "SHA256withECDSA", "sun.security.ec.ECDSASignature$SHA256", -- ATTRS)); -- putService(new ProviderServiceA(this, "Signature", -- "SHA384withECDSA", "sun.security.ec.ECDSASignature$SHA384", -- ATTRS)); -- putService(new ProviderServiceA(this, "Signature", -- "SHA512withECDSA", "sun.security.ec.ECDSASignature$SHA512", -- ATTRS)); -- putService(new ProviderServiceA(this, "Signature", -- "SHA3-224withECDSA", "sun.security.ec.ECDSASignature$SHA3_224", -- ATTRS)); -- putService(new ProviderServiceA(this, "Signature", -- "SHA3-256withECDSA", "sun.security.ec.ECDSASignature$SHA3_256", -- ATTRS)); -- putService(new ProviderServiceA(this, "Signature", -- "SHA3-384withECDSA", "sun.security.ec.ECDSASignature$SHA3_384", -- ATTRS)); -- putService(new ProviderServiceA(this, "Signature", -- "SHA3-512withECDSA", "sun.security.ec.ECDSASignature$SHA3_512", -- ATTRS)); -- -- putService(new ProviderService(this, "Signature", -- "NONEwithECDSAinP1363Format", -- "sun.security.ec.ECDSASignature$RawinP1363Format")); -- putService(new ProviderService(this, "Signature", -- "SHA1withECDSAinP1363Format", -- "sun.security.ec.ECDSASignature$SHA1inP1363Format")); -- putService(new ProviderService(this, "Signature", -- "SHA224withECDSAinP1363Format", -- "sun.security.ec.ECDSASignature$SHA224inP1363Format")); -- putService(new ProviderService(this, "Signature", -- "SHA256withECDSAinP1363Format", -- "sun.security.ec.ECDSASignature$SHA256inP1363Format")); -- putService(new ProviderService(this, "Signature", -- "SHA384withECDSAinP1363Format", -- "sun.security.ec.ECDSASignature$SHA384inP1363Format")); -- putService(new ProviderService(this, "Signature", -- "SHA512withECDSAinP1363Format", -- "sun.security.ec.ECDSASignature$SHA512inP1363Format")); -- -- putService(new ProviderService(this, "Signature", -- "SHA3-224withECDSAinP1363Format", -- "sun.security.ec.ECDSASignature$SHA3_224inP1363Format")); -- putService(new ProviderService(this, "Signature", -- "SHA3-256withECDSAinP1363Format", -- "sun.security.ec.ECDSASignature$SHA3_256inP1363Format")); -- putService(new ProviderService(this, "Signature", -- "SHA3-384withECDSAinP1363Format", -- "sun.security.ec.ECDSASignature$SHA3_384inP1363Format")); -- putService(new ProviderService(this, "Signature", -- "SHA3-512withECDSAinP1363Format", -- "sun.security.ec.ECDSASignature$SHA3_512inP1363Format")); -- -- /* -- * Key Pair Generator engine -- */ -- putService(new ProviderServiceA(this, "KeyPairGenerator", -- "EC", "sun.security.ec.ECKeyPairGenerator", ATTRS)); -- -- /* -- * Key Agreement engine -- */ -- putService(new ProviderService(this, "KeyAgreement", -- "ECDH", "sun.security.ec.ECDHKeyAgreement", null, ATTRS)); -+ if (!systemFipsEnabled) { -+ /* -+ * Signature engines -+ */ -+ putService(new ProviderService(this, "Signature", -+ "NONEwithECDSA", "sun.security.ec.ECDSASignature$Raw", -+ null, ATTRS)); -+ putService(new ProviderServiceA(this, "Signature", -+ "SHA1withECDSA", "sun.security.ec.ECDSASignature$SHA1", -+ ATTRS)); -+ putService(new ProviderServiceA(this, "Signature", -+ "SHA224withECDSA", "sun.security.ec.ECDSASignature$SHA224", -+ ATTRS)); -+ putService(new ProviderServiceA(this, "Signature", -+ "SHA256withECDSA", "sun.security.ec.ECDSASignature$SHA256", -+ ATTRS)); -+ putService(new ProviderServiceA(this, "Signature", -+ "SHA384withECDSA", "sun.security.ec.ECDSASignature$SHA384", -+ ATTRS)); -+ putService(new ProviderServiceA(this, "Signature", -+ "SHA512withECDSA", "sun.security.ec.ECDSASignature$SHA512", -+ ATTRS)); -+ putService(new ProviderServiceA(this, "Signature", -+ "SHA3-224withECDSA", "sun.security.ec.ECDSASignature$SHA3_224", -+ ATTRS)); -+ putService(new ProviderServiceA(this, "Signature", -+ "SHA3-256withECDSA", "sun.security.ec.ECDSASignature$SHA3_256", -+ ATTRS)); -+ putService(new ProviderServiceA(this, "Signature", -+ "SHA3-384withECDSA", "sun.security.ec.ECDSASignature$SHA3_384", -+ ATTRS)); -+ putService(new ProviderServiceA(this, "Signature", -+ "SHA3-512withECDSA", "sun.security.ec.ECDSASignature$SHA3_512", -+ ATTRS)); -+ -+ putService(new ProviderService(this, "Signature", -+ "NONEwithECDSAinP1363Format", -+ "sun.security.ec.ECDSASignature$RawinP1363Format")); -+ putService(new ProviderService(this, "Signature", -+ "SHA1withECDSAinP1363Format", -+ "sun.security.ec.ECDSASignature$SHA1inP1363Format")); -+ putService(new ProviderService(this, "Signature", -+ "SHA224withECDSAinP1363Format", -+ "sun.security.ec.ECDSASignature$SHA224inP1363Format")); -+ putService(new ProviderService(this, "Signature", -+ "SHA256withECDSAinP1363Format", -+ "sun.security.ec.ECDSASignature$SHA256inP1363Format")); -+ putService(new ProviderService(this, "Signature", -+ "SHA384withECDSAinP1363Format", -+ "sun.security.ec.ECDSASignature$SHA384inP1363Format")); -+ putService(new ProviderService(this, "Signature", -+ "SHA512withECDSAinP1363Format", -+ "sun.security.ec.ECDSASignature$SHA512inP1363Format")); -+ -+ putService(new ProviderService(this, "Signature", -+ "SHA3-224withECDSAinP1363Format", -+ "sun.security.ec.ECDSASignature$SHA3_224inP1363Format")); -+ putService(new ProviderService(this, "Signature", -+ "SHA3-256withECDSAinP1363Format", -+ "sun.security.ec.ECDSASignature$SHA3_256inP1363Format")); -+ putService(new ProviderService(this, "Signature", -+ "SHA3-384withECDSAinP1363Format", -+ "sun.security.ec.ECDSASignature$SHA3_384inP1363Format")); -+ putService(new ProviderService(this, "Signature", -+ "SHA3-512withECDSAinP1363Format", -+ "sun.security.ec.ECDSASignature$SHA3_512inP1363Format")); -+ -+ /* -+ * Key Pair Generator engine -+ */ -+ putService(new ProviderServiceA(this, "KeyPairGenerator", -+ "EC", "sun.security.ec.ECKeyPairGenerator", ATTRS)); -+ -+ /* -+ * Key Agreement engine -+ */ -+ putService(new ProviderService(this, "KeyAgreement", -+ "ECDH", "sun.security.ec.ECDHKeyAgreement", null, ATTRS)); -+ } - } - - private void putXDHEntries() { -@@ -333,23 +340,25 @@ public final class SunEC extends Provider { - "X448", "sun.security.ec.XDHKeyFactory.X448", - ATTRS)); - -- putService(new ProviderService(this, "KeyPairGenerator", -- "XDH", "sun.security.ec.XDHKeyPairGenerator", null, ATTRS)); -- putService(new ProviderServiceA(this, "KeyPairGenerator", -- "X25519", "sun.security.ec.XDHKeyPairGenerator.X25519", -- ATTRS)); -- putService(new ProviderServiceA(this, "KeyPairGenerator", -- "X448", "sun.security.ec.XDHKeyPairGenerator.X448", -- ATTRS)); -- -- putService(new ProviderService(this, "KeyAgreement", -- "XDH", "sun.security.ec.XDHKeyAgreement", null, ATTRS)); -- putService(new ProviderServiceA(this, "KeyAgreement", -- "X25519", "sun.security.ec.XDHKeyAgreement.X25519", -- ATTRS)); -- putService(new ProviderServiceA(this, "KeyAgreement", -- "X448", "sun.security.ec.XDHKeyAgreement.X448", -- ATTRS)); -+ if (!systemFipsEnabled) { -+ putService(new ProviderService(this, "KeyPairGenerator", -+ "XDH", "sun.security.ec.XDHKeyPairGenerator", null, ATTRS)); -+ putService(new ProviderServiceA(this, "KeyPairGenerator", -+ "X25519", "sun.security.ec.XDHKeyPairGenerator.X25519", -+ ATTRS)); -+ putService(new ProviderServiceA(this, "KeyPairGenerator", -+ "X448", "sun.security.ec.XDHKeyPairGenerator.X448", -+ ATTRS)); -+ -+ putService(new ProviderService(this, "KeyAgreement", -+ "XDH", "sun.security.ec.XDHKeyAgreement", null, ATTRS)); -+ putService(new ProviderServiceA(this, "KeyAgreement", -+ "X25519", "sun.security.ec.XDHKeyAgreement.X25519", -+ ATTRS)); -+ putService(new ProviderServiceA(this, "KeyAgreement", -+ "X448", "sun.security.ec.XDHKeyAgreement.X448", -+ ATTRS)); -+ } - } - - private void putEdDSAEntries() { -@@ -364,21 +373,23 @@ public final class SunEC extends Provider { - putService(new ProviderServiceA(this, "KeyFactory", - "Ed448", "sun.security.ec.ed.EdDSAKeyFactory.Ed448", ATTRS)); - -- putService(new ProviderService(this, "KeyPairGenerator", -- "EdDSA", "sun.security.ec.ed.EdDSAKeyPairGenerator", null, ATTRS)); -- putService(new ProviderServiceA(this, "KeyPairGenerator", -- "Ed25519", "sun.security.ec.ed.EdDSAKeyPairGenerator.Ed25519", -- ATTRS)); -- putService(new ProviderServiceA(this, "KeyPairGenerator", -- "Ed448", "sun.security.ec.ed.EdDSAKeyPairGenerator.Ed448", -- ATTRS)); -- -- putService(new ProviderService(this, "Signature", -- "EdDSA", "sun.security.ec.ed.EdDSASignature", null, ATTRS)); -- putService(new ProviderServiceA(this, "Signature", -- "Ed25519", "sun.security.ec.ed.EdDSASignature.Ed25519", ATTRS)); -- putService(new ProviderServiceA(this, "Signature", -- "Ed448", "sun.security.ec.ed.EdDSASignature.Ed448", ATTRS)); -+ if (!systemFipsEnabled) { -+ putService(new ProviderService(this, "KeyPairGenerator", -+ "EdDSA", "sun.security.ec.ed.EdDSAKeyPairGenerator", null, ATTRS)); -+ putService(new ProviderServiceA(this, "KeyPairGenerator", -+ "Ed25519", "sun.security.ec.ed.EdDSAKeyPairGenerator.Ed25519", -+ ATTRS)); -+ putService(new ProviderServiceA(this, "KeyPairGenerator", -+ "Ed448", "sun.security.ec.ed.EdDSAKeyPairGenerator.Ed448", -+ ATTRS)); -+ -+ putService(new ProviderService(this, "Signature", -+ "EdDSA", "sun.security.ec.ed.EdDSASignature", null, ATTRS)); -+ putService(new ProviderServiceA(this, "Signature", -+ "Ed25519", "sun.security.ec.ed.EdDSASignature.Ed25519", ATTRS)); -+ putService(new ProviderServiceA(this, "Signature", -+ "Ed448", "sun.security.ec.ed.EdDSASignature.Ed448", ATTRS)); -+ } - - } - } -diff --git a/test/jdk/sun/security/pkcs11/fips/NssdbPin.java b/test/jdk/sun/security/pkcs11/fips/NssdbPin.java -new file mode 100644 -index 00000000000..ce01c655eb8 ---- /dev/null -+++ b/test/jdk/sun/security/pkcs11/fips/NssdbPin.java -@@ -0,0 +1,349 @@ -+/* -+ * Copyright (c) 2022, Red Hat, Inc. -+ * -+ * 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. -+ * -+ * 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. -+ */ -+ -+import java.lang.reflect.Method; -+import java.nio.charset.StandardCharsets; -+import java.nio.file.Files; -+import java.nio.file.Path; -+import java.security.KeyStore; -+import java.security.Provider; -+import java.security.Security; -+import java.util.Arrays; -+import java.util.function.Consumer; -+import java.util.List; -+import javax.crypto.Cipher; -+import javax.crypto.spec.SecretKeySpec; -+ -+import jdk.test.lib.process.Proc; -+import jdk.test.lib.util.FileUtils; -+ -+/* -+ * @test -+ * @bug 9999999 -+ * @summary -+ * Test that the fips.nssdb.path and fips.nssdb.pin properties can be used -+ * for a successful login into an NSS DB. Some additional unitary testing -+ * is then performed. This test depends on NSS modutil and must be run in -+ * FIPS mode (the SunPKCS11-NSS-FIPS security provider has to be available). -+ * @modules jdk.crypto.cryptoki/sun.security.pkcs11:+open -+ * @library /test/lib -+ * @requires (jdk.version.major >= 8) -+ * @run main/othervm/timeout=600 NssdbPin -+ * @author Martin Balao (mbalao@redhat.com) -+ */ -+ -+public final class NssdbPin { -+ -+ // Public properties and names -+ private static final String FIPS_NSSDB_PATH_PROP = "fips.nssdb.path"; -+ private static final String FIPS_NSSDB_PIN_PROP = "fips.nssdb.pin"; -+ private static final String FIPS_PROVIDER_NAME = "SunPKCS11-NSS-FIPS"; -+ private static final String NSSDB_TOKEN_NAME = -+ "NSS FIPS 140-2 Certificate DB"; -+ -+ // Data to be tested -+ private static final String[] PINS_TO_TEST = -+ new String[] { -+ "", -+ "1234567890abcdef1234567890ABCDEF\uA4F7" -+ }; -+ private static enum PropType { SYSTEM, SECURITY } -+ private static enum LoginType { IMPLICIT, EXPLICIT } -+ -+ // Internal test fields -+ private static final boolean DEBUG = true; -+ private static class TestContext { -+ String pin; -+ PropType propType; -+ Path workspace; -+ String nssdbPath; -+ Path nssdbPinFile; -+ LoginType loginType; -+ TestContext(String pin, Path workspace) { -+ this.pin = pin; -+ this.workspace = workspace; -+ this.nssdbPath = "sql:" + workspace; -+ this.loginType = LoginType.IMPLICIT; -+ } -+ } -+ -+ public static void main(String[] args) throws Throwable { -+ if (args.length == 3) { -+ // Executed by a child process. -+ mainChild(args[0], args[1], LoginType.valueOf(args[2])); -+ } else if (args.length == 0) { -+ // Executed by the parent process. -+ mainLauncher(); -+ // Test defaults -+ mainChild("sql:/etc/pki/nssdb", "", LoginType.IMPLICIT); -+ System.out.println("TEST PASS - OK"); -+ } else { -+ throw new Exception("Unexpected number of arguments."); -+ } -+ } -+ -+ private static void mainChild(String expectedPath, String expectedPin, -+ LoginType loginType) throws Throwable { -+ if (DEBUG) { -+ for (String prop : Arrays.asList(FIPS_NSSDB_PATH_PROP, -+ FIPS_NSSDB_PIN_PROP)) { -+ System.out.println(prop + " (System): " + -+ System.getProperty(prop)); -+ System.out.println(prop + " (Security): " + -+ Security.getProperty(prop)); -+ } -+ } -+ -+ /* -+ * Functional cross-test against an NSS DB generated by modutil -+ * with the same PIN. Check that we can perform a crypto operation -+ * that requires a login. The login might be explicit or implicit. -+ */ -+ Provider p = Security.getProvider(FIPS_PROVIDER_NAME); -+ if (DEBUG) { -+ System.out.println(FIPS_PROVIDER_NAME + ": " + p); -+ } -+ if (p == null) { -+ throw new Exception(FIPS_PROVIDER_NAME + " initialization failed."); -+ } -+ if (DEBUG) { -+ System.out.println("Login type: " + loginType); -+ } -+ if (loginType == LoginType.EXPLICIT) { -+ // Do the expansion to account for truncation, so C_Login in -+ // the NSS Software Token gets a UTF-8 encoded PIN. -+ byte[] pinUtf8 = expectedPin.getBytes(StandardCharsets.UTF_8); -+ char[] pinChar = new char[pinUtf8.length]; -+ for (int i = 0; i < pinChar.length; i++) { -+ pinChar[i] = (char)(pinUtf8[i] & 0xFF); -+ } -+ KeyStore.getInstance("PKCS11", p).load(null, pinChar); -+ if (DEBUG) { -+ System.out.println("Explicit login succeeded."); -+ } -+ } -+ if (DEBUG) { -+ System.out.println("Trying a crypto operation..."); -+ } -+ final int blockSize = 16; -+ Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding", p); -+ cipher.init(Cipher.ENCRYPT_MODE, -+ new SecretKeySpec(new byte[blockSize], "AES")); -+ if (cipher.doFinal(new byte[blockSize]).length != blockSize) { -+ throw new Exception("Could not perform a crypto operation."); -+ } -+ if (DEBUG) { -+ if (loginType == LoginType.IMPLICIT) { -+ System.out.println("Implicit login succeeded."); -+ } -+ System.out.println("Crypto operation after login succeeded."); -+ } -+ -+ if (loginType == LoginType.IMPLICIT) { -+ /* -+ * Additional unitary testing. Expected to succeed at this point. -+ */ -+ if (DEBUG) { -+ System.out.println("Trying unitary test..."); -+ } -+ String sysPathProp = System.getProperty(FIPS_NSSDB_PATH_PROP); -+ if (DEBUG) { -+ System.out.println("Path value (as a System property): " + -+ sysPathProp); -+ } -+ if (!expectedPath.equals(sysPathProp)) { -+ throw new Exception("Path is different than expected: " + -+ sysPathProp + " (actual) vs " + expectedPath + -+ " (expected)."); -+ } -+ Class c = Class -+ .forName("sun.security.pkcs11.FIPSTokenLoginHandler"); -+ Method m = c.getDeclaredMethod("getFipsNssdbPin"); -+ m.setAccessible(true); -+ String pin = null; -+ char[] pinChar = (char[]) m.invoke(c); -+ if (pinChar != null) { -+ byte[] pinUtf8 = new byte[pinChar.length]; -+ for (int i = 0; i < pinUtf8.length; i++) { -+ pinUtf8[i] = (byte) pinChar[i]; -+ } -+ pin = new String(pinUtf8, StandardCharsets.UTF_8); -+ } -+ if (!expectedPin.isEmpty() && !expectedPin.equals(pin) || -+ expectedPin.isEmpty() && pin != null) { -+ throw new Exception("PIN is different than expected: '" + pin + -+ "' (actual) vs '" + expectedPin + "' (expected)."); -+ } -+ if (DEBUG) { -+ System.out.println("PIN value: " + pin); -+ System.out.println("Unitary test succeeded."); -+ } -+ } -+ } -+ -+ private static void mainLauncher() throws Throwable { -+ for (String pin : PINS_TO_TEST) { -+ Path workspace = Files.createTempDirectory(null); -+ try { -+ TestContext ctx = new TestContext(pin, workspace); -+ createNSSDB(ctx); -+ { -+ ctx.loginType = LoginType.IMPLICIT; -+ for (PropType propType : PropType.values()) { -+ ctx.propType = propType; -+ pinLauncher(ctx); -+ envLauncher(ctx); -+ fileLauncher(ctx); -+ } -+ } -+ explicitLoginLauncher(ctx); -+ } finally { -+ FileUtils.deleteFileTreeWithRetry(workspace); -+ } -+ } -+ } -+ -+ private static void pinLauncher(TestContext ctx) throws Throwable { -+ launchTest(p -> {}, "pin:" + ctx.pin, ctx); -+ } -+ -+ private static void envLauncher(TestContext ctx) throws Throwable { -+ final String NSSDB_PIN_ENV_VAR = "NSSDB_PIN_ENV_VAR"; -+ launchTest(p -> p.env(NSSDB_PIN_ENV_VAR, ctx.pin), -+ "env:" + NSSDB_PIN_ENV_VAR, ctx); -+ } -+ -+ private static void fileLauncher(TestContext ctx) throws Throwable { -+ // The file containing the PIN (ctx.nssdbPinFile) was created by the -+ // generatePinFile method, called from createNSSDB. -+ launchTest(p -> {}, "file:" + ctx.nssdbPinFile, ctx); -+ } -+ -+ private static void explicitLoginLauncher(TestContext ctx) -+ throws Throwable { -+ ctx.loginType = LoginType.EXPLICIT; -+ ctx.propType = PropType.SYSTEM; -+ launchTest(p -> {}, "Invalid PIN, must be ignored", ctx); -+ } -+ -+ private static void launchTest(Consumer procCb, String pinPropVal, -+ TestContext ctx) throws Throwable { -+ if (DEBUG) { -+ System.out.println("Launching JVM with " + FIPS_NSSDB_PATH_PROP + -+ "=" + ctx.nssdbPath + " and " + FIPS_NSSDB_PIN_PROP + -+ "=" + pinPropVal); -+ } -+ Proc p = Proc.create(NssdbPin.class.getName()) -+ .args(ctx.nssdbPath, ctx.pin, ctx.loginType.name()); -+ if (ctx.propType == PropType.SYSTEM) { -+ p.prop(FIPS_NSSDB_PATH_PROP, ctx.nssdbPath); -+ p.prop(FIPS_NSSDB_PIN_PROP, pinPropVal); -+ // Make sure that Security properties defaults are not used. -+ p.secprop(FIPS_NSSDB_PATH_PROP, ""); -+ p.secprop(FIPS_NSSDB_PIN_PROP, ""); -+ } else if (ctx.propType == PropType.SECURITY) { -+ p.secprop(FIPS_NSSDB_PATH_PROP, ctx.nssdbPath); -+ pinPropVal = escapeForPropsFile(pinPropVal); -+ p.secprop(FIPS_NSSDB_PIN_PROP, pinPropVal); -+ } else { -+ throw new Exception("Unsupported property type."); -+ } -+ if (DEBUG) { -+ p.inheritIO(); -+ p.prop("java.security.debug", "sunpkcs11"); -+ p.debug(NssdbPin.class.getName()); -+ -+ // Need the launched process to connect to a debugger? -+ //System.setProperty("test.vm.opts", "-Xdebug -Xrunjdwp:" + -+ // "transport=dt_socket,address=localhost:8000,suspend=y"); -+ } else { -+ p.nodump(); -+ } -+ procCb.accept(p); -+ p.start().waitFor(0); -+ } -+ -+ private static String escapeForPropsFile(String str) throws Throwable { -+ StringBuffer sb = new StringBuffer(); -+ for (int i = 0; i < str.length(); i++) { -+ int cp = str.codePointAt(i); -+ if (Character.UnicodeBlock.of(cp) -+ == Character.UnicodeBlock.BASIC_LATIN) { -+ sb.append(Character.toChars(cp)); -+ } else { -+ sb.append("\\u").append(String.format("%04X", cp)); -+ } -+ } -+ return sb.toString(); -+ } -+ -+ private static void createNSSDB(TestContext ctx) throws Throwable { -+ ProcessBuilder pb = getModutilPB(ctx, "-create"); -+ if (DEBUG) { -+ System.out.println("Creating an NSS DB in " + ctx.workspace + -+ "..."); -+ System.out.println("cmd: " + String.join(" ", pb.command())); -+ } -+ if (pb.start().waitFor() != 0) { -+ throw new Exception("NSS DB creation failed."); -+ } -+ generatePinFile(ctx); -+ pb = getModutilPB(ctx, "-changepw", NSSDB_TOKEN_NAME, -+ "-newpwfile", ctx.nssdbPinFile.toString()); -+ if (DEBUG) { -+ System.out.println("NSS DB created."); -+ System.out.println("Changing NSS DB PIN..."); -+ System.out.println("cmd: " + String.join(" ", pb.command())); -+ } -+ if (pb.start().waitFor() != 0) { -+ throw new Exception("NSS DB PIN change failed."); -+ } -+ if (DEBUG) { -+ System.out.println("NSS DB PIN changed."); -+ } -+ } -+ -+ private static ProcessBuilder getModutilPB(TestContext ctx, String... args) -+ throws Throwable { -+ ProcessBuilder pb = new ProcessBuilder("modutil", "-force"); -+ List pbCommand = pb.command(); -+ if (args != null) { -+ pbCommand.addAll(Arrays.asList(args)); -+ } -+ pbCommand.add("-dbdir"); -+ pbCommand.add(ctx.nssdbPath); -+ if (DEBUG) { -+ pb.inheritIO(); -+ } else { -+ pb.redirectError(ProcessBuilder.Redirect.INHERIT); -+ } -+ return pb; -+ } -+ -+ private static void generatePinFile(TestContext ctx) throws Throwable { -+ ctx.nssdbPinFile = Files.createTempFile(ctx.workspace, null, null); -+ Files.writeString(ctx.nssdbPinFile, ctx.pin + System.lineSeparator() + -+ "2nd line with garbage"); -+ } -+} -diff --git a/test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java b/test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java -new file mode 100644 -index 00000000000..87f1ad04505 ---- /dev/null -+++ b/test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java -@@ -0,0 +1,77 @@ -+/* -+ * Copyright (c) 2022, Red Hat, Inc. -+ * -+ * 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. -+ * -+ * 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. -+ */ -+ -+import java.security.Provider; -+import java.security.Security; -+ -+/* -+ * @test -+ * @bug 9999999 -+ * @requires (jdk.version.major >= 8) -+ * @run main/othervm/timeout=30 VerifyMissingAttributes -+ * @author Martin Balao (mbalao@redhat.com) -+ */ -+ -+public final class VerifyMissingAttributes { -+ -+ private static final String[] svcAlgImplementedIn = { -+ "AlgorithmParameterGenerator.DSA", -+ "AlgorithmParameters.DSA", -+ "CertificateFactory.X.509", -+ "KeyStore.JKS", -+ "KeyStore.CaseExactJKS", -+ "KeyStore.DKS", -+ "CertStore.Collection", -+ "CertStore.com.sun.security.IndexedCollection" -+ }; -+ -+ public static void main(String[] args) throws Throwable { -+ Provider sunProvider = Security.getProvider("SUN"); -+ for (String svcAlg : svcAlgImplementedIn) { -+ String filter = svcAlg + " ImplementedIn:Software"; -+ doQuery(sunProvider, filter); -+ } -+ if (Double.parseDouble( -+ System.getProperty("java.specification.version")) >= 17) { -+ String filter = "KeyFactory.RSASSA-PSS SupportedKeyClasses:" + -+ "java.security.interfaces.RSAPublicKey" + -+ "|java.security.interfaces.RSAPrivateKey"; -+ doQuery(Security.getProvider("SunRsaSign"), filter); -+ } -+ System.out.println("TEST PASS - OK"); -+ } -+ -+ private static void doQuery(Provider expectedProvider, String filter) -+ throws Exception { -+ if (expectedProvider == null) { -+ throw new Exception("Provider not found."); -+ } -+ Provider[] providers = Security.getProviders(filter); -+ if (providers == null || providers.length != 1 || -+ providers[0] != expectedProvider) { -+ throw new Exception("Failure retrieving the provider with this" + -+ " query: " + filter); -+ } -+ } -+} diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index c658ed7..2a294ff 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -334,9 +334,9 @@ %endif # New Version-String scheme-style defines -%global featurever 24 +%global featurever 25 %global interimver 0 -%global updatever 2 +%global updatever 0 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, @@ -386,7 +386,6 @@ # Define IcedTea version used for SystemTap tapsets and desktop file %global icedteaver 6.0.0pre00-c848b93a8598 # Define current Git revision for the FIPS support patches -%global fipsver 9203d50836c # Define JDK versions %global newjavaver %{featurever}.%{interimver}.%{updatever}.%{patchver} %global javaver %{featurever} @@ -400,7 +399,7 @@ %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 12 +%global buildver 36 %global rpmrelease 1 #%%global tagsuffix %%{nil} # 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 @@ -684,15 +683,14 @@ Source18: TestTranslations.java # test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java: fixed jtreg main class # RH1940064: Enable XML Signature provider in FIPS mode # RH2173781: Avoid calling C_GetInfo() too early, before cryptoki is initialized [now part of JDK-8301553 upstream] -#Patch1001: fips-%{featurever}u-%{fipsver}.patch ############################################# # # OpenJDK patches in need of upstreaming # ############################################# -# Fix rawhide build failure with GCC 15 -Patch1100: 0001-Fix-name-class-of-uabs-with-GCC-15.patch + +# Currently empty ############################################# # @@ -707,8 +705,8 @@ Patch1100: 0001-Fix-name-class-of-uabs-with-GCC-15.patch # Portable build specific patches # ############################################# -Patch1101: revert8350202.patch +# Currently empty BuildRequires: autoconf BuildRequires: automake @@ -999,8 +997,6 @@ pushd %{top_level_dir_name} # Add crypto policy and FIPS support # Skipping fips patch whil eit is not ready for jdk22 %%patch -P1001 -p1 # Patches in need of upstreaming -%patch -P1100 -p1 -%patch -P1101 -p1 popd # openjdk @@ -1733,8 +1729,4 @@ done %{_jvmdir}/%{miscportablearchive}.sha256sum %endif -%changelog -* Thu Jul 24 2025 Fedora Release Engineering - 1:24.0.2.0.12-1.rolling.1 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - %autochangelog diff --git a/jconsole.desktop.in b/jconsole.desktop.in deleted file mode 100644 index c1b8f6a..0000000 --- a/jconsole.desktop.in +++ /dev/null @@ -1 +0,0 @@ -# this file is intentionally not here, as portable builds do not have desktop integration diff --git a/revert8350202.patch b/revert8350202.patch deleted file mode 100644 index e325128..0000000 --- a/revert8350202.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 3b9470ab57d45e491e18e2e86d9f349312016d81 Mon Sep 17 00:00:00 2001 -From: duke -Date: Fri, 7 Mar 2025 15:23:06 +0000 -Subject: [REVERT] Backport e1d0a9c832ef3e92faaed7f290ff56c0ed8a9d94 - ---- - make/autoconf/flags-cflags.m4 | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 -index 7f92bd015d3..a740de222d0 100644 ---- a/make/autoconf/flags-cflags.m4 -+++ b/make/autoconf/flags-cflags.m4 -@@ -743,7 +743,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], - elif test "x$FLAGS_CPU" = xppc64le; then - # Little endian machine uses ELFv2 ABI. - # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. -- $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power10" -+ $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8" - fi - elif test "x$FLAGS_CPU" = xs390x; then - $1_CFLAGS_CPU="-mbackchain -march=z10" -@@ -764,7 +764,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], - if test "x$FLAGS_CPU" = xppc64le; then - # Little endian machine uses ELFv2 ABI. - # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. -- $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power10" -+ $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8" - fi - fi - if test "x$OPENJDK_TARGET_OS" = xaix; then diff --git a/scripts/generate_source_tarball.sh b/scripts/generate_source_tarball.sh index ad163f3..e01043d 100755 --- a/scripts/generate_source_tarball.sh +++ b/scripts/generate_source_tarball.sh @@ -48,8 +48,8 @@ # This will check out the same version as example 1, but from the # upstream repository: # -# $ VERSION=jdk-17.0.3+5 PROJECT_NAME=openjdk REPO_NAME=jdk17u \ -# BOOT_JDK=/usr/lib/jvm/java-17-openjdk ./generate_source_tarball.sh +# $ VERSION=jdk-25+36 PROJECT_NAME=openjdk REPO_NAME=jdk25u \ +# BOOT_JDK=/usr/lib/jvm/java-17-openjdk sh scripts/generate_source_tarball.sh # # Example 3: # This will read the OpenJDK feature version from the spec file, then create a diff --git a/sources b/sources index f50b623..6a09c68 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-24.0.2+12.tar.xz) = 92dc174ad4fedb1138bc183a390a85a76fcc3aa1508d4d00f49012b28a8e3a5a1739b349f0fb03dedc6f7977eafa472c5f7608c61ae656c0ecf795b9e96a95ae +SHA512 (openjdk-25+36.tar.xz) = 062f55acdcccb32dd62377dce9573a70b0535312f2f69cb660be1d321b52ad3e24ef9c333055434b19e6fedb94dd5a1408addfb7e5f47d36664587ab1c12a22b From 70e5657156453033242506aa764cb32d6386bc4e Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 22 Sep 2025 17:25:54 +0200 Subject: [PATCH 77/86] Returned revert8350202.patch; still needed on epel8 --- java-latest-openjdk-portable.spec | 7 ++++--- revert8350202.patch | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 revert8350202.patch diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 2a294ff..2d99fa2 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -400,7 +400,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 36 -%global rpmrelease 1 +%global rpmrelease 2 #%%global tagsuffix %%{nil} # 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 @@ -567,7 +567,7 @@ Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as # java-X-openjdk. See: https://bugzilla.redhat.com/show_bug.cgi?id=1647298 -Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist}.1 +Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist} # 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 # also included the epoch in their virtual provides. This created a @@ -706,7 +706,7 @@ Source18: TestTranslations.java # ############################################# -# Currently empty +Patch1101: revert8350202.patch BuildRequires: autoconf BuildRequires: automake @@ -997,6 +997,7 @@ pushd %{top_level_dir_name} # Add crypto policy and FIPS support # Skipping fips patch whil eit is not ready for jdk22 %%patch -P1001 -p1 # Patches in need of upstreaming +%patch -P1101 -p1 popd # openjdk diff --git a/revert8350202.patch b/revert8350202.patch new file mode 100644 index 0000000..e325128 --- /dev/null +++ b/revert8350202.patch @@ -0,0 +1,31 @@ +From 3b9470ab57d45e491e18e2e86d9f349312016d81 Mon Sep 17 00:00:00 2001 +From: duke +Date: Fri, 7 Mar 2025 15:23:06 +0000 +Subject: [REVERT] Backport e1d0a9c832ef3e92faaed7f290ff56c0ed8a9d94 + +--- + make/autoconf/flags-cflags.m4 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 +index 7f92bd015d3..a740de222d0 100644 +--- a/make/autoconf/flags-cflags.m4 ++++ b/make/autoconf/flags-cflags.m4 +@@ -743,7 +743,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], + elif test "x$FLAGS_CPU" = xppc64le; then + # Little endian machine uses ELFv2 ABI. + # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. +- $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power10" ++ $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8" + fi + elif test "x$FLAGS_CPU" = xs390x; then + $1_CFLAGS_CPU="-mbackchain -march=z10" +@@ -764,7 +764,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], + if test "x$FLAGS_CPU" = xppc64le; then + # Little endian machine uses ELFv2 ABI. + # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. +- $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power10" ++ $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8" + fi + fi + if test "x$OPENJDK_TARGET_OS" = xaix; then From 162e0d77cbc4bb3e9722d0abcd05b804705eb8a7 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 22 Sep 2025 17:34:41 +0200 Subject: [PATCH 78/86] removing revert8350202.patch again; skiping epel8 for now maybe pernamently --- java-latest-openjdk-portable.spec | 3 +-- revert8350202.patch | 31 ------------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 revert8350202.patch diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 2d99fa2..62705e8 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -706,7 +706,7 @@ Source18: TestTranslations.java # ############################################# -Patch1101: revert8350202.patch +# Currently empty BuildRequires: autoconf BuildRequires: automake @@ -997,7 +997,6 @@ pushd %{top_level_dir_name} # Add crypto policy and FIPS support # Skipping fips patch whil eit is not ready for jdk22 %%patch -P1001 -p1 # Patches in need of upstreaming -%patch -P1101 -p1 popd # openjdk diff --git a/revert8350202.patch b/revert8350202.patch deleted file mode 100644 index e325128..0000000 --- a/revert8350202.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 3b9470ab57d45e491e18e2e86d9f349312016d81 Mon Sep 17 00:00:00 2001 -From: duke -Date: Fri, 7 Mar 2025 15:23:06 +0000 -Subject: [REVERT] Backport e1d0a9c832ef3e92faaed7f290ff56c0ed8a9d94 - ---- - make/autoconf/flags-cflags.m4 | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 -index 7f92bd015d3..a740de222d0 100644 ---- a/make/autoconf/flags-cflags.m4 -+++ b/make/autoconf/flags-cflags.m4 -@@ -743,7 +743,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], - elif test "x$FLAGS_CPU" = xppc64le; then - # Little endian machine uses ELFv2 ABI. - # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. -- $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power10" -+ $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8" - fi - elif test "x$FLAGS_CPU" = xs390x; then - $1_CFLAGS_CPU="-mbackchain -march=z10" -@@ -764,7 +764,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], - if test "x$FLAGS_CPU" = xppc64le; then - # Little endian machine uses ELFv2 ABI. - # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. -- $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power10" -+ $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8" - fi - fi - if test "x$OPENJDK_TARGET_OS" = xaix; then From 7b169ddefa968d7b6076fbe90dece28a5c83595f Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Thu, 2 Oct 2025 16:36:07 +0200 Subject: [PATCH 79/86] Split toolchains between el7 and epel8 This should return epel8 buildability, still maintain el7-like toolchain and also work in rawhide/el10 --- java-latest-openjdk-portable.spec | 50 +++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 62705e8..3434c7c 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -243,8 +243,25 @@ # Target to use to just build HotSpot %global hotspot_target hotspot +# When building on older systems, we need system, or self build legacy toolchains of explicit version +%if ((0%{?rhel} > 0 && 0%{?rhel} < 8)) || ((0%{?epel} > 0 && 0%{?epel} < 9)) +%global is_dtstoolchain 1 +%else +%global is_dtstoolchain 0 +%endif +%if ((0%{?rhel} > 0 && 0%{?rhel} < 8)) # DTS toolset to use to provide gcc & binutils %global dtsversion 10 +%global dtsname devtoolset +%endif +%if ((0%{?epel} > 0 && 0%{?epel} < 9)) +# GCC toolset to use to provide gcc & binutils +%global dtsversion 14 +%global dtsname gcc-toolset +%endif +%if %{is_dtstoolchain} +%global dtsid %{dtsname}-%{dtsversion} +%endif # Disable LTO as this causes build failures at the moment. # See RHBZ#1861401 @@ -718,14 +735,22 @@ BuildRequires: desktop-file-utils BuildRequires: elfutils-devel BuildRequires: file BuildRequires: fontconfig-devel -%if (0%{?rhel} > 0 && 0%{?rhel} < 8) -BuildRequires: devtoolset-%{dtsversion}-gcc -BuildRequires: devtoolset-%{dtsversion}-gcc-c++ -%else -BuildRequires: gcc -# gcc-c++ is already needed +%if %{is_dtstoolchain} +BuildRequires: %{dtsid}-gcc +BuildRequires: %{dtsid}-gcc-c++ %endif +%if %{is_dtstoolchain} && "%{?dtsname}" == "gcc-toolset" +# wee need slightly more for gcc-toolset +BuildRequires: %{dtsid}-annobin-annocheck +BuildRequires: %{dtsid}-annobin-plugin-gcc +BuildRequires: %{dtsid}-binutils +BuildRequires: %{dtsid}-gcc-plugin-annobin +%endif +%if ! %{is_dtstoolchain} +# Earlier versions have a bug in tree vectorization on PPC +BuildRequires: gcc >= 4.8.3-8 BuildRequires: gcc-c++ +%endif BuildRequires: gdb %if (0%{?rhel} > 0 && 0%{?rhel} < 8) # rhel7 only, portables only. Rhel8 have gtk3, rpms have runtime recommends of gtk @@ -768,8 +793,6 @@ BuildRequires: pandoc BuildRequires: tzdata-java >= 2023c # cacerts build requirement in portable mode BuildRequires: ca-certificates -# Earlier versions have a bug in tree vectorization on PPC -BuildRequires: gcc >= 4.8.3-8 %if %{with_systemtap} BuildRequires: systemtap-sdt-devel @@ -1101,8 +1124,8 @@ function buildjdk() { # rather than ${link_opt} as the system versions # are always used in a system_libs build, even # for the static library build -%if (0%{?rhel} > 0 && 0%{?rhel} < 8) - scl enable devtoolset-%{dtsversion} -- bash ${top_dir_abs_src_path}/configure \ +%if %{is_dtstoolchain} + scl enable %{dtsid} -- bash ${top_dir_abs_src_path}/configure \ %else bash ${top_dir_abs_src_path}/configure \ %endif @@ -1144,11 +1167,12 @@ function buildjdk() { %ifarch %{zgc_arches} --with-jvm-features=zgc \ %endif - --disable-warnings-as-errors + --disable-warnings-as-errors \ + || ( pwd; cat $(find | grep config.log) && false ) cat spec.gmk -%if (0%{?rhel} > 0 && 0%{?rhel} < 8) - scl enable devtoolset-%{dtsversion} -- make \ +%if %{is_dtstoolchain} + scl enable %{dtsid} -- make \ %else make \ %endif From 93d6522bfd2509d8f055b3fb1e4edc948ba52dd2 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 7 Oct 2025 16:58:30 +0200 Subject: [PATCH 80/86] Moved to build by itslef - jdk25 --- java-latest-openjdk-portable.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 3434c7c..99518f5 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -358,7 +358,7 @@ # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, # and this it is better to change it here, on single place -%global buildjdkver 24 +%global buildjdkver 25 # We don't add any LTS designator for STS packages (Fedora and EPEL). # We need to explicitly exclude EPEL as it would have the %%{rhel} macro defined. %if 0%{?rhel} && !0%{?epel} From 2748852214e905070f01cfd8febe989ddb5fb8f5 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 7 Oct 2025 17:12:38 +0200 Subject: [PATCH 81/86] BUmped release --- java-latest-openjdk-portable.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 99518f5..ad6bf58 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -417,7 +417,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 36 -%global rpmrelease 2 +%global rpmrelease 3 #%%global tagsuffix %%{nil} # 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 From 1cdac5f81175341202d3132d6fef6da66ef13e42 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Wed, 22 Oct 2025 18:28:12 +0200 Subject: [PATCH 82/86] BUmped to October 2025 CPU and made to build by itslef by java-latest-openjdk instead of java-25-openjdk --- .gitignore | 1 + java-latest-openjdk-portable.spec | 8 ++++---- sources | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index e5f004c..c2a5115 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,4 @@ /openjdk-25+32-ea.tar.xz /openjdk-jdk-25+36.tar.xz /openjdk-25+36.tar.xz +/openjdk-25.0.1+8.tar.xz diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index ad6bf58..213f7b4 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -353,7 +353,7 @@ # New Version-String scheme-style defines %global featurever 25 %global interimver 0 -%global updatever 0 +%global updatever 1 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, @@ -369,7 +369,7 @@ %global lts_designator_zip "" %endif # JDK to use for bootstrapping -%global bootjdk /usr/lib/jvm/java-%{buildjdkver}-openjdk +%global bootjdk /usr/lib/jvm/java-latest-openjdk # Define whether to use the bootstrap JDK directly or with a fresh libjvm.so # This will only work where the bootstrap JDK is the same major version # as the JDK being built @@ -416,8 +416,8 @@ %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 36 -%global rpmrelease 3 +%global buildver 8 +%global rpmrelease 1 #%%global tagsuffix %%{nil} # 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 diff --git a/sources b/sources index 6a09c68..641515d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-25+36.tar.xz) = 062f55acdcccb32dd62377dce9573a70b0535312f2f69cb660be1d321b52ad3e24ef9c333055434b19e6fedb94dd5a1408addfb7e5f47d36664587ab1c12a22b +SHA512 (openjdk-25.0.1+8.tar.xz) = eb84d876f81ca02803283e8294c89b6acbed3753426811c3bcc228615c9618deefc85da4aa702800cac2feb103e628ee8b92292b316e9d7e12a58b6de69c5085 From 8da764d82ac2851ef8953ca2bcf20984439fc021 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 5 Dec 2025 13:20:30 +0100 Subject: [PATCH 83/86] Added support for build with devkit in rhel and building by fastdebug if possible --- NEWS | 689 ++++++++++++++++++++++++++++-- TestTranslations.java | 16 +- java-latest-openjdk-portable.spec | 590 +++++++++++++++++-------- scripts/get_bundle_versions.sh | 172 ++++++++ 4 files changed, 1240 insertions(+), 227 deletions(-) create mode 100755 scripts/get_bundle_versions.sh diff --git a/NEWS b/NEWS index d44c7e0..0a4a628 100644 --- a/NEWS +++ b/NEWS @@ -2,34 +2,669 @@ Key: JDK-X - https://bugs.openjdk.java.net/browse/JDK-X CVE-XXXX-YYYY: https://cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY -JEP-XYZ: https://openjdk.org/jeps/XYZ -New in release OpenJDK 25.0.0+32 (2025-06-9): +New in release OpenJDK 25.0.1 (2025-10-21): =========================================== -JDK 25 is in Rampdown Phase One. The overall feature set is frozen. No further JEPs will be targeted to this release. -The stabilization branch, jdk25, is open for select bug fixes and, with approval, late enhancements per the JDK Release Process (JEP 3). Integrate most stabilization changes via backports from the main line. - - JEP-470: PEM Encodings of Cryptographic Objects (Preview) - - JEP-502: Stable Values (Preview) - - JEP-503: Remove the 32-bit x86 Port - - JEP-505: Structured Concurrency (Fifth Preview) - - JEP-506: Scoped Values - - JEP-507: Primitive Types in Patterns, instanceof, and switch (Third Preview) - - JEP-508: Vector API (Tenth Incubator) - - JEP-509: JFR CPU-Time Profiling (Experimental) - - JEP-510: Key Derivation Function API - - JEP-511: Module Import Declarations - - JEP-512: Compact Source Files and Instance Main Methods - - JEP-513: Flexible Constructor Bodies - - JEP-514: Ahead-of-Time Command-Line Ergonomics - - JEP-515: Ahead-of-Time Method Profiling - - JEP-518: JFR Cooperative Sampling - - JEP-519: Compact Object Headers - - JEP-520: JFR Method Timing & Tracing - - JEP-521: Generational Shenandoah +* CVEs + - CVE-2025-53057 + - CVE-2025-53066 + - CVE-2025-61748 +* Changes + - JDK-8315131: Clarify VarHandle set/get access on 32-bit platforms + - JDK-8352637: Enhance bytecode verification + - JDK-8356294: Enhance Path Factories + - JDK-8356587: Missing object ID X in pool jdk.types.Method + - JDK-8357826: Avoid running some jtreg tests when asan is configured + - JDK-8358452: JNI exception pending in Java_sun_awt_screencast_ScreencastHelper_remoteDesktopKeyImpl of screencast_pipewire.c:1214 (ID: 51119) + - JDK-8358577: Test serviceability/jvmti/thread/GetCurrentContendedMonitor/contmon01/contmon01.java failed: unexpexcted monitor object + - JDK-8358819: The first year is not displayed correctly in Japanese Calendar + - JDK-8359059: Bump version numbers for 25.0.1 + - JDK-8359218: RISC-V: Only enable CRC32 intrinsic when AvoidUnalignedAccess == false + - JDK-8359270: C2: alignment check should consider base offset when emitting arraycopy runtime call + - JDK-8359454: Enhance String handling + - JDK-8359596: Behavior change when both -Xlint:options and -Xlint:-options flags are given + - JDK-8360179: RISC-V: Only enable BigInteger intrinsics when AvoidUnalignedAccess == false + - JDK-8360533: ContainerRuntimeVersionTestUtils fromVersionString fails with some docker versions + - JDK-8360647: [XWayland] [OL10] NumPad keys are not triggered + - JDK-8360679: Shenandoah: AOT saved adapter calls into broken GC barrier stub + - JDK-8360937: Enhance certificate handling + - JDK-8361212: Remove AffirmTrust root CAs + - JDK-8361532: RISC-V: Several vector tests fail after JDK-8354383 + - JDK-8361829: [TESTBUG] RISC-V: compiler/vectorization/runner/BasicIntOpTest.java fails with RVV but not Zvbb + - JDK-8362109: Change milestone to fcs for all releases + - JDK-8362882: Update SubmissionPublisher() specification to reflect use of ForkJoinPool.asyncCommonPool() + - JDK-8366223: ZGC: ZPageAllocator::cleanup_failed_commit_multi_partition is broken + - JDK-8367031: [backout] Change java.time month/day field types to 'byte' + - JDK-8368308: ISO 4217 Amendment 180 Update -+ https://openjdk.org/projects/jdk/25/ -+ https://openjdk.org/projects/jdk/24/ -+ https://openjdk.org/projects/jdk/23/ -+ https://openjdk.org/projects/jdk/22/ -In case yo uare moving directly from jdk21 +Notes on individual issues: +=========================== + +core-libs/java.io:serialization: + +JDK-8367031: [backout] Change java.time month/day field types to 'byte' +======================================================================= +In the initial release of OpenJDK 25, attempting to read serialised +Class objects created by earlier versions of OpenJDK for several of +the `java.time` classes would fail with a +`InvalidClassException`. Similarly, `java.time` Class objects +serialised with OpenJDK 25 could not be read by older OpenJDK +versions. This was due to the type of the day and month fields in +these classes being changed to `byte`. This change has now been +reverted and compatibility between OpenJDK 25 and older versions +restored. + +Note that this incompatibility occurred with the `Class` object and +not an instance of the object i.e. `writeObject(LocalDate.class)` +would produce incompatible serialised data, but +`writeObject(LocalDate.now())` would not. + +security-libs/java.security: + +JDK-8361212: Remove AffirmTrust root CAs +======================================== +The following root certificates from AffirmTrust, which were +deactivated in the 21.0.5 release of October 2024, have been removed +from the `cacerts` keystore: + +Alias name: affirmtrustcommercialca [jdk] +CN=AffirmTrust Commercial +O=AffirmTrust +C=US +SHA256: 03:76:AB:1D:54:C5:F9:80:3C:E4:B2:E2:01:A0:EE:7E:EF:7B:57:B6:36:E8:A9:3C:9B:8D:48:60:C9:6F:5F:A7 + +Alias name: affirmtrustnetworkingca [jdk] +CN=AffirmTrust Networking +O=AffirmTrust +C=US +SHA256: 0A:81:EC:5A:92:97:77:F1:45:90:4A:F3:8D:5D:50:9F:66:B5:E2:C5:8F:CD:B5:31:05:8B:0E:17:F3:F0B4:1B + +Alias name: affirmtrustpremiumca [jdk] +CN=AffirmTrust Premium +O=AffirmTrust +C=US +SHA256: 70:A7:3F:7F:37:6B:60:07:42:48:90:45:34:B1:14:82:D5:BF:0E:69:8E:CC:49:8D:F5:25:77:EB:F2:E9:3B:9A + +Alias name: affirmtrustpremiumeccca [jdk] +CN=AffirmTrust Premium ECC +O=AffirmTrust +C=US +SHA256: BD:71:FD:F6:DA:97:E4:CF:62:D1:64:7A:DD:25:81:B0:7D:79:AD:F8:39:7E:B4:EC:BA:9C:5E:84:88:82:14:23 + +New in release OpenJDK 25.0.0 (2025-09-16): +=========================================== +Major changes are listed below. Some changes may have been backported +to earlier releases following their first appearance in OpenJDK 22 +through to 25. + +NEW FEATURES +============ + +Language Features +================= + +Flexible Constructor Bodies +============================ +https://openjdk.org/jeps/447 +https://openjdk.org/jeps/482 +https://openjdk.org/jeps/492 +https://openjdk.org/jeps/513 + +In constructors in the Java programming language, allow statements to +appear before an explicit constructor invocation, i.e., super(..) or +this(..). The statements cannot reference the instance under +construction, but they can initialize its fields. Initializing fields +before invoking another constructor makes a class more reliable when +methods are overridden. + +This language feature is now finalised (JEP 513). It was first +introduced as a preview language feature +(http://openjdk.java.net/jeps/12) in OpenJDK 22 (JEP 447) under the +name "Statements before super(...)". It reached a second preview in +OpenJDK 23 (JEP 482) with the addition of allowing fields to be +initialized before invoking another constructor. It reached a third +preview in OpenJDK 24 (JEP 492). + +Unnamed Patterns and Variables +============================== +https://openjdk.org/jeps/443 +https://openjdk.org/jeps/456 + +Enhance the Java language with unnamed patterns, which match a record +component without stating the component's name or type, and unnamed +variables, which can be initialized but not used. Both are denoted by +an underscore character, _. + +This feature is now finalised (JEP 456). It was a preview feature +(http://openjdk.java.net/jeps/12) in OpenJDK 21 (JEP 443). + +Primitive Types in Patterns, instanceof, and switch +=================================================== +https://openjdk.org/jeps/455 +https://openjdk.org/jeps/488 +https://openjdk.org/jeps/507 + +Enhance pattern matching by allowing primitive type patterns in all +pattern contexts, and extend instanceof and switch to work with all +primitive types. + +This is a preview language feature (http://openjdk.java.net/jeps/12) +introduced in OpenJDK 23 (JEP 455) with a second preview in OpenJDK 24 +(JEP 488) and reaching a third in OpenJDK 25 (JEP 507). + +Module Import Declarations +========================== +https://openjdk.org/jeps/476 +https://openjdk.org/jeps/494 +https://openjdk.org/jeps/511 + +Enhance the Java programming language with the ability to succinctly +import all of the packages exported by a module. This simplifies the +reuse of modular libraries, but does not require the importing code to +be in a module itself. + +This language feature is now finalised (JEP 511). It was introduced as +a preview language feature (http://openjdk.java.net/jeps/12) in +OpenJDK 23 (JEP 476) and had a second preview in OpenJDK 24 (JEP 494). + +Library Features +================ + +Foreign Function & Memory API +============================= +https://openjdk.org/jeps/412 +https://openjdk.org/jeps/419 +https://openjdk.org/jeps/424 +https://openjdk.org/jeps/434 +https://openjdk.org/jeps/442 +https://openjdk.org/jeps/454 + +Introduce an API by which Java programs can interoperate with code and +data outside of the Java runtime. By efficiently invoking foreign +functions (i.e., code outside the JVM), and by safely accessing +foreign memory (i.e., memory not managed by the JVM), the API enables +Java programs to call native libraries and process native data without +the brittleness and danger of JNI. + +This API is now finalised (JEP 454). It was first introduced in +incubation (https://openjdk.java.net/jeps/11) in OpenJDK 17 (JEP 412), +and is an evolution of the Foreign Memory Access API (OpenJDK 14 +through 16) and Foreign Linker API (OpenJDK 16) (see release notes for +java-17-openjdk). OpenJDK 18 saw a second round of incubation (JEP +419) before its inclusion as a preview feature +(http://openjdk.java.net/jeps/12) in OpenJDK 19 (JEP 424). A second +preview took place in OpenJDK 20 (JEP 434) and a third and final +preview in OpenJDK 21 (JEP 442). + +Prepare to Restrict the Use of JNI +================================== +https://openjdk.org/jeps/472 + +Issue warnings about uses of the Java Native Interface (JNI) and +adjust the Foreign Function & Memory (FFM) API to issue warnings in a +consistent manner. All such warnings aim to prepare developers for a +future release that ensures integrity by default by uniformly +restricting JNI and the FFM API. Application developers can avoid both +current warnings and future restrictions by selectively enabling these +interfaces where essential using the --enable-native-access +command-line option. + +Class-File API +============== +https://openjdk.org/jeps/457 +https://openjdk.org/jeps/466 +https://openjdk.org/jeps/484 + +Provide a standard API for parsing, generating, and transforming Java +class files. + +This API is now finalised (JEP 484). It was introduced as a preview +library feature (http://openjdk.java.net/jeps/12) in OpenJDK 22 (JEP +457) with a second preview in OpenJDK 23 (JEP 466). + +Vector API +========== +https://openjdk.org/jeps/338 +https://openjdk.org/jeps/414 +https://openjdk.org/jeps/417 +https://openjdk.org/jeps/426 +https://openjdk.org/jeps/438 +https://openjdk.org/jeps/448 +https://openjdk.org/jeps/460 +https://openjdk.org/jeps/469 +https://openjdk.org/jeps/489 +https://openjdk.org/jeps/508 + +Introduce an API to express vector computations that reliably compile +at runtime to optimal vector hardware instructions on supported CPU +architectures and thus achieve superior performance to equivalent +scalar computations. + +This is an incubation feature (https://openjdk.java.net/jeps/11) +introduced in OpenJDK 16 (JEP 338). A second round of incubation took +place in OpenJDK 17 (JEP 414), OpenJDK 18 (JEP 417) saw a third, +OpenJDK 19 a fourth (JEP 426), OpenJDK 20 (JEP 438) a fifth, OpenJDK +21 a sixth (JEP 448), OpenJDK 22 a seventh (JEP 460), OpenJDK 23 an +eighth (JEP 469), OpenJDK 24 a ninth (JEP 489) and it reaches its +tenth in OpenJDK 25 (JEP 508). + +Stream Gatherers +================ +https://openjdk.org/jeps/461 +https://openjdk.org/jeps/473 +https://openjdk.org/jeps/485 + +Enhance the Stream API to support custom intermediate operations. This +will allow stream pipelines to transform data in ways that are not +easily achievable with the existing built-in intermediate operations. + +This API is now finalised (JEP 485). It was introduced as a preview +library feature (http://openjdk.java.net/jeps/12) in OpenJDK 22 (JEP +461) with a second preview in OpenJDK 23 (JEP 473). + +Structured Concurrency +====================== +https://openjdk.org/jeps/428 +https://openjdk.org/jeps/437 +https://openjdk.org/jeps/453 +https://openjdk.org/jeps/462 +https://openjdk.org/jeps/480 +https://openjdk.org/jeps/499 +https://openjdk.org/jeps/505 + +Simplify multithreaded programming by introducing an API for +structured concurrency. Structured concurrency treats multiple tasks +running in different threads as a single unit of work, thereby +streamlining error handling and cancellation, improving reliability, +and enhancing observability. + +This API was first introduced in incubation +(https://openjdk.java.net/jeps/11) in OpenJDK 19 (JEP 428) and had a +second round of incubation in OpenJDK 20 (JEP 437). It became a +preview feature (http://openjdk.java.net/jeps/12) in OpenJDK 21 (JEP +453), reached its second preview in OpenJDK 22 (JEP 462), had a third +preview in OpenJDK 23 (JEP 480), a fourth in OpenJDK 24 (JEP 499) and +reaches its fifth in OpenJDK 25 (JEP 505). + +Compact Source Files and Instance Main Methods +============================================== +https://openjdk.org/jeps/445 +https://openjdk.org/jeps/463 +https://openjdk.org/jeps/477 +https://openjdk.org/jeps/495 +https://openjdk.org/jeps/512 + +Evolve the Java programming language so that beginners can write their +first programs without needing to understand language features +designed for large programs. Far from using a separate dialect of the +language, beginners can write streamlined declarations for +single-class programs and then seamlessly expand their programs to use +more advanced features as their skills grow. Experienced developers +can likewise enjoy writing small programs succinctly, without the need +for constructs intended for programming in the large. + +This library feature is now finalised (JEP 512) with some minor +changes from the last release. It was first introduced as a preview +(http://openjdk.java.net/jeps/12) in OpenJDK 21 (JEP 445) under the +name "Unnamed Classes and Instance Main Methods". It reached a second +preview in OpenJDK 22 (JEP 463) and a third in OpenJDK 23 (JEP 477) +under the new name, "Implicitly Declared Classes and Instance Main +Methods", due to the move away from unnamed classes to an implicitly +declared name chosen by the host system. It had a fourth preview in +OpenJDK 24 (JEP 495) with new terminology and a revised title ("Simple +Source Files and Instance Main Methods"), but otherwise unchanged. + +Scoped Values +============= +https://openjdk.org/jeps/429 +https://openjdk.org/jeps/446 +https://openjdk.org/jeps/464 +https://openjdk.org/jeps/481 +https://openjdk.org/jeps/487 +https://openjdk.org/jeps/506 + +Introduce scoped values, which enable the sharing of immutable data +within and across threads. They are preferred to thread-local +variables, especially when using large numbers of virtual threads. + +This API is now finalised (JEP 506). This API was first introduced in +incubation (https://openjdk.java.net/jeps/11) in OpenJDK 20 (JEP +429). It became a preview feature (http://openjdk.java.net/jeps/12) in +OpenJDK 21 (JEP 446), had a second preview in OpenJDK 22 (JEP 464), a +third in OpenJDK 23 (JEP 481) and a fourth in OpenJDK 24 (JEP 487). + +Key Derivation Function API +=========================== +https://openjdk.org/jeps/478 +https://openjdk.org/jeps/510 + +Introduce an API for Key Derivation Functions (KDFs), which are +cryptographic algorithms for deriving additional keys from a secret +key and other data. + +This API is now finalised (JEP 510). It was first introduced as a +preview library feature (http://openjdk.java.net/jeps/12) in OpenJDK +24 (JEP 478). + +Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism +================================================================== +https://openjdk.org/jeps/496 + +Enhance the security of Java applications by providing an +implementation of the quantum-resistant Module-Lattice-Based +Key-Encapsulation Mechanism (ML-KEM). Key encapsulation mechanisms +(KEMs) are used to secure symmetric keys over insecure communication +channels using public key cryptography. ML-KEM is designed to be +secure against future quantum computing attacks. It has been +standardized by the United States National Institute of Standards and +Technology (NIST) in FIPS 203 [0]. + +[0] https://csrc.nist.gov/pubs/fips/203/final + +Quantum-Resistant Module-Lattice-Based Digital Signature Algorithm +================================================================== +https://openjdk.org/jeps/497 + +Enhance the security of Java applications by providing an +implementation of the quantum-resistant Module-Lattice-Based Digital +Signature Algorithm (ML-DSA). Digital signatures are used to detect +unauthorized modifications to data and to authenticate the identity of +signatories. ML-DSA is designed to be secure against future quantum +computing attacks. It has been standardized by the United States +National Institute of Standards and Technology (NIST) in FIPS 204 [0]. + +[0] https://csrc.nist.gov/pubs/fips/204/final + +PEM Encodings of Cryptographic Objects +====================================== +https://openjdk.org/jeps/470 + +Introduce an API for encoding objects that represent cryptographic +keys, certificates, and certificate revocation lists into the +widely-used Privacy-Enhanced Mail (PEM) transport format, and for +decoding from that format back into objects. + +This is a preview library feature (http://openjdk.java.net/jeps/12) +introduced in OpenJDK 25 (JEP 470). + +Stable Values +============= +https://openjdk.org/jeps/502 + +Introduce an API for stable values, which are objects that hold +immutable data. Stable values are treated as constants by the JVM, +enabling the same performance optimizations that are enabled by +declaring a field final. Compared to final fields, however, stable +values offer greater flexibility as to the timing of their +initialization. + +This is a preview library feature (http://openjdk.java.net/jeps/12) +introduced in OpenJDK 25 (JEP 502). + +Virtual Machine Enhancements +============================ + +Region Pinning for G1 +===================== +https://openjdk.org/jeps/423 + +Reduce latency by implementing region pinning in G1, so that garbage +collection need not be disabled during Java Native Interface (JNI) +critical regions. + +ZGC: Generational Mode by Default +================================= +https://openjdk.org/jeps/439 +https://openjdk.org/jeps/474 + +Switch the default mode of the Z Garbage Collector (ZGC) to the +generational mode. Deprecate the non-generational mode, with the +intent to remove it in a future release. + +Late Barrier Expansion for G1 +============================= +https://openjdk.org/jeps/475 + +Simplify the implementation of the G1 garbage collector's barriers, +which record information about application memory accesses, by +shifting their expansion from early in the C2 JIT's compilation +pipeline to later. + +Ahead-of-Time Class Loading & Linking +===================================== +https://openjdk.org/jeps/483 +https://openjdk.org/jeps/514 + +Improve startup time by making the classes of an application instantly +available, in a loaded and linked state, when the HotSpot Java Virtual +Machine starts. Achieve this by monitoring the application during one +run and storing the loaded and linked forms of all classes in a cache +for use in subsequent runs. Lay a foundation for future improvements +to both startup and warmup time. + +Using this feature requires a two stage process: + +1. Create the Ahead-of-Time cache from a training run of the +application using the option `--XX:AOTCacheOutput=` where +`` is the cache reference to use in later runs. + +2. When running the application in testing or production, use the +option `-XX:AOTCache=` to run the application with the +cache generated in #2. + +Previously, in OpenJDK 24 (JEP 483), the training run and cache +creation were handled by two separate steps: + +1. Populate the Ahead-of-Time configuration data with a training run +of the application using the options `-XX:AOTMode=record +-XX:AOTConfiguration=` where `` is the +configuration reference to use in #2. + +2. Create the Ahead-of-Time cache using the options +`-XX:AOTMode=create -XX:AOTConfiguration= +-XX:AOTCache=` where `` is the configuration +reference from #1 and `` is the cache reference to use in +later runs. + +JEP 514 ("Ahead-of-Time Command-Line Ergonomics") in OpenJDK 25 adds +the option `--XX:AOTCacheOutput` which performs both the above steps +from a single command-line invocation using a temporary configuration +file. A new environment variable, `JDK_AOT_VM_OPTIONS`, can be used +to pass options to the cache creation step without affecting the +training run step. + +Ahead-of-Time Method Profiling +============================== +https://openjdk.org/jeps/515 + +Improve warmup time by making method-execution profiles from a +previous run of an application instantly available, when the HotSpot +Java Virtual Machine starts. This will enable the JIT compiler to +generate native code immediately upon application startup, rather than +having to wait for profiles to be collected. + +Synchronize Virtual Threads without Pinning +=========================================== +https://openjdk.org/jeps/491 + +Improve the scalability of Java code that uses synchronized methods +and statements by arranging for virtual threads that block in such +constructs to release their underlying platform threads for use by +other virtual threads. This will eliminate nearly all cases of virtual +threads being pinned to platform threads, which severely restricts the +number of virtual threads available to handle an application's +workload. + +Compact Object Headers +====================== +https://openjdk.org/jeps/450 +https://openjdk.org/jeps/519 + +Reduce the size of object headers in the HotSpot JVM from between 96 +and 128 bits down to 64 bits on 64-bit architectures. This will reduce +heap size, improve deployment density, and increase data locality. + +This is now a production feature in OpenJDK 25 (JEP 519) enabled using +`-XX:+UseCompactObjectHeaders`. It was first introduced as an +experimental feature (JEP 450) that also required the use of +`-XX:+UnlockExperimentalVMOptions`. + +Generational Shenandoah +======================= +https://openjdk.org/jeps/404 +https://openjdk.org/jeps/521 + +Enhance the Shenandoah garbage collector with experimental +generational collection capabilities to improve sustainable +throughput, load-spike resilience, and memory utilization. + +This is now a production feature in OpenJDK 25 (JEP 521) enabled using +`-XX:ShenandoahGCMode=generational`. It was first introduced as an +experimental feature (JEP 404) that also required the use of +`-XX:+UnlockExperimentalVMOptions`. + +JFR Cooperative Sampling +======================== +https://openjdk.org/jeps/518 + +Improve the stability of the JDK Flight Recorder (JFR) when it +asynchronously samples Java thread stacks. Achieve this by walking +call stacks only at safepoints, while minimizing safepoint bias. + +JFR Method Timing & Tracing +=========================== +https://openjdk.org/jeps/520 + +Extend the JDK Flight Recorder (JFR) with facilities for method timing +and tracing via bytecode instrumentation. + +JFR CPU-Time Profiling +====================== +https://openjdk.org/jeps/509 + +Enhance the JDK Flight Recorder (JFR) to capture more accurate +CPU-time profiling information on Linux. + +This is an experimental feature so its JFR events are tagged with the +`@Experimental` annotation. Unlike other experimental virtual machine +features, it does not need to be explicitly enabled with +`-XX:+UnlockExperimentalVMOptions`. + +Tools +===== + +Launch Multi-File Source-Code Programs +====================================== +https://openjdk.org/jeps/458 + +Enhance the java application launcher to be able to run a program +supplied as multiple files of Java source code. This will make the +transition from small programs to larger ones more gradual, enabling +developers to choose whether and when to go to the trouble of +configuring a build tool. + +Markdown Documentation Comments +=============================== +https://openjdk.org/jeps/467 + +Enable JavaDoc documentation comments to be written in Markdown rather +than solely in a mixture of HTML and JavaDoc @-tags. + +Linking Run-Time Images without JMODs +===================================== +https://openjdk.org/jeps/493 + +Reduce the size of the JDK by approximately 25% by enabling the jlink +tool to create custom run-time images without using the JDK's JMOD +files. + +This feature must be enabled when the JDK is built using the +--enable-linkable-runtime option. It will not be enabled by default, +and some JDK vendors may choose not to enable it. + +DEPRECATIONS +============ + +Deprecate the Memory-Access Methods in sun.misc.Unsafe for Removal +================================================================== +https://openjdk.org/jeps/471 + +Deprecate the memory-access methods in sun.misc.Unsafe for removal in +a future release. These unsupported methods have been superseded by +standard APIs, namely the VarHandle API (JEP 193, OpenJDK 9) and the +Foreign Function & Memory API (JEP 454, OpenJDK 22). We strongly +encourage library developers to migrate from sun.misc.Unsafe to +supported replacements, so that applications can migrate smoothly to +modern JDK releases. + +Warn upon Use of Memory-Access Methods in sun.misc.Unsafe +========================================================= +https://openjdk.org/jeps/498 + +Issue a warning at run time on the first occasion that any +memory-access method in sun.misc.Unsafe is invoked. All of these +unsupported methods were terminally deprecated in JDK 23 (see JEP 471 +above). They have been superseded by standard APIs, namely the +VarHandle API (JEP 193, OpenJDK 9) and the Foreign Function & Memory +API (JEP 454, OpenJDK 22). We strongly encourage library developers to +migrate from sun.misc.Unsafe to supported replacements, so that +applications can migrate smoothly to modern JDK releases. + +Permanently Disable the Security Manager +======================================== +https://openjdk.org/jeps/486 + +The Security Manager has not been the primary means of securing +client-side Java code for many years, it has rarely been used to +secure server-side code, and it is costly to maintain. We therefore +deprecated it for removal in OpenJDK 17 via JEP 411 (2021). As the +next step toward removing the Security Manager, we will revise the +Java Platform specification so that developers cannot enable it and +other Platform classes do not refer to it. This change will have no +impact on the vast majority of applications, libraries, and tools. We +will remove the Security Manager API in a future release. + +REMOVALS +======== + +String Templates +================ +https://openjdk.org/jeps/430 +https://openjdk.org/jeps/459 +https://openjdk.org/jeps/465 + +This was a preview feature (http://openjdk.java.net/jeps/12) +introduced in OpenJDK 21 (JEP 430) with a second preview in OpenJDK 22 +(JEP 459). A third preview was proposed but ultimately withdrawn for +OpenJDK 23 (JEP 465) and the feature is no longer present. See [0] +for further explanation. + +[0] https://mail.openjdk.org/pipermail/amber-spec-experts/2024-April/004106.html + +Remove the Windows & Linux 32-bit x86 Ports +=========================================== +https://openjdk.org/jeps/449 +https://openjdk.org/jeps/479 +https://openjdk.org/jeps/501 +https://openjdk.org/jeps/503 + +Remove the source code and build support for the Windows (JEP 479) & +Linux (JEP 503) 32-bit x86 ports. The Windows port was deprecated for +removal in JDK 21 by JEP 449 and the Linux port was deprecated for +removal in JDK 24 by JEP 501. Both deprecations took place with the +express intent to remove the ports in a future release. + +Following this removal of these 32-bit x86 ports, the +architecture-agnostic Zero port is the only way to run Java programs +on 32-bit x86 processors. + +ZGC: Remove the Non-Generational Mode +===================================== +https://openjdk.org/jeps/439 +https://openjdk.org/jeps/474 +https://openjdk.org/jeps/490 + +Remove the non-generational mode of the Z Garbage Collector (ZGC), +keeping the generational mode as the default for ZGC (see JEP 439 & +474). diff --git a/TestTranslations.java b/TestTranslations.java index f6a4fe2..1b02c06 100644 --- a/TestTranslations.java +++ b/TestTranslations.java @@ -50,11 +50,11 @@ public class TestTranslations { "Mountain Daylight Time", "MDT", "MDT", "Mountain Time", "MT", "MT"}); map.put(Locale.FRANCE, new String[] { "heure normale des Rocheuses", "UTC\u221207:00", "MST", - "heure d\u2019\u00e9t\u00e9 des Rocheuses", "UTC\u221206:00", "MDT", - "heure des Rocheuses", "UTC\u221207:00", "MT"}); - map.put(Locale.GERMANY, new String[] { "Rocky-Mountain-Normalzeit", "GMT-07:00", "MST", - "Rocky-Mountain-Sommerzeit", "GMT-06:00", "MDT", - "Rocky-Mountain-Zeit", "GMT-07:00", "MT"}); + "heure d\u2019\u00e9t\u00e9 des Rocheuses", "UTC\u221206:00", "MST", + "heure des Rocheuses", "UTC\u221207:00", "MST"}); + map.put(Locale.GERMANY, new String[] { "Rocky-Mountains-Normalzeit", "GMT-07:00", "MST", + "Rocky-Mountains-Sommerzeit", "GMT-06:00", "MST", + "Rocky-Mountains-Zeit", "GMT-07:00", "MST"}); CIUDAD_JUAREZ = Collections.unmodifiableMap(map); } @@ -97,14 +97,10 @@ public class TestTranslations { System.out.printf("Checking locale %s for %s...\n", l, id); - if ("JRE".equals(localeProvider)) { + if ("JRE".equals(localeProvider) || "CLDR".equals(localeProvider)) { expectedShortStd = expected[2]; expectedShortDST = expected[5]; expectedShortGen = expected[8]; - } else if ("CLDR".equals(localeProvider)) { - expectedShortStd = expected[1]; - expectedShortDST = expected[4]; - expectedShortGen = expected[7]; } else { System.err.printf("Invalid locale provider %s\n", localeProvider); System.exit(3); diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 213f7b4..7b48c3d 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -1,10 +1,5 @@ -%if (0%{?rhel} > 0 && 0%{?rhel} < 8) -# portable jdk 17 specific bug, _jvmdir being missing -%define _jvmdir /usr/lib/jvm -%endif - # debug_package %%{nil} is portable-jdks specific -%define debug_package %{nil} +%define debug_package %{nil} # RPM conditionals so as to be able to dynamically produce # slowdebug/release builds. See: @@ -65,6 +60,10 @@ # See: https://bugzilla.redhat.com/show_bug.cgi?id=1520879 %global _find_debuginfo_opts -g +# Disable LTO as this causes build failures at the moment. +# See RHBZ#1861401 +%define _lto_cflags %{nil} + # note: parametrized macros are order-sensitive (unlike not-parametrized) even with normal macros # also necessary when passing it as parameter to other macros. If not macro, then it is considered a switch # see the difference between global and define: @@ -160,6 +159,8 @@ %else %global gdb_arches %{jit_arches} %{zero_arches} %endif +# Architecture on which we run Java only tests +%global jdk_test_arch x86_64 # By default, we build a slowdebug build during main build on JIT architectures %if %{with slowdebug} @@ -243,29 +244,83 @@ # Target to use to just build HotSpot %global hotspot_target hotspot -# When building on older systems, we need system, or self build legacy toolchains of explicit version -%if ((0%{?rhel} > 0 && 0%{?rhel} < 8)) || ((0%{?epel} > 0 && 0%{?epel} < 9)) -%global is_dtstoolchain 1 + +# Individual build frameworks this specfile supports +# if elif ... elif ... elif ... else is unluckily buggy +# On rhel7 we need software collection +%if (0%{?rhel} == 7) +%global is_dtstoolchain collection +%global dtsversion 10 +%global dtsname devtoolset-%{dtsversion} +%global dts_command scl enable %{dtsname} -- +%global exclusive_arches %{nil} +%define dts_brs # Brs for collection\ +BuildRequires: %{dtsname}-gcc \ +BuildRequires: %{dtsname}-gcc-c++ %else -%global is_dtstoolchain 0 +# On rhel8 we have self built custom devkit +%if ((0%{?rhel} == 8) && (0%{?epel} == 0)) +%global is_dtstoolchain devkit +%global dtsversion 1.0-9 +%global dtsname %{origin}-devkit +%global dts_command %{nil} +%if 0%{?centos} == 0 +# centos had originally smaller set of devkit arches +%global exclusive_arches %{aarch64} %{ppc64le} s390x x86_64 riscv64 +%else +%global exclusive_arches %{aarch64} %{ppc64le} s390x x86_64 riscv64 +%endif +%define dts_brs # Brs for devkit\ +BuildRequires: %{dtsname} >= %{dtsversion} +%else +# On newest systems we use system gcc and friens +%if ((0%{?fedora} > 0) || (0%{?rhel} >= 9) || (0%{?epel} >= 9)) +%global is_dtstoolchain system +%global dtsversion %{nil} +%global dtsname %{nil} +%global exclusive_arches %{java_arches} +%define dts_brs # Brs for system\ +BuildRequires: gcc >= 4.8.3-8 \ +BuildRequires: gcc-c++ \ +# We link statically against libstdc++ to increase portability \ +BuildRequires: libstdc++-static +# When building on epel8, we need system, legacy toolchain of explicit version +%else +%if ((0%{?epel}) > 0 && (0%{?epel} <= 8)) +%global is_dtstoolchain toolset +%global dtsversion 14 +%global dtsname gcc-toolset-%{dtsversion} +%global exclusive_arches %{java_arches} +%define dts_brs # Brs for toolset\ +BuildRequires: %{dtsname}-gcc \ +BuildRequires: %{dtsname}-gcc-c++ \ +BuildRequires: %{dtsname}-annobin-annocheck \ +BuildRequires: %{dtsname}-annobin-plugin-gcc \ +BuildRequires: %{dtsname}-binutils \ +BuildRequires: %{dtsname}-gcc-plugin-annobin \ +# We link statically against libstdc++ to increase portability \ +BuildRequires: libstdc++-static +# no go +%else +"Unsupported system: fedora=0%{?fedora} rhel=0%{?rhel} epel=0%{?epel} centos=0%{?centos}" +exit 1 %endif -%if ((0%{?rhel} > 0 && 0%{?rhel} < 8)) -# DTS toolset to use to provide gcc & binutils -%global dtsversion 10 -%global dtsname devtoolset %endif -%if ((0%{?epel} > 0 && 0%{?epel} < 9)) -# GCC toolset to use to provide gcc & binutils -%global dtsversion 14 -%global dtsname gcc-toolset %endif -%if %{is_dtstoolchain} -%global dtsid %{dtsname}-%{dtsversion} %endif -# Disable LTO as this causes build failures at the moment. -# See RHBZ#1861401 -%define _lto_cflags %{nil} +%if ((0%{?epel}) > 0 || (0%{?fedora} > 8)) +%global use_portable_bootjdk 0 +%else +%global use_portable_bootjdk 1 +%endif + +# Check if pandoc is available to generate docs (including man pages) +%if 0%{?rhel} == 8 || 0%{?epel} > 0 || 0%{?fedora} > 0 +%global pandoc_available 1 +%else +%global pandoc_available 0 +%endif # Filter out flags from the optflags macro that cause problems with the OpenJDK build # We filter out -O flags so that the optimization of HotSpot is not lowered from O3 to O2 @@ -340,12 +395,10 @@ %global stapinstall %{nil} %endif +# on fedora and epel, we build systemtap in repacking to rpms +# thus having it disabled, and keeping the lines just for sync reasons %ifarch %{systemtap_arches} -%if (0%{?rhel} > 0 && !0%{?epel}) -%global with_systemtap 1 -%else %global with_systemtap 0 -%endif %else %global with_systemtap 0 %endif @@ -368,16 +421,6 @@ %global lts_designator "" %global lts_designator_zip "" %endif -# JDK to use for bootstrapping -%global bootjdk /usr/lib/jvm/java-latest-openjdk -# Define whether to use the bootstrap JDK directly or with a fresh libjvm.so -# This will only work where the bootstrap JDK is the same major version -# as the JDK being built -%if %{with fresh_libjvm} && %{buildjdkver} == %{featurever} -%global build_hotspot_first 1 -%else -%global build_hotspot_first 0 -%endif # Define vendor information used by OpenJDK %global oj_vendor Red Hat, Inc. @@ -403,6 +446,7 @@ # Define IcedTea version used for SystemTap tapsets and desktop file %global icedteaver 6.0.0pre00-c848b93a8598 # Define current Git revision for the FIPS support patches +%global fipsver 9203d50836c # Define JDK versions %global newjavaver %{featurever}.%{interimver}.%{updatever}.%{patchver} %global javaver %{featurever} @@ -417,7 +461,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 8 -%global rpmrelease 1 +%global rpmrelease 2 #%%global tagsuffix %%{nil} # 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 @@ -469,11 +513,16 @@ %define uniquesuffix() %{expand:%{fullversion}.%{_arch}%{?1}} # portable only declarations %global jreimage jre -%define jreportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.jre;g" | sed "s;openjdkportable;el;g") -%define jdkportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.jdk;g" | sed "s;openjdkportable;el;g") -%define jdkportablesourcesnameimpl() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.sources;g" | sed "s;openjdkportable;el;g" | sed "s;.%{_arch};.noarch;g") -%define staticlibsportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.static-libs;g" | sed "s;openjdkportable;el;g") -%define jmodsportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable%{1}.jmods;g" | sed "s;openjdkportable;el;g") +%if ((0%{?fedora} > 0) || (0%{?epel} > 0)) +%define regexBase %{version}-%{release} +%else +%define regexBase el%{rhel}\\(_[0-9]\\)* +%endif +%define jreportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;%{regexBase};\\0.portable%{1}.jre;g" | sed "s;openjdkportable;el;g") +%define jdkportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;%{regexBase};\\0.portable%{1}.jdk;g" | sed "s;openjdkportable;el;g") +%define jdkportablesourcesnameimpl() %(echo %{uniquesuffix ""} | sed "s;%{regexBase};\\0.portable%{1}.sources;g" | sed "s;openjdkportable;el;g" | sed "s;.%{_arch};.noarch;g") +%define staticlibsportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;%{regexBase};\\0.portable%{1}.static-libs;g" | sed "s;openjdkportable;el;g") +%define jmodsportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;%{regexBase};\\0.portable%{1}.jmods;g" | sed "s;openjdkportable;el;g") %define jreportablearchive() %{expand:%{jreportablenameimpl -- %%{1}}.tar.xz} %define jdkportablearchive() %{expand:%{jdkportablenameimpl -- %%{1}}.tar.xz} %define jdkportablesourcesarchive() %{expand:%{jdkportablesourcesnameimpl -- %%{1}}.tar.xz} @@ -485,9 +534,9 @@ # Intentionally use jdkportablenameimpl here since we want to have static-libs files overlayed on # top of the JDK archive %define staticlibsportablename() %{expand:%{jdkportablenameimpl -- %%{1}}} -%define docportablename() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable.docs;g" | sed "s;openjdkportable;el;g") +%define docportablename() %(echo %{uniquesuffix ""} | sed "s;%{regexBase};\\0.portable.docs;g" | sed "s;openjdkportable;el;g") %define docportablearchive() %{docportablename}.tar.xz -%define miscportablename() %(echo %{uniquesuffix ""} | sed "s;%{version}-%{release};\\0.portable.misc;g" | sed "s;openjdkportable;el;g") +%define miscportablename() %(echo %{uniquesuffix ""} | sed "s;%{regexBase};\\0.portable.misc;g" | sed "s;openjdkportable;el;g") %define miscportablearchive() %{miscportablename}.tar.xz # RPM 4.19 no longer accept our double percentaged %%{nil} passed to %%{1} @@ -498,6 +547,29 @@ %define staticlibsportablearchiveForFiles() %(echo %{staticlibsportablearchive -- ""}) %define jmodsportablearchiveForFiles() %(echo %{jmodsportablearchive -- ""}) +# JDK to use for bootstrapping +%ifarch %{fastdebug_arches} +%global bootdebugpkg fastdebug +%endif +%if %{use_portable_bootjdk} +%global bootjdkpkg_name java-%{featurever}-%{origin} +%global bootjdkpkg %{bootjdkpkg_name}-portable-devel%{?bootdebugpkg:-%{bootdebugpkg}} >= %{buildjdkver} +%global bootjdkzip %{_jvmdir}/%{bootjdkpkg_name}-*.portable%{?bootdebugpkg:.%{bootdebugpkg}}.jdk.%{_arch}.tar.xz +%global bootjdk %{_builddir}/%{uniquesuffix -- ""}/%{bootjdkpkg_name}.boot +%else +%global bootjdkpkg_name java-latest-openjdk +%global bootjdkpkg %{bootjdkpkg_name}-devel%{?bootdebugpkg:-%{bootdebugpkg}} +%global bootjdk /usr/lib/jvm/%{bootjdkpkg_name}%{?bootdebugpkg:-%{bootdebugpkg}} +%endif +# Define whether to use the bootstrap JDK directly or with a fresh libjvm.so +# This will only work where the bootstrap JDK is the same major version +# as the JDK being built +%if %{with fresh_libjvm} && %{buildjdkver} == %{featurever} +%global build_hotspot_first 1 +%else +%global build_hotspot_first 0 +%endif + ################################################################# # fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349 # https://bugzilla.redhat.com/show_bug.cgi?id=1590796#c14 @@ -547,13 +619,6 @@ %global alternatives_requires %{_sbindir}/alternatives %endif -# x86 is no longer supported -%if 0%{?java_arches:1} -ExclusiveArch: %{java_arches} -%else -ExcludeArch: %{ix86} -%endif - # Portables have no repo (requires/provides), but these are awesome for orientation in spec # Also scriptlets are happily missing and files are handled old fashion # not-duplicated requires/provides/obsoletes for normal/debug packages @@ -579,6 +644,15 @@ ExcludeArch: %{ix86} # this expression, when declared as global, filled component with java-x-vendor portable %define component %(echo %{name} | sed "s;-portable%{?pkgos:-%{pkgos}};;g") +# Define the architectures on which we build +# On RHEL, this should be the architectures with a devkit +%if "%{?exclusive_arches}" == "%{nil}" +# x86 is no longer supported +ExcludeArch: %{ix86} +%else +ExclusiveArch: %{exclusive_arches} +%endif + Name: java-latest-%{origin}-portable%{?pkgos:-%{pkgos}} Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with @@ -663,7 +737,7 @@ Source18: TestTranslations.java # ############################################ # Crypto policy and FIPS support patches -# Patch is generated from the fips-21u tree at https://github.com/rh-openjdk/jdk/tree/fips-21u +# Patch is generated from the fips-25u tree at https://github.com/rh-openjdk/jdk/tree/fips-25u # as follows: git diff %%{vcstag} src make test > fips-21u-$(git show -s --format=%h HEAD).patch # Diff is limited to src and make subdirectories to exclude .github changes # The following list is generated by: @@ -700,6 +774,7 @@ Source18: TestTranslations.java # test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java: fixed jtreg main class # RH1940064: Enable XML Signature provider in FIPS mode # RH2173781: Avoid calling C_GetInfo() too early, before cryptoki is initialized [now part of JDK-8301553 upstream] +# Disabled in latest: Patch1001: fips-%%{featurever}u-%%{fipsver}.patch ############################################# # @@ -735,27 +810,8 @@ BuildRequires: desktop-file-utils BuildRequires: elfutils-devel BuildRequires: file BuildRequires: fontconfig-devel -%if %{is_dtstoolchain} -BuildRequires: %{dtsid}-gcc -BuildRequires: %{dtsid}-gcc-c++ -%endif -%if %{is_dtstoolchain} && "%{?dtsname}" == "gcc-toolset" -# wee need slightly more for gcc-toolset -BuildRequires: %{dtsid}-annobin-annocheck -BuildRequires: %{dtsid}-annobin-plugin-gcc -BuildRequires: %{dtsid}-binutils -BuildRequires: %{dtsid}-gcc-plugin-annobin -%endif -%if ! %{is_dtstoolchain} -# Earlier versions have a bug in tree vectorization on PPC -BuildRequires: gcc >= 4.8.3-8 -BuildRequires: gcc-c++ -%endif +%{dts_brs} BuildRequires: gdb -%if (0%{?rhel} > 0 && 0%{?rhel} < 8) -# rhel7 only, portables only. Rhel8 have gtk3, rpms have runtime recommends of gtk -BuildRequires: gtk2-devel -%endif BuildRequires: libxslt BuildRequires: libX11-devel BuildRequires: libXi-devel @@ -767,7 +823,7 @@ BuildRequires: libXtst-devel # Requirement for setting up nss.fips.cfg BuildRequires: nss-devel # Requirement for system security property test -# N/A for portable. RHEL7 doesn't provide them +# N/A for portable as we don't enable support for them #BuildRequires: crypto-policies BuildRequires: pkgconfig BuildRequires: xorg-x11-proto-devel @@ -775,22 +831,18 @@ BuildRequires: zip # to pack portable tarballs BuildRequires: tar BuildRequires: unzip -%if (0%{?rhel} > 0 && 0%{?rhel} < 8) -BuildRequires: javapackages-tools -BuildRequires: java-%{buildjdkver}-%{origin}%{?pkgos:-%{pkgos}}-devel -%else BuildRequires: javapackages-filesystem -BuildRequires: java-latest-openjdk-devel -%endif +BuildRequires: %{bootjdkpkg} # Zero-assembler build requirement %ifarch %{zero_arches} BuildRequires: libffi-devel %endif # Full documentation build requirements +# pandoc is only available on RHEL/CentOS 8, epels, and fedoras +%if %{pandoc_available} BuildRequires: graphviz BuildRequires: pandoc -# 2023c required as of JDK-8305113 -BuildRequires: tzdata-java >= 2023c +%endif # cacerts build requirement in portable mode BuildRequires: ca-certificates @@ -822,8 +874,6 @@ Provides: bundled(libjpeg) = 6b Provides: bundled(libpng) = 1.6.47 # Version in src/java.base/share/native/libzip/zlib/zlib.h Provides: bundled(zlib) = 1.3.1 -# We link statically against libstdc++ to increase portability -BuildRequires: libstdc++-static %endif # this is always built, also during debug-only build @@ -963,13 +1013,15 @@ The %{origin_nice} %{featurever} full patched sources of portable JDK to build, %prep -echo "Preparing %{oj_vendor_version}" - # Using the echo macro breaks rpmdev-bumpspec, as it parses the first line of stdout :-( +echo "Preparing %{oj_vendor_version}" +echo "System is RHEL=%{?rhel}%{!?rhel:0}, CentOS=%{?centos}%{!?centos:0}, EPEL=%{?epel}%{!?epel:0}, Fedora=%{?fedora}%{!?fedora:0}" +echo "Build JDK version is %{buildjdkver}, bootstrap JDK package is %{bootjdkpkg}" + %if 0%{?_build_cpu:1} echo "CPU: %{_target_cpu}, arch install directory: %{archinstall}, SystemTap install directory: %{_build_cpu}" %else - %{error:Unrecognised architecture %{_build_cpu}} + %{error:Unrecognised architecture %{_target_cpu}} %endif if [ %{include_normal_build} -eq 0 -o %{include_normal_build} -eq 1 ] ; then @@ -996,8 +1048,8 @@ if [ %{include_debug_build} -eq 0 -a %{include_normal_build} -eq 0 -a %{includ fi %if %{with fresh_libjvm} && ! %{build_hotspot_first} -echo "WARNING: The build of a fresh libjvm has been disabled due to a JDK version mismatch" -echo "Build JDK version is %{buildjdkver}, feature JDK version is %{featurever}" +%{warn: The build of a fresh libjvm has been disabled due to a JDK version mismatch} +%{warn: Build JDK version is %{buildjdkver}, feature JDK version is %{featurever}} %endif export XZ_OPT="-T0" @@ -1016,12 +1068,31 @@ sh %{SOURCE12} %{top_level_dir_name} %endif # Patch the JDK +# This syntax is deprecated: +# %%patchN [...] +# and should be replaced with: +# %%patch -PN [...] +# For example: +# %%patch1001 -p1 +# becomes: +# %%patch -P1001 -p1 +# The replacement format suggested by recent (circa Fedora 38) RPM +# deprecation messages: +# %%patch N [...] +# is not backward-compatible with prior (circa RHEL-8) versions of +# rpmbuild. pushd %{top_level_dir_name} # Add crypto policy and FIPS support -# Skipping fips patch whil eit is not ready for jdk22 %%patch -P1001 -p1 -# Patches in need of upstreaming +# Not suitable for latest +#%%patch -P1001 -p1 popd # openjdk +echo "Generating %{alt_java_name} man page" +altjavamanpage=%{top_level_dir_name}/src/java.base/share/man/%{alt_java_name}.md +altjavatext="Hardened java binary recommended for launching untrusted code from the Web e.g. javaws" +sed -r -e 's|([^/.])java([^./])|\1alt-java\2|g' %{top_level_dir_name}/src/java.base/share/man/java.md | \ + sed -e 's|JAVA(|ALT-JAVA(|' | \ + sed -e "s|java - launch a Java application|alt-java - ${altjavatext}|" >> ${altjavamanpage} # The OpenJDK version file includes the current # upstream version information. For some reason, @@ -1040,16 +1111,44 @@ if [ "x${UPSTREAM_EA_DESIGNATOR}" != "x%{ea_designator}" ] ; then echo "WARNING: Designator mismatch"; echo "Spec file is configured for a %{build_type} build with designator '%{ea_designator}'" echo "Upstream version-pre setting is '${UPSTREAM_EA_DESIGNATOR}'"; - #exit 17 + exit 17 fi -# Systemtap is processed in rpms +# Systemtap is processed in rpms on fedoras and epels # Prepare desktop files # Portables do not have desktop integration -%build +# Extract devkit +%if "%{is_dtstoolchain}" == "devkit" + devkittarball=%{_datadir}/%{dtsname}/sdk-%{_target_cpu}-%{_target_os}-gnu*.tar.gz + echo "Extracting devkit ${devkittarball}"; + mkdir devkit; + tar -C devkit --strip-components=1 -xzf ${devkittarball} + DEVKIT_ROOT=$(pwd)/devkit + source ${DEVKIT_ROOT}/devkit.info + echo "Installed ${DEVKIT_NAME} devkit" +%else +%if 0%{?centos} > 0 + echo "No devkit for CentOS %{?centos}" +%else + echo "No devkit for %{_target_cpu} on RHEL %{?rhel}"; +%endif +%endif +%if %{use_portable_bootjdk} + # Extract build JDK + pushd %{_jvmdir} + sha256sum --check %{bootjdkzip}.sha256sum + popd + tar -xJf %{bootjdkzip} + mv java-%{featurever}-openjdk-%{buildjdkver}* %{bootjdk} + # Print release information + echo "Installed boot JDK:" + cat %{bootjdk}/release +%endif + +%build # How many CPU's do we have? export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) export NUM_PROC=${NUM_PROC:-1} @@ -1057,6 +1156,7 @@ export NUM_PROC=${NUM_PROC:-1} # Honor %%_smp_ncpus_max [ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max} %endif +export XZ_OPT="-T0" %ifarch s390x sparc64 alpha %{power64} %{aarch64} riscv64 export ARCH_DATA_MODEL=64 @@ -1080,14 +1180,61 @@ EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-strict-aliasing" EXTRA_CFLAGS="$(echo ${EXTRA_CFLAGS} | sed -e 's|-mstackrealign|-mincoming-stack-boundary=2 -mpreferred-stack-boundary=4|')" EXTRA_CPP_FLAGS="$(echo ${EXTRA_CPP_FLAGS} | sed -e 's|-mstackrealign|-mincoming-stack-boundary=2 -mpreferred-stack-boundary=4|')" %endif +%if "%{is_dtstoolchain}" == "devkit" +# Remove annobin plugin reference which isn't available in the devkit +EXTRA_CFLAGS="$(echo ${EXTRA_CFLAGS} | sed -e 's|-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1||')" +EXTRA_CPP_FLAGS="$(echo ${EXTRA_CPP_FLAGS} | sed -e 's|-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1||')" +# Force DWARF 4 for compatibility +EXTRA_CFLAGS="${EXTRA_CFLAGS} -gdwarf-4" +EXTRA_CPP_FLAGS="${EXTRA_CPP_FLAGS} -gdwarf-4" +%endif + export EXTRA_CFLAGS EXTRA_CPP_FLAGS -echo "Building %{SOURCE11}" -mkdir %{miscinstalloutputdir} -mkdir %{altjavaoutputdir} -gcc ${EXTRA_CFLAGS} -o %{altjavaoutputdir}/%{alt_java_name} %{SOURCE11} - -echo "Building %{newjavaver}-%{buildver}, pre=%{ea_designator}, opt=%{lts_designator}" +# Set modification times (mtimes) of files within JAR files generated +# by the OpenJDK build to a timestamp that is constant across RPM +# rebuilds. OpenJDK provides the --with-source-date configure option +# for this purpose. Potential arguments in the RPM build context are: +# +# A) --with-source-date="${SOURCE_DATE_EPOCH}" +# B) --with-source-date=version +# C) --with-source-date="${OPENJDK_UPSTREAM_TAG_EPOCH}" +# +# Consider Option A. Fedora 38 (rpm-4.18.2) and RHEL-8 (rpm-4.14.3) +# have different support for SOURCE_DATE_EPOCH. To keep +# SOURCE_DATE_EPOCH constant across RPM rebuilds, one could set the +# source_date_epoch_from_changelog macro to 1 on both Fedora 38 and +# RHEL-8. However, on RHEL-8, this results in the RPM build times +# being set to the timestamp of the most recent changelog. This is +# bad for tracing when RPMs were actually built. Fedora 38 supports a +# better behaviour via the introduction of the +# use_source_date_epoch_as_buildtime macro, set to 0 by default. +# There is no way to make this work on RHEL-8 as well though, so +# option A is suboptimal. +# +# Option B uses the value of the DEFAULT_VERSION_DATE field from +# make/conf/version-numbers.conf. DEFAULT_VERSION_DATE represents the +# aspirational eventual JDK general availability (GA) release date. +# When the RPM build occurs prior to GA, generated JAR files will have +# payload mtimes in the future relative to the RPM build time. +# Whereas for tarballs some tools will issue warnings about future +# mtimes, per OPENJDK-2583 apparently this is no problem for Java and +# JAR files. +# +# Option C uses the modification timestamp of files in the source +# tarball. The reproducibility logic in generate_source_tarball.sh +# sets them all to the commit time of the release-tagged OpenJDK +# commit, as archived in the tarball. This timestamp is deterministic +# across RPM rebuilds and is reliably in the past. Any file's mtime +# will do, so use version-numbers.conf's. +# +# Use option B for JAR files, based on the discussion in OPENJDK-2583. +# +# For portable tarballs, use option C (OPENJDK_UPSTREAM_TAG_EPOCH) for +# the modification times of all files in the portable tarballs. Doing +# so eliminates one source of variability across RPM rebuilds. +VERSION_FILE="$(pwd)"/"%{top_level_dir_name}"/make/conf/version-numbers.conf +OPENJDK_UPSTREAM_TAG_EPOCH="$(stat --format=%Y "${VERSION_FILE}")" function buildjdk() { local outputdir=${1} @@ -1096,6 +1243,7 @@ function buildjdk() { local debuglevel=${4} local link_opt=${5} local debug_symbols=${6} + local devkit=${7} local top_dir_abs_src_path=$(pwd)/%{top_level_dir_name} local top_dir_abs_build_path=$(pwd)/${outputdir} @@ -1117,6 +1265,20 @@ function buildjdk() { echo "Using debug_symbols: ${debug_symbols}" echo "Building %{newjavaver}-%{buildver}, pre=%{ea_designator}, opt=%{lts_designator}" +%if "%{is_dtstoolchain}" == "devkit" + LIBPATH="${devkit}/lib:${devkit}/lib64" + echo "Setting library path to ${LIBPATH}" +%else +%if "%{is_dtstoolchain}" == "toolset" + toolset=/opt/rh/%{dtsname}/root/ + LIBPATH="${toolset}/lib:${toolset}/lib64" + echo "Setting library path to ${LIBPATH}" +%else + LIBPATH=${LD_LIBRARY_PATH} + echo "Keeping library path as ${LIBPATH}" +%endif +%endif + mkdir -p ${outputdir} pushd ${outputdir} @@ -1124,16 +1286,17 @@ function buildjdk() { # rather than ${link_opt} as the system versions # are always used in a system_libs build, even # for the static library build -%if %{is_dtstoolchain} - scl enable %{dtsid} -- bash ${top_dir_abs_src_path}/configure \ -%else - bash ${top_dir_abs_src_path}/configure \ -%endif + LD_LIBRARY_PATH=${LIBPATH} \ + %{?dts_command} bash ${top_dir_abs_src_path}/configure \ %ifarch %{zero_arches} --with-jvm-variants=zero \ %endif -%ifarch %{ppc64le} - --with-jobs=1 \ +%if "%{is_dtstoolchain}" == "devkit" + --with-devkit=${devkit} \ +%endif +%if "%{is_dtstoolchain}" == "toolset" + --with-extra-path="/opt/rh/%{dtsname}/root/bin:/opt/rh/%{dtsname}/root/usr/bin" \ + --with-toolchain-path="/opt/rh/%{dtsname}/root/bin:/opt/rh/%{dtsname}/root/usr/bin" \ %endif --with-version-build=%{buildver} \ --with-version-pre="%{ea_designator}" \ @@ -1162,7 +1325,7 @@ function buildjdk() { --with-extra-cflags="$EXTRA_CFLAGS" \ --with-extra-ldflags="%{ourldflags}" \ --with-num-cores="$NUM_PROC" \ - --with-source-date="${SOURCE_DATE_EPOCH}" \ + --with-source-date="version" \ --disable-javac-server \ %ifarch %{zgc_arches} --with-jvm-features=zgc \ @@ -1171,15 +1334,11 @@ function buildjdk() { || ( pwd; cat $(find | grep config.log) && false ) cat spec.gmk -%if %{is_dtstoolchain} - scl enable %{dtsid} -- make \ -%else - make \ -%endif - LOG=trace \ + LD_LIBRARY_PATH=${LIBPATH} \ + %{?dts_command} make LOG=trace \ WARNINGS_ARE_ERRORS="-Wno-error" \ - CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" \ - $maketargets || ( pwd; find ${top_dir_abs_src_path} ${top_dir_abs_build_path} -name "hs_err_pid*.log" | xargs cat && false ) + CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" $maketargets ||\ + ( pwd; find ${top_dir_abs_src_path} ${top_dir_abs_build_path} -name \"hs_err_pid*.log\" | xargs cat && false ) popd } @@ -1206,6 +1365,7 @@ function installjdk() { # legacy-jre-image target does not install any man pages for the JRE # We copy the jdk man directory and then remove pages for binaries that # don't exist in the JRE +%if %{pandoc_available} cp -a ${jdkimagepath}/man ${jreimagepath} for manpage in $(find ${jreimagepath}/man -name '*.1'); do filename=$(basename ${manpage}); @@ -1215,6 +1375,7 @@ function installjdk() { rm -f ${manpage}; fi; done +%endif for imagepath in ${jdkimagepath} ${jreimagepath}; do @@ -1232,13 +1393,6 @@ function installjdk() { # Install local files which are distributed with the JDK install -m 644 %{SOURCE10} ${imagepath} - # Create fake alt-java as a placeholder for future alt-java - pushd ${imagepath} - # add alt-java man page - echo "Hardened java binary recommended for launching untrusted code from the Web e.g. javaws" > man/man1/%{alt_java_name}.1 - cat man/man1/java.1 >> man/man1/%{alt_java_name}.1 - popd - # Print release information cat ${imagepath}/release fi @@ -1260,7 +1414,7 @@ function genchecksum() { function packFullPatchedSources() { srcpackagesdir=`pwd` - tar -cJf ${srcpackagesdir}/%{jdkportablesourcesarchive -- ""} --transform "s|^|%{jdkportablesourcesname -- ""}/|" %{top_level_dir_name} + createtar ${srcpackagesdir}/%{jdkportablesourcesarchive -- ""} --transform "s|^|%{jdkportablesourcesname -- ""}/|" %{top_level_dir_name} genchecksum ${srcpackagesdir}/%{jdkportablesourcesarchive -- ""} } @@ -1286,6 +1440,13 @@ function findgeneratedsources() { popd } +# Create a reproducible tarball in an appropriate way for +# the version of tar in use +function createtar() { + #FIXME, not finished + tar -cJf "$@" +} + function packagejdk() { local imagesdir=$(pwd)/${1}/images local docdir=$(pwd)/${1}/images/docs @@ -1329,13 +1490,13 @@ function packagejdk() { # Release images have external debug symbols if [ "x$suffix" = "x" ] ; then - tar -cJf ${debugarchive} $(find ${jdkname} -name \*.debuginfo) + createtar ${debugarchive} $(find ${jdkname} -name \*.debuginfo) genchecksum ${debugarchive} mkdir ${docname} mv ${docdir} ${docname} mv ${bundledir}/${built_doc_archive} ${docname} - tar -cJf ${docarchive} ${docname} + createtar ${docarchive} ${docname} genchecksum ${docarchive} mkdir ${miscname} @@ -1347,25 +1508,25 @@ function packagejdk() { %endif cp -av ${altjavadir}/%{alt_java_name} ${miscname} cp -avr ${gensources} ${miscname} - tar -cJf ${miscarchive} ${miscname} + createtar ${miscarchive} ${miscname} genchecksum ${miscarchive} fi - tar -cJf ${jmodsarchive} --exclude='**.debuginfo' ${jdkname}/jmods + createtar ${jmodsarchive} --exclude='**.debuginfo' ${jdkname}/jmods genchecksum ${jmodsarchive} rm -rv ${jdkname}/jmods - tar -cJf ${jdkarchive} --exclude='**.debuginfo' ${jdkname} + createtar ${jdkarchive} --exclude='**.debuginfo' ${jdkname} genchecksum ${jdkarchive} - tar -cJf ${jrearchive} --exclude='**.debuginfo' ${jrename} + createtar ${jrearchive} --exclude='**.debuginfo' ${jrename} genchecksum ${jrearchive} %if %{include_staticlibs} # Static libraries (needed for building graal vm with native image) # Tar as overlay. Transform to the JDK name, since we just want to "add" # static libraries to that folder - tar -cJf ${staticarchive} \ + createtar ${staticarchive} \ --transform "s|^%{static_libs_image}/lib/*|${staticname}/lib/static/linux-%{archinstall}/glibc/|" "%{static_libs_image}/lib" genchecksum ${staticarchive} %endif @@ -1381,12 +1542,34 @@ function packagejdk() { packFullPatchedSources +%if "%{is_dtstoolchain}" == "devkit" + DEVKIT_ROOT=$(pwd)/devkit + source ${DEVKIT_ROOT}/devkit.info + GCC="${DEVKIT_TOOLCHAIN_PATH}/gcc --sysroot=${DEVKIT_SYSROOT}" + LIBPATH="${DEVKIT_ROOT}/lib:${DEVKIT_ROOT}/lib64" +%else +%if "%{is_dtstoolchain}" == "toolset" + toolset=/opt/rh/%{dtsname}/root/ + GCC="${toolset}/usr/bin/gcc" + LIBPATH="${toolset}/lib:${toolset}/lib64" +%else + GCC=$(which gcc) +%endif +%endif + +echo "Building %{SOURCE11}" +mkdir %{miscinstalloutputdir} +mkdir %{altjavaoutputdir} +LD_LIBRARY_PATH="${LIBPATH}" ${GCC} ${EXTRA_CFLAGS} -o %{altjavaoutputdir}/%{alt_java_name} %{SOURCE11} + +echo "Building %{newjavaver}-%{buildver}, pre=%{ea_designator}, opt=%{lts_designator}" + %if %{build_hotspot_first} # Build a fresh libjvm.so first and use it to bootstrap echo "Building HotSpot only for the latest libjvm.so" cp -LR --preserve=mode,timestamps %{bootjdk} newboot systemjdk=$(pwd)/newboot - buildjdk build/newboot ${systemjdk} %{hotspot_target} "release" "bundled" "internal" + buildjdk build/newboot ${systemjdk} %{hotspot_target} "release" "bundled" "internal" ${DEVKIT_ROOT} mv build/newboot/jdk/lib/%{vm_variant}/libjvm.so newboot/lib/%{vm_variant} %else systemjdk=%{bootjdk} @@ -1432,14 +1615,14 @@ for suffix in %{build_loop} ; do run_bootstrap=%{bootstrap_build} fi if ${run_bootstrap} ; then - buildjdk ${bootbuilddir} ${systemjdk} "%{bootstrap_targets}" ${debugbuild} ${link_opt} ${debug_symbols} + buildjdk ${bootbuilddir} ${systemjdk} "%{bootstrap_targets}" ${debugbuild} ${link_opt} ${debug_symbols} ${DEVKIT_ROOT} installjdk ${bootbuilddir} ${bootinstalldir} - buildjdk ${builddir} $(pwd)/${bootinstalldir}/images/%{jdkimage} "${maketargets}" ${debugbuild} ${link_opt} ${debug_symbols} + buildjdk ${builddir} $(pwd)/${bootinstalldir}/images/%{jdkimage} "${maketargets}" ${debugbuild} ${link_opt} ${debug_symbols} ${DEVKIT_ROOT} findgeneratedsources ${installdir} ${builddir} $(pwd)/%{top_level_dir_name} installjdk ${builddir} ${installdir} %{!?with_artifacts:rm -rf ${bootinstalldir}} else - buildjdk ${builddir} ${systemjdk} "${maketargets}" ${debugbuild} ${link_opt} ${debug_symbols} + buildjdk ${builddir} ${systemjdk} "${maketargets}" ${debugbuild} ${link_opt} ${debug_symbols} ${DEVKIT_ROOT} findgeneratedsources ${installdir} ${builddir} $(pwd)/%{top_level_dir_name} installjdk ${builddir} ${installdir} fi @@ -1459,7 +1642,7 @@ done # end of release / debug cycle loop # We test debug first as it will give better diagnostics on a crash for suffix in %{build_loop} ; do -# portable builds have static_libs embedded, thus top_dir_abs_main_build_path is same as top_dir_abs_staticlibs_build_path +# portable builds have static_libs embedded, thus top_dir_abs_main_build_path is same as top_dir_abs_staticlibs_build_path top_dir_abs_main_build_path=$(pwd)/%{installoutputdir -- ${suffix}} %if %{include_staticlibs} top_dir_abs_staticlibs_build_path=${top_dir_abs_main_build_path} @@ -1474,51 +1657,91 @@ export JAVA_HOME=${top_dir_abs_main_build_path}/images/%{jdkimage} #sed -i -e "s:^security.useSystemPropertiesFile=.*:security.useSystemPropertiesFile=true:" \ #${JAVA_HOME}/conf/security/java.security +# Set up tools +%if "%{is_dtstoolchain}" == "devkit" + DEVKIT_ROOT=$(pwd)/devkit + source ${DEVKIT_ROOT}/devkit.info + NM="${DEVKIT_TOOLCHAIN_PATH}/nm" +%else + NM=$(which nm) +%endif +# elfutils readelf supports more binaries than binutils version on RHEL 8 +# and debug symbols tests below were designed around this version +READELF=$(which eu-readelf) +# Only native gdb seems to work +# The devkit gdb needs the devkit stdc++ library but then the JVM +# segfaults when this is on the LD_LIBRARY_PATH +GDB=$(which gdb) + # Check Shenandoah is enabled %if %{use_shenandoah_hotspot} $JAVA_HOME/bin/java -XX:+UseShenandoahGC -version %endif -# Check unlimited policy has been used -$JAVA_HOME/bin/javac -d . %{SOURCE13} -$JAVA_HOME/bin/java --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel +# Only test on one architecture (the fastest) for Java only tests +%ifarch %{jdk_test_arch} -# Check ECC is working -$JAVA_HOME/bin/javac -d . %{SOURCE14} -$JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||") + # Check unlimited policy has been used + $JAVA_HOME/bin/javac -d . %{SOURCE13} + $JAVA_HOME/bin/java --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel -# Check system crypto (policy) is deactive and can not be enabled -# Test takes a single argument - true or false - to state whether system -# security properties are enabled or not. -$JAVA_HOME/bin/javac -d . %{SOURCE15} -export PROG=$(echo $(basename %{SOURCE15})|sed "s|\.java||") -export SEC_DEBUG="-Djava.security.debug=properties" -# Specific to portable:System security properties to be off by default -$JAVA_HOME/bin/java ${SEC_DEBUG} ${PROG} false -$JAVA_HOME/bin/java ${SEC_DEBUG} -Djava.security.disableSystemPropertiesFile=false ${PROG} false + # Check ECC is working + $JAVA_HOME/bin/javac -d . %{SOURCE14} + $JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||") -# Check correct vendor values have been set -$JAVA_HOME/bin/javac -d . %{SOURCE16} -$JAVA_HOME/bin/java $(echo $(basename %{SOURCE16})|sed "s|\.java||") "%{oj_vendor}" "%{oj_vendor_url}" "%{oj_vendor_bug_url}" "%{oj_vendor_version}" + # Check system crypto (policy) is deactive and can not be enabled + # Test takes a single argument - true or false - to state whether system + # security properties are enabled or not. + $JAVA_HOME/bin/javac -d . %{SOURCE15} + export PROG=$(echo $(basename %{SOURCE15})|sed "s|\.java||") + export SEC_DEBUG="-Djava.security.debug=properties" + # Specific to portable:System security properties to be off by default + $JAVA_HOME/bin/java ${SEC_DEBUG} ${PROG} false + $JAVA_HOME/bin/java ${SEC_DEBUG} -Djava.security.disableSystemPropertiesFile=false ${PROG} false + + # Check correct vendor values have been set + $JAVA_HOME/bin/javac -d . %{SOURCE16} + $JAVA_HOME/bin/java $(echo $(basename %{SOURCE16})|sed "s|\.java||") "%{oj_vendor}" "%{oj_vendor_url}" "%{oj_vendor_bug_url}" "%{oj_vendor_version}" + +%if ! 0%{?flatpak} + # Check translations are available for new timezones (during flatpak builds, the + # tzdb.dat used by this test is not where the test expects it, so this is + # disabled for flatpak builds) + # Disable test until we are on the latest JDK + $JAVA_HOME/bin/javac -d . %{SOURCE18} + $JAVA_HOME/bin/java $(echo $(basename %{SOURCE18})|sed "s|\.java||") JRE || echo "Fedora is often ahead in timezones, ignoring" + $JAVA_HOME/bin/java -Djava.locale.providers=CLDR $(echo $(basename %{SOURCE18})|sed "s|\.java||") CLDR || echo "Fedora is often ahead in timezones, ignoring" +%endif + + # Check src.zip has all sources. See RHBZ#1130490 + unzip -l $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe' + + # Check class files include useful debugging information + $JAVA_HOME/bin/javap -c -l java.lang.Object | grep "Compiled from" + $JAVA_HOME/bin/javap -c -l java.lang.Object | grep LineNumberTable + $JAVA_HOME/bin/javap -c -l java.lang.Object | grep LocalVariableTable + + # Check generated class files include useful debugging information + $JAVA_HOME/bin/javap -c -l java.nio.ByteBuffer | grep "Compiled from" + $JAVA_HOME/bin/javap -c -l java.nio.ByteBuffer | grep LineNumberTable + $JAVA_HOME/bin/javap -c -l java.nio.ByteBuffer | grep LocalVariableTable + +%else + + # Just run a basic java -version test on other architectures + $JAVA_HOME/bin/java -version + +%endif # Check java launcher has no SSB mitigation -if ! nm $JAVA_HOME/bin/java | grep set_speculation ; then true ; else false; fi +if ! ${NM} $JAVA_HOME/bin/java | grep set_speculation ; then true ; else false; fi # Check alt-java launcher has SSB mitigation on supported architectures # set_speculation function exists in both cases, so check for prctl call %ifarch %{ssbd_arches} -nm %{altjavaoutputdir}/%{alt_java_name} | grep prctl +${NM} %{altjavaoutputdir}/%{alt_java_name} | grep prctl %else -if ! nm %{altjavaoutputdir}/%{alt_java_name} | grep prctl ; then true ; else false; fi -%endif - -%if ! 0%{?flatpak} -# Check translations are available for new timezones (during flatpak builds, the -# tzdb.dat used by this test is not where the test expects it, so this is -# disabled for flatpak builds) -$JAVA_HOME/bin/javac -d . %{SOURCE18} -$JAVA_HOME/bin/java $(echo $(basename %{SOURCE18})|sed "s|\.java||") JRE || echo "FIXME before release!" -$JAVA_HOME/bin/java -Djava.locale.providers=CLDR $(echo $(basename %{SOURCE18})|sed "s|\.java||") CLDR || echo "FIXME before release!" +if ! ${NM} %{altjavaoutputdir}/%{alt_java_name} | grep prctl ; then true ; else false; fi %endif %if %{include_staticlibs} @@ -1526,8 +1749,8 @@ $JAVA_HOME/bin/java -Djava.locale.providers=CLDR $(echo $(basename %{SOURCE18})| export STATIC_LIBS_HOME=${top_dir_abs_staticlibs_build_path}/images/%{static_libs_image} ls -l $STATIC_LIBS_HOME ls -l $STATIC_LIBS_HOME/lib -readelf --debug-dump $STATIC_LIBS_HOME/lib/libnet.a | grep Inet4AddressImpl.c -readelf --debug-dump $STATIC_LIBS_HOME/lib/libnet.a | grep Inet6AddressImpl.c +${READELF} --debug-dump $STATIC_LIBS_HOME/lib/libnet.a | grep Inet4AddressImpl.c +${READELF} --debug-dump $STATIC_LIBS_HOME/lib/libnet.a | grep Inet6AddressImpl.c %endif # Release builds strip the debug symbols into external .debuginfo files @@ -1546,15 +1769,15 @@ do # Test for .debug_* sections in the shared object. This is the main test # Stripped objects will not contain these - eu-readelf -S "$lib" | grep "] .debug_" - test $(eu-readelf -S "$lib" | grep -E "\]\ .debug_(info|abbrev)" | wc --lines) == 2 + ${READELF} -S "$lib" | grep "] .debug_" + test $(${READELF} -S "$lib" | grep -E "\]\ .debug_(info|abbrev)" | wc --lines) == 2 # Test FILE symbols. These will most likely be removed by anything that # manipulates symbol tables because it's generally useless. So a nice test # that nothing has messed with symbols old_IFS="$IFS" IFS=$'\n' - for line in $(eu-readelf -s "$lib" | grep "00000000 0 FILE LOCAL DEFAULT") + for line in $(${READELF} -s "$lib" | grep "00000000 0 FILE LOCAL DEFAULT") do # We expect to see .cpp and .S files, except for architectures like aarch64 and # s390 where we expect .o and .oS files @@ -1564,17 +1787,17 @@ do # If this is the JVM, look for javaCalls.(cpp|o) in FILEs, for extra sanity checking if [ "`basename $lib`" = "libjvm.so" ]; then - eu-readelf -s "$lib" | \ + ${READELF} -s "$lib" | \ grep -E "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" fi # Test that there are no .gnu_debuglink sections pointing to another # debuginfo file. There shouldn't be any debuginfo files, so the link makes # no sense either - eu-readelf -S "$lib" | grep 'gnu' - if eu-readelf -S "$lib" | grep '] .gnu_debuglink' | grep PROGBITS; then + ${READELF} -S "$lib" | grep 'gnu' + if ${READELF} -S "$lib" | grep '] .gnu_debuglink' | grep PROGBITS; then echo "bad .gnu_debuglink section." - eu-readelf -x .gnu_debuglink "$lib" + ${READELF} -x .gnu_debuglink "$lib" false fi fi @@ -1586,7 +1809,7 @@ done # Using line number 1 might cause build problems. See: # https://bugzilla.redhat.com/show_bug.cgi?id=1539664 # https://bugzilla.redhat.com/show_bug.cgi?id=1538767 -gdb -q "$JAVA_HOME/bin/java" < +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +if [ $# -ne 1 ]; then + echo "Usage: $0 openjdk-root-directory" + exit 1 +fi + +JDKROOT=$1 + +if [ ! -d "${JDKROOT}" ] ; then + echo "${JDKROOT} is not a directory."; + exit 2 +fi + +# Work out the OpenJDK version +# OpenJDK >= 10 has its version in the build machinery +# OpenJDK >= 17 stores it in a new location (JDK-8258246) +VERSION_FILE="${JDKROOT}"/make/conf/version-numbers.conf +printf "Checking for %s..." "${VERSION_FILE}"; +if [ ! -f "${VERSION_FILE}" ] ; then + VERSION_FILE="${JDKROOT}"/make/autoconf/version-numbers + echo "Not found; using old version file ${VERSION_FILE}"; +else + echo "found."; +fi +if [ -e "${VERSION_FILE}" ] ; then + openjdk_version=$(grep '^DEFAULT_VERSION_FEATURE' "${VERSION_FILE}" | cut -d '=' -f 2) +elif [ -e "${JDKROOT}"/jdk/src/java.base/share/classes/java/lang/Object.java ] ; then + openjdk_version=9; +elif [ -e "${JDKROOT}"/common/autoconf ] ; then + openjdk_version=8; +else + openjdk_version=7; +fi +echo "OpenJDK version: ${openjdk_version}"; + +# +# Freetype +# +if [ "${openjdk_version}" -gt 8 ] ; then + FREETYPE=src/java.desktop/share/native/libfreetype/include/freetype/freetype.h + ABS_FREETYPE="${JDKROOT}"/"${FREETYPE}" + if [ ! -f "${ABS_FREETYPE}" ]; then + echo "Freetype header not found!" + exit 2 + fi + FREETYPE_VERSION=$(awk '/#define FREETYPE_MAJOR/ {MAJOR=$3} /#define FREETYPE_MINOR/ {MINOR=$3} /#define FREETYPE_PATCH/ {PATCH=$3} END {printf "%s.%s.%s", MAJOR, MINOR, PATCH}' "${ABS_FREETYPE}") +else + echo "No bundled FreeType on ${openjdk_version}"; +fi + +# giflib +if [ "${openjdk_version}" -gt 8 ] ; then + GIFLIB=src/java.desktop/share/native/libsplashscreen/giflib/gif_lib.h +else + GIFLIB=jdk/src/share/native/sun/awt/giflib/gif_lib.h +fi +ABS_GIFLIB="${JDKROOT}"/"${GIFLIB}" +if [ ! -f "${ABS_GIFLIB}" ]; then + echo "giflib header not found!" + exit 3 +fi +GIFLIB_VERSION=$(awk '/#define GIFLIB_MAJOR/ {MAJOR=$3} /#define GIFLIB_MINOR/ {MINOR=$3} /#define GIFLIB_RELEASE/ {PATCH=$3} END {printf "%s.%s.%s", MAJOR, MINOR, PATCH}' "${ABS_GIFLIB}") + +# harfbuzz +if [ "${openjdk_version}" -gt 8 ] ; then + HARFBUZZ=src/java.desktop/share/native/libharfbuzz/hb-version.h + ABS_HARFBUZZ="${JDKROOT}/${HARFBUZZ}" + if [ ! -f "${ABS_HARFBUZZ}" ]; then + echo "HarfBuzz header not found!" + exit 4 + fi + HARFBUZZ_VERSION=$(awk '/#define HB_VERSION_MAJOR/ {MAJOR=$3} /#define HB_VERSION_MINOR/ {MINOR=$3} /#define HB_VERSION_MICRO/ {PATCH=$3} END {printf "%s.%s.%s", MAJOR, MINOR, PATCH}' "${ABS_HARFBUZZ}") +else + echo "No HarfBuzz on ${openjdk_version}"; +fi + +# lcms +if [ "${openjdk_version}" -gt 8 ] ; then + LCMS=src/java.desktop/share/native/liblcms/lcms2.h +else + LCMS=jdk/src/share/native/sun/java2d/cmm/lcms/lcms2.h +fi +ABS_LCMS="${JDKROOT}"/"${LCMS}" +if [ ! -f "${ABS_LCMS}" ]; then + echo "lcms header not found!" + exit 5 +fi +LCMS_VERSION=$(awk '/#define LCMS_VERSION/ { MAJOR=int($3 / 1000); REST=$3 % 1000; MINOR=int(REST / 10); PATCH=REST % 10; } END {printf "%s.%s.%s", MAJOR, MINOR, PATCH}' "${ABS_LCMS}") + +# jpeg +if [ "${openjdk_version}" -gt 8 ] ; then + JPEG=src/java.desktop/share/native/libjavajpeg/jpeglib.h +else + JPEG=jdk/src/share/native/sun/awt/image/jpeg/jpeglib.h +fi +ABS_JPEG="${JDKROOT}"/"${JPEG}" +if [ ! -f "${ABS_JPEG}" ]; then + echo "jpeg header not found!" + exit 6 +fi +JPEG_VERSION=$(awk '/#define JPEG_LIB_VERSION/ { VERSION=$3; MAJOR=int(VERSION / 10); MINOR=VERSION%10; } END {printf "%s%c", MAJOR, (MINOR+96)}' "${ABS_JPEG}") + +# png +if [ "${openjdk_version}" -gt 8 ] ; then + PNG=src/java.desktop/share/native/libsplashscreen/libpng/png.h +else + PNG=jdk/src/share/native/sun/awt/libpng/png.h +fi +ABS_PNG="${JDKROOT}"/"${PNG}" +if [ ! -f "${ABS_PNG}" ]; then + echo "png header not found!" + exit 7 +fi +PNG_VERSION=$(awk '/#define PNG_LIBPNG_VER_STRING/ { VERSION=$3; gsub("\"", "", VERSION) } END {print VERSION}' "${ABS_PNG}") + +# zlib +if [ "${openjdk_version}" -gt 8 ] ; then + ZLIB=src/java.base/share/native/libzip/zlib/zlib.h +else + ZLIB=jdk/src/share/native/java/util/zip/zlib/zlib.h +fi +ABS_ZLIB="${JDKROOT}"/"${ZLIB}" +if [ ! -f "${ABS_ZLIB}" ]; then + echo "zlib header not found!" + exit 8 +fi +ZLIB_VERSION=$(awk '/#define ZLIB_VERSION/ { VERSION=$3; gsub("\"", "", VERSION) } END {print VERSION}' "${ABS_ZLIB}") + +# Print output +printf "\nRPM definitions:\n" +if [ "${openjdk_version}" -gt 8 ] ; then + echo "# Version in ${FREETYPE}" + echo "Provides: bundled(freetype) = ${FREETYPE_VERSION}" +fi +echo "# Version in ${GIFLIB}" +echo "Provides: bundled(giflib) = ${GIFLIB_VERSION}" +if [ "${openjdk_version}" -gt 8 ] ; then + echo "# Version in ${HARFBUZZ}" + echo "Provides: bundled(harfbuzz) = ${HARFBUZZ_VERSION}" +fi +echo "# Version in ${LCMS}" +echo "Provides: bundled(lcms2) = ${LCMS_VERSION}" +echo "# Version in ${JPEG}" +echo "Provides: bundled(libjpeg) = ${JPEG_VERSION}" +echo "# Version in ${PNG}" +echo "Provides: bundled(libpng) = ${PNG_VERSION}" +echo "# Version in ${ZLIB}" +echo "Provides: bundled(zlib) = ${ZLIB_VERSION}" + +# Local Variables: +# compile-command: "shellcheck get_bundle_versions.sh" +# fill-column: 80 +# indent-tabs-mode: nil +# sh-basic-offset: 4 +# End: From d0dccee5d01eef9347d63e8d66f7d83509c83a7f Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 12 Dec 2025 14:29:57 +0100 Subject: [PATCH 84/86] Switch from static-libs-image to static-libs-graal-image to avoid large unneeded libjvm.a --- java-latest-openjdk-portable.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 7b48c3d..ad21f2c 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -228,7 +228,7 @@ # other targets since this target is configured to use in-tree # AWT dependencies: lcms, libjpeg, libpng, libharfbuzz, giflib # and possibly others -%global static_libs_target static-libs-image +%global static_libs_target static-libs-graal-image %else %global static_libs_target %{nil} %endif @@ -500,7 +500,7 @@ exit 1 %global fullversion %{compatiblename}-%{version}-%{release} # images directories from upstream build %global jdkimage jdk -%global static_libs_image static-libs +%global static_libs_image static-libs-graal # output dir stub %define buildoutputdir() %{expand:build/jdk%{featurever}.build%{?1}} %define installoutputdir() %{expand:install/jdk%{featurever}.install%{?1}} From 573c2c7a36a8c78dc44fddfb7b83b32bdad3fce9 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 12 Dec 2025 15:47:22 +0100 Subject: [PATCH 85/86] fipsver df044414ef4 --- fips-25u-df044414ef4.patch | 92 +++++++++++++++++++++++++++++++ java-latest-openjdk-portable.spec | 13 +++-- 2 files changed, 99 insertions(+), 6 deletions(-) create mode 100644 fips-25u-df044414ef4.patch diff --git a/fips-25u-df044414ef4.patch b/fips-25u-df044414ef4.patch new file mode 100644 index 0000000..8b210e6 --- /dev/null +++ b/fips-25u-df044414ef4.patch @@ -0,0 +1,92 @@ +diff --git a/src/java.base/share/classes/java/security/Provider.java b/src/java.base/share/classes/java/security/Provider.java +index de2845fb550..b1e416b90f4 100644 +--- a/src/java.base/share/classes/java/security/Provider.java ++++ b/src/java.base/share/classes/java/security/Provider.java +@@ -1203,6 +1203,39 @@ public Set getServices() { + return serviceSet; + } + ++ /* vvvvvvvvvvvvvvvvvvvvvvvvvvvvv FIPS PATCH vvvvvvvvvvvvvvvvvvvvvvvvvvvvv */ ++ private static final class RedHatFIPSFilter { ++ static final boolean IS_ON = Boolean.parseBoolean( ++ Security.getProperty("__redhat_fips_filter__")); ++ private static final Set ANY_SERVICE_TYPE = Set.of(); ++ private static final Map> ALLOW_LIST = Map.of( ++ "SunPKCS11-FIPS", ANY_SERVICE_TYPE, ++ "SUN", Set.of( ++ "AlgorithmParameterGenerator", ++ "AlgorithmParameters", "CertificateFactory", ++ "CertPathBuilder", "CertPathValidator", "CertStore", ++ "Configuration", "KeyStore"), ++ "SunEC", Set.of( ++ "AlgorithmParameters", "KeyFactory"), ++ "SunJSSE", ANY_SERVICE_TYPE, ++ "SunJCE", Set.of( ++ "AlgorithmParameters", ++ "AlgorithmParameterGenerator", "KeyFactory", ++ "SecretKeyFactory"), ++ "SunRsaSign", Set.of( ++ "KeyFactory", "AlgorithmParameters"), ++ "XMLDSig", ANY_SERVICE_TYPE ++ ); ++ ++ static boolean isAllowed(String provName, String serviceType) { ++ Set allowedServiceTypes = ALLOW_LIST.get(provName); ++ return allowedServiceTypes != null && ++ (allowedServiceTypes == ANY_SERVICE_TYPE || ++ allowedServiceTypes.contains(serviceType)); ++ } ++ } ++ /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FIPS PATCH ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ ++ + /** + * Add a service. If a service of the same type with the same algorithm + * name exists, and it was added using {@link #putService putService()}, +@@ -1231,6 +1264,15 @@ protected void putService(Service s) { + ("service.getProvider() must match this Provider object"); + } + String type = s.getType(); ++ /* vvvvvvvvvvvvvvvvvvvvvvvvvvv FIPS PATCH vvvvvvvvvvvvvvvvvvvvvvvvvvv */ ++ if (RedHatFIPSFilter.IS_ON && !RedHatFIPSFilter.isAllowed(name, type)) { ++ if (debug != null) { ++ debug.println("The previous " + name + ".putService() call " + ++ "was skipped by " + RedHatFIPSFilter.class.getName()); ++ } ++ return; ++ } ++ /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^ FIPS PATCH ^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ + String algorithm = s.getAlgorithm(); + ServiceKey key = new ServiceKey(type, algorithm, true); + implRemoveService(serviceMap.get(key)); +diff --git a/src/java.base/share/classes/java/security/Security.java b/src/java.base/share/classes/java/security/Security.java +index 6969fe8a8e1..4501d5971c4 100644 +--- a/src/java.base/share/classes/java/security/Security.java ++++ b/src/java.base/share/classes/java/security/Security.java +@@ -323,7 +323,27 @@ public Properties getInitialProperties() { + } + + private static void initialize() { ++ /* vvvvvvvvvvvvvvvvvvvvvvvvvvv FIPS PATCH vvvvvvvvvvvvvvvvvvvvvvvvvvv */ ++ /* This 'include'-directives-only magic property is an internal */ ++ /* implementation detail that could (and probably will!) change. */ ++ /* Red Hat customers should NOT rely on this for their own use. */ ++ String fipsKernelFlag = "/proc/sys/crypto/fips_enabled"; ++ boolean fipsModeOn; ++ try (InputStream is = new java.io.FileInputStream(fipsKernelFlag)) { ++ fipsModeOn = is.read() == '1'; ++ } catch (IOException ioe) { ++ fipsModeOn = false; ++ if (sdebug != null) { ++ sdebug.println("Failed to read FIPS kernel file: " + ioe); ++ } ++ } ++ String fipsMagicPropName = "__redhat_fips__"; ++ System.setProperty(fipsMagicPropName, "" + fipsModeOn); ++ /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^ FIPS PATCH ^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ + SecPropLoader.loadAll(); ++ /* vvvvvvvvvvvvvvvvvvvvvvvvvvv FIPS PATCH vvvvvvvvvvvvvvvvvvvvvvvvvvv */ ++ System.clearProperty(fipsMagicPropName); ++ /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^ FIPS PATCH ^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ + initialSecurityProperties = (Properties) props.clone(); + if (sdebug != null) { + for (String key : props.stringPropertyNames()) { diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index ad21f2c..287c7fe 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -446,7 +446,7 @@ exit 1 # Define IcedTea version used for SystemTap tapsets and desktop file %global icedteaver 6.0.0pre00-c848b93a8598 # Define current Git revision for the FIPS support patches -%global fipsver 9203d50836c +%global fipsver df044414ef4 # Define JDK versions %global newjavaver %{featurever}.%{interimver}.%{updatever}.%{patchver} %global javaver %{featurever} @@ -461,7 +461,7 @@ exit 1 %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 8 -%global rpmrelease 2 +%global rpmrelease 3 #%%global tagsuffix %%{nil} # 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 @@ -738,7 +738,7 @@ Source18: TestTranslations.java ############################################ # Crypto policy and FIPS support patches # Patch is generated from the fips-25u tree at https://github.com/rh-openjdk/jdk/tree/fips-25u -# as follows: git diff %%{vcstag} src make test > fips-21u-$(git show -s --format=%h HEAD).patch +# as follows: git diff %%{vcstag} src make test > fips-25u-$(git show -s --format=%h HEAD).patch # Diff is limited to src and make subdirectories to exclude .github changes # The following list is generated by: # git log %%{vcstag}.. --no-merges --format=%s --reverse: @@ -774,7 +774,8 @@ Source18: TestTranslations.java # test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java: fixed jtreg main class # RH1940064: Enable XML Signature provider in FIPS mode # RH2173781: Avoid calling C_GetInfo() too early, before cryptoki is initialized [now part of JDK-8301553 upstream] -# Disabled in latest: Patch1001: fips-%%{featurever}u-%%{fipsver}.patch +# usage in jdk >25 is experimental and may disapear +Patch1001: fips-%{featurever}u-%{fipsver}.patch ############################################# # @@ -1083,8 +1084,8 @@ sh %{SOURCE12} %{top_level_dir_name} # rpmbuild. pushd %{top_level_dir_name} # Add crypto policy and FIPS support -# Not suitable for latest -#%%patch -P1001 -p1 +# usage in jdk >25 is experimental and may disapear +%patch -P1001 -p1 popd # openjdk echo "Generating %{alt_java_name} man page" From 4d483d5093f07dedee7a83edf04a37a58e829009 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 23 Dec 2025 12:44:54 +0100 Subject: [PATCH 86/86] Updated to jdk26 --- .gitignore | 1 + ...1842_broke_native_debugging_on_Linux.patch | 154 ++++++++++++++++++ java-latest-openjdk-portable.spec | 18 +- sources | 2 +- 4 files changed, 167 insertions(+), 8 deletions(-) create mode 100644 JDK-8373246-8351842_broke_native_debugging_on_Linux.patch diff --git a/.gitignore b/.gitignore index c2a5115..1f1fc8c 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,4 @@ /openjdk-jdk-25+36.tar.xz /openjdk-25+36.tar.xz /openjdk-25.0.1+8.tar.xz +/openjdk-26+29-ea.tar.xz diff --git a/JDK-8373246-8351842_broke_native_debugging_on_Linux.patch b/JDK-8373246-8351842_broke_native_debugging_on_Linux.patch new file mode 100644 index 0000000..1f6ca4d --- /dev/null +++ b/JDK-8373246-8351842_broke_native_debugging_on_Linux.patch @@ -0,0 +1,154 @@ +diff --git a/make/Bundles.gmk b/make/Bundles.gmk +index 8161b3b036254..0b324e7e3f3fc 100644 +--- a/make/Bundles.gmk ++++ b/make/Bundles.gmk +@@ -185,77 +185,30 @@ endif + + ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), ) + +- SYMBOLS_EXCLUDE_PATTERN := %.debuginfo %.diz %.map +- +- # There may be files with spaces in the names, so use ShellFindFiles +- # explicitly. ++ # There may be files with spaces in the names, so use ShellFindFiles explicitly. + ALL_JDK_FILES := $(call ShellFindFiles, $(JDK_IMAGE_DIR)) +- ifneq ($(JDK_IMAGE_DIR), $(JDK_SYMBOLS_IMAGE_DIR)) +- ALL_JDK_SYMBOLS_FILES := $(call ShellFindFiles, $(JDK_SYMBOLS_IMAGE_DIR)) +- else +- ALL_JDK_SYMBOLS_FILES := $(ALL_JDK_FILES) +- endif + ifneq ($(JDK_IMAGE_DIR), $(JDK_DEMOS_IMAGE_DIR)) + ALL_JDK_DEMOS_FILES := $(call ShellFindFiles, $(JDK_DEMOS_IMAGE_DIR)) + else + ALL_JDK_DEMOS_FILES := $(ALL_JDK_FILES) + endif + +- # Create special filter rules when dealing with unzipped .dSYM directories on +- # macosx +- ifeq ($(call isTargetOs, macosx), true) +- ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false) +- JDK_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \ +- $(call containing, .dSYM/, $(patsubst $(JDK_IMAGE_DIR)/%, %, \ +- $(ALL_JDK_SYMBOLS_FILES)))) +- endif +- endif +- +- # Create special filter rules when dealing with debug symbols on windows +- ifeq ($(call isTargetOs, windows), true) +- ifeq ($(SHIP_DEBUG_SYMBOLS), ) +- JDK_SYMBOLS_EXCLUDE_PATTERN := %.pdb +- endif +- endif +- + JDK_BUNDLE_FILES := \ + $(filter-out \ +- $(JDK_SYMBOLS_EXCLUDE_PATTERN) \ + $(JDK_EXTRA_EXCLUDES) \ +- $(SYMBOLS_EXCLUDE_PATTERN) \ + $(JDK_IMAGE_HOMEDIR)/demo/% \ + , \ + $(ALL_JDK_FILES) \ + ) + +- JDK_SYMBOLS_BUNDLE_FILES := \ +- $(call FindFiles, $(SYMBOLS_IMAGE_DIR)) ++ JDK_SYMBOLS_BUNDLE_FILES := $(call FindFiles, $(SYMBOLS_IMAGE_DIR)) + + TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_DEMOS_IMAGE_HOMEDIR)/demo/%, \ + $(ALL_JDK_DEMOS_FILES)) + + ALL_JRE_FILES := $(call ShellFindFiles, $(JRE_IMAGE_DIR)) + +- # Create special filter rules when dealing with unzipped .dSYM directories on +- # macosx +- ifeq ($(OPENJDK_TARGET_OS), macosx) +- ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false) +- JRE_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \ +- $(call containing, .dSYM/, $(patsubst $(JRE_IMAGE_DIR)/%, %, $(ALL_JRE_FILES)))) +- endif +- endif +- +- # Create special filter rules when dealing with debug symbols on windows +- ifeq ($(call isTargetOs, windows), true) +- ifeq ($(SHIP_DEBUG_SYMBOLS), ) +- JRE_SYMBOLS_EXCLUDE_PATTERN := %.pdb +- endif +- endif +- +- JRE_BUNDLE_FILES := $(filter-out \ +- $(JRE_SYMBOLS_EXCLUDE_PATTERN) \ +- $(SYMBOLS_EXCLUDE_PATTERN), \ +- $(ALL_JRE_FILES)) ++ JRE_BUNDLE_FILES := $(ALL_JRE_FILES) + + ifeq ($(MACOSX_CODESIGN_MODE), hardened) + # Macosx release build and code signing available. +diff --git a/make/CreateJmods.gmk b/make/CreateJmods.gmk +index 3280b24924a34..32f107b6bb6a0 100644 +--- a/make/CreateJmods.gmk ++++ b/make/CreateJmods.gmk +@@ -218,10 +218,14 @@ ifeq ($(call isTargetOs, windows), true) + ifeq ($(SHIP_DEBUG_SYMBOLS), ) + JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.diz,*.pdb,*.map}' + else +- JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.diz,*.map}' ++ JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.map}' + endif + else +- JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.diz,*.debuginfo,*.dSYM/**,*.dSYM}' ++ ifeq ($(SHIP_DEBUG_SYMBOLS), ) ++ JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.diz,*.debuginfo,*.dSYM/**,*.dSYM}' ++ else ++ JMOD_FLAGS += --exclude '**{_the.*,_*.marker*}' ++ endif + endif + + # Unless we are creating a very large module, use the small tool JVM options +diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 +index bb18877800192..87d147d4f074b 100644 +--- a/make/autoconf/jdk-options.m4 ++++ b/make/autoconf/jdk-options.m4 +@@ -316,23 +316,36 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], + AC_MSG_CHECKING([if we should add external native debug symbols to the shipped bundles]) + AC_ARG_WITH([external-symbols-in-bundles], + [AS_HELP_STRING([--with-external-symbols-in-bundles], +- [which type of external native debug symbol information shall be shipped in product bundles (none, public, full) +- (e.g. ship full/stripped pdbs on Windows) @<:@none@:>@])]) ++ [which type of external native debug symbol information shall be shipped with bundles/images (none, public, full). ++ @<:@none in release builds, full otherwise. --with-native-debug-symbols=external/zipped is a prerequisite. public is only supported on Windows@:>@])], ++ [], ++ [with_external_symbols_in_bundles=default]) + + if test "x$with_external_symbols_in_bundles" = x || test "x$with_external_symbols_in_bundles" = xnone ; then + AC_MSG_RESULT([no]) + elif test "x$with_external_symbols_in_bundles" = xfull || test "x$with_external_symbols_in_bundles" = xpublic ; then +- if test "x$OPENJDK_TARGET_OS" != xwindows ; then +- AC_MSG_ERROR([--with-external-symbols-in-bundles currently only works on windows!]) +- elif test "x$COPY_DEBUG_SYMBOLS" != xtrue ; then +- AC_MSG_ERROR([--with-external-symbols-in-bundles only works when --with-native-debug-symbols=external is used!]) +- elif test "x$with_external_symbols_in_bundles" = xfull ; then ++ if test "x$COPY_DEBUG_SYMBOLS" != xtrue ; then ++ AC_MSG_ERROR([--with-external-symbols-in-bundles only works when --with-native-debug-symbols=external/zipped is used!]) ++ elif test "x$with_external_symbols_in_bundles" = xpublic && test "x$OPENJDK_TARGET_OS" != xwindows ; then ++ AC_MSG_ERROR([--with-external-symbols-in-bundles=public is only supported on Windows!]) ++ fi ++ ++ if test "x$with_external_symbols_in_bundles" = xfull ; then + AC_MSG_RESULT([full]) + SHIP_DEBUG_SYMBOLS=full + else + AC_MSG_RESULT([public]) + SHIP_DEBUG_SYMBOLS=public + fi ++ elif test "x$with_external_symbols_in_bundles" = xdefault ; then ++ if test "x$DEBUG_LEVEL" = xrelease ; then ++ AC_MSG_RESULT([no (default)]) ++ elif test "x$COPY_DEBUG_SYMBOLS" = xtrue ; then ++ AC_MSG_RESULT([full (default)]) ++ SHIP_DEBUG_SYMBOLS=full ++ else ++ AC_MSG_RESULT([no (default, native debug symbols are not external/zipped)]) ++ fi + else + AC_MSG_ERROR([$with_external_symbols_in_bundles is an unknown value for --with-external-symbols-in-bundles]) + fi diff --git a/java-latest-openjdk-portable.spec b/java-latest-openjdk-portable.spec index 287c7fe..16bb5eb 100644 --- a/java-latest-openjdk-portable.spec +++ b/java-latest-openjdk-portable.spec @@ -404,9 +404,9 @@ exit 1 %endif # New Version-String scheme-style defines -%global featurever 25 +%global featurever 26 %global interimver 0 -%global updatever 1 +%global updatever 0 %global patchver 0 # buildjdkver is usually same as %%{featurever}, # but in time of bootstrap of next jdk, it is featurever-1, @@ -460,8 +460,8 @@ exit 1 %global origin_nice OpenJDK %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup -%global buildver 8 -%global rpmrelease 3 +%global buildver 29 +%global rpmrelease 1 #%%global tagsuffix %%{nil} # 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 @@ -480,7 +480,7 @@ exit 1 # Release will be (where N is usually a number starting at 1): # - 0.N%%{?extraver}%%{?dist} for EA releases, # - N%%{?extraver}{?dist} for GA releases -%global is_ga 1 +%global is_ga 0 %if %{is_ga} %global build_type GA %global ea_designator "" @@ -775,7 +775,7 @@ Source18: TestTranslations.java # RH1940064: Enable XML Signature provider in FIPS mode # RH2173781: Avoid calling C_GetInfo() too early, before cryptoki is initialized [now part of JDK-8301553 upstream] # usage in jdk >25 is experimental and may disapear -Patch1001: fips-%{featurever}u-%{fipsver}.patch +Patch1001: fips-25u-%{fipsver}.patch ############################################# # @@ -791,7 +791,7 @@ Patch1001: fips-%{featurever}u-%{fipsver}.patch # ############################################# -# Currently empty +Patch1: JDK-8373246-8351842_broke_native_debugging_on_Linux.patch ############################################# # @@ -1086,6 +1086,7 @@ pushd %{top_level_dir_name} # Add crypto policy and FIPS support # usage in jdk >25 is experimental and may disapear %patch -P1001 -p1 +%patch -P1 -p1 popd # openjdk echo "Generating %{alt_java_name} man page" @@ -1491,6 +1492,9 @@ function packagejdk() { # Release images have external debug symbols if [ "x$suffix" = "x" ] ; then + # jdk26 is putting debugsymbols out of main image, + # we later reconstruct debuginfo subpakckages manually, so putting them back + cp -r symbols/* ${jdkname}/ createtar ${debugarchive} $(find ${jdkname} -name \*.debuginfo) genchecksum ${debugarchive} diff --git a/sources b/sources index 641515d..404d038 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (openjdk-25.0.1+8.tar.xz) = eb84d876f81ca02803283e8294c89b6acbed3753426811c3bcc228615c9618deefc85da4aa702800cac2feb103e628ee8b92292b316e9d7e12a58b6de69c5085 +SHA512 (openjdk-26+29-ea.tar.xz) = 4e80882e0de26eff7d46d762e255911d42544473cc5f12ab0af1997969a14cc697e1164cb3c90d894359b58cc42dbd2b233f00fa807dbfad41583da278e26666