Add attempted patch for JDK-8385876 to fix -Wnonnull build failure with s390x Zero on CentOS 9

Resolves: RHEL-212095
This commit is contained in:
Andrew Hughes 2026-07-16 01:03:15 +01:00
parent 3f239b9c37
commit 089adaecb8
2 changed files with 39 additions and 4 deletions

View File

@ -360,9 +360,9 @@
%global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u})
# eg jdk8u60-b27 -> b27
%global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-})
%global rpmrelease 2
%global rpmrelease 3
# Settings used by the portable build
%global portablerelease 1
%global portablerelease 2
# Portable suffix differs between RHEL and CentOS
%if 0%{?centos} == 0
%global portablerhel 8
@ -1498,6 +1498,8 @@ Patch534: rh1648246-always_instruct_vm_to_assume_multiple_processors_are_availab
Patch1000: rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch
# RH1582504: Use RSA as default for keytool, as DSA is disabled in all crypto policies except LEGACY
Patch1003: rh1582504-rsa_default_for_keytool.patch
# RH1750419: Enable build of speculative store bypass hardened alt-java (CVE-2018-3639)
Patch600: rh1750419-redhat_alt_java.patch
# Crypto policy and FIPS support patches
# Patch is generated from the fips tree at https://github.com/rh-openjdk/jdk8u/tree/fips
@ -1545,8 +1547,8 @@ Patch528: pr3083-rh1346460-for_ssl_debug_return_null_instead_of_exception_when_t
Patch539: pr2888-rh2055274-support_system_cacerts-%{cacertsver}.patch
# RH1684077, JDK-8009550: Depend on pcsc-lite-libs instead of pcsc-lite-devel as this is only in optional repo
Patch541: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch
# RH1750419: Enable build of speculative store bypass hardened alt-java (CVE-2018-3639)
Patch600: rh1750419-redhat_alt_java.patch
# JDK-8385876: [8u] hotspot/src/share/vm/code/compiledIC.cpp:406:30: error: 'this' pointer is null
Patch542: jdk8385876-zero_this_pointer_is_null.patch
#############################################
#
@ -2039,6 +2041,7 @@ pushd %{top_level_dir_name}
%patch -P502 -p1
%patch -P14 -p1
%patch -P15 -p1
%patch -P542 -p1
popd
# Early fixes
@ -2967,6 +2970,10 @@ cjc.mainProgram(args)
%endif
%changelog
* Wed Jul 15 2026 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.492.b09-3
- Add attempted patch for JDK-8385876 to fix -Wnonnull build failure with s390x Zero on CentOS 9
- Resolves: RHEL-212095
* Mon Apr 20 2026 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.492.b09-2
- Bump release for PQC build
- Related: RHEL-169446

View File

@ -0,0 +1,28 @@
diff --git a/hotspot/src/share/vm/code/compiledIC.cpp b/hotspot/src/share/vm/code/compiledIC.cpp
index 63821c0613..b0e3d057ca 100644
--- a/hotspot/src/share/vm/code/compiledIC.cpp
+++ b/hotspot/src/share/vm/code/compiledIC.cpp
@@ -403,7 +403,8 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
assert(info.cached_metadata() != NULL && info.cached_metadata()->is_method(), "sanity check");
CompiledStaticCall* csc = compiledStaticCall_at(instruction_address());
methodHandle method (thread, (Method*)info.cached_metadata());
- csc->set_to_interpreted(method, info.entry());
+ // Compiler sees 'this' as null on Zero but it should never actually get called
+ NOT_ZERO(csc->set_to_interpreted(method, info.entry()));
if (TraceICs) {
ResourceMark rm(thread);
tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter: %s",
diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
index a136da9054..39fb84628b 100644
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
@@ -1319,7 +1319,8 @@ methodHandle SharedRuntime::resolve_sub_helper(JavaThread *thread,
}
} else {
CompiledStaticCall* ssc = compiledStaticCall_before(caller_frame.pc());
- if (ssc->is_clean()) ssc->set(static_call_info);
+ // Compiler sees 'this' as null on Zero but it should never actually get called
+ NOT_ZERO(if (ssc->is_clean()) ssc->set(static_call_info));
}
}