From 01776c626e831b35f6c3f12a503d36126367846c Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Fri, 17 Jan 2025 13:53:45 +0000 Subject: [PATCH] Add bundled libffi.so to _privatelibs - Remove libffi.so copying workaround now the portable build installs it in lib - Remove libffi.so copy if we are building on the same platform as the portable Related: RHEL-74302 --- java-1.8.0-openjdk.spec | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index ecf4921..1790fe8 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -364,10 +364,11 @@ %global portablerelease 1 # Portable suffix differs between RHEL and CentOS %if 0%{?centos} == 0 -%global portablesuffix el8 +%global portablerhel 8 %else -%global portablesuffix el9 +%global portablerhel 9 %endif +%global portablesuffix el%{portablerhel} %global portablebuilddir /builddir/build/BUILD # Define milestone (EA for pre-releases, GA ("fcs") for releases) @@ -413,7 +414,7 @@ # fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349 # https://bugzilla.redhat.com/show_bug.cgi?id=1590796#c14 # https://bugzilla.redhat.com/show_bug.cgi?id=1655938 -%global _privatelibs libattach[.]so.*|libawt_headless[.]so.*|libawt[.]so.*|libawt_xawt[.]so.*|libdt_socket[.]so.*|libfontmanager[.]so.*|libhprof[.]so.*|libinstrument[.]so.*|libj2gss[.]so.*|libj2pcsc[.]so.*|libj2pkcs11[.]so.*|libjaas_unix[.]so.*|libjava_crw_demo[.]so.*|libjdwp[.]so.*|libjli[.]so.*|libjsdt[.]so.*|libjsoundalsa[.]so.*|libjsound[.]so.*|liblcms[.]so.*|libmanagement[.]so.*|libmlib_image[.]so.*|libnet[.]so.*|libnio[.]so.*|libnpt[.]so.*|libsaproc[.]so.*|libsctp[.]so.*|libsplashscreen[.]so.*|libsunec[.]so.*|libsystemconf[.]so.*|libunpack[.]so.*|libzip[.]so.*|lib[.]so\\(SUNWprivate_.*%{jpeg_lib} +%global _privatelibs libattach[.]so.*|libawt_headless[.]so.*|libawt[.]so.*|libawt_xawt[.]so.*|libdt_socket[.]so.*|libffi[.]so.*|libfontmanager[.]so.*|libhprof[.]so.*|libinstrument[.]so.*|libj2gss[.]so.*|libj2pcsc[.]so.*|libj2pkcs11[.]so.*|libjaas_unix[.]so.*|libjava_crw_demo[.]so.*|libjdwp[.]so.*|libjli[.]so.*|libjsdt[.]so.*|libjsoundalsa[.]so.*|libjsound[.]so.*|liblcms[.]so.*|libmanagement[.]so.*|libmlib_image[.]so.*|libnet[.]so.*|libnio[.]so.*|libnpt[.]so.*|libsaproc[.]so.*|libsctp[.]so.*|libsplashscreen[.]so.*|libsunec[.]so.*|libsystemconf[.]so.*|libunpack[.]so.*|libzip[.]so.*|lib[.]so\\(SUNWprivate_.*%{jpeg_lib} %global _publiclibs libjawt[.]so.*|libjava[.]so.*|libjvm[.]so.*|libverify[.]so.*|libjsig[.]so.* %if %is_system_jdk %global __provides_exclude ^(%{_privatelibs})$ @@ -932,8 +933,10 @@ exit 0 %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libawt_headless.so %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libdt_socket.so %ifarch %{zero_arches} +%if 0%{?rhel} != %{portablerhel} %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libffi.so.* %endif +%endif %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libfontmanager.so %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libhprof.so %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libinstrument.so @@ -1098,8 +1101,10 @@ exit 0 %dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/%{archinstall} %dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/%{archinstall}/jli %ifarch %{zero_arches} +%if 0%{?rhel} != %{portablerhel} %{_jvmdir}/%{sdkdir -- %{?1}}/lib/%{archinstall}/libffi.so.* %endif +%endif %{_jvmdir}/%{sdkdir -- %{?1}}/lib/%{archinstall}/libjawt.so %{_jvmdir}/%{sdkdir -- %{?1}}/lib/%{archinstall}/jli/libjli.so %{_jvmdir}/%{sdkdir -- %{?1}}/lib/ct.sym @@ -2348,8 +2353,10 @@ for suffix in %{build_loop} ; do tar -xJf ${jdkzip} mv %{name}* ${installdir} %ifarch %{zero_arches} - # FIXME: Workaround libffi only being in jre/lib not lib - cp -av ${installdir}/jre/lib/%{archinstall}/libffi.* ${installdir}/lib/%{archinstall} + # We do not need the local copy of libffi.so if we are building on the same platform as the portable +%if 0%{?rhel} == %{portablerhel} + rm -vf ${installdir}/{,jre/}lib/%{archinstall}/libffi.* +%endif %endif # Fix build paths in ELF files so it looks like we built them portablenvr="%{name}-portable-%{pversion}-%{prelease}.%{portablesuffix}.%{_arch}" @@ -2965,6 +2972,9 @@ cjc.mainProgram(args) - Switch to GA mode for final release - Revise JDK-8141590 backport to install libffi.so* in lib as well as jre/lib - Sync the copy of the portable specfile with the latest update +- Remove libffi.so copying workaround now the portable build installs it in lib +- Add bundled libffi.so to _privatelibs +- Remove libffi.so copy if we are building on the same platform as the portable - Resolves: RHEL-73554 - Related: RHEL-74302