Add zero_arches to the portable_build_arches now that the portable build bundles libffi

- Temporarily workaround libffi.so not being in lib/%%{archinstall} by copying it
- Exclude libffi.so from the debugedit run
- Add a simple -version check on both the JDK and JRE bin/java
- Add libffi.so to the filelist, including expanding the lib/%%{archinstall} contents as with jre/lib

Resolves: RHEL-74302
This commit is contained in:
Andrew Hughes 2025-01-16 20:55:34 +00:00
parent 75a373e9ba
commit bc74fbdb99

View File

@ -136,11 +136,7 @@
# Set of architectures where we verify backtraces with gdb # Set of architectures where we verify backtraces with gdb
%global gdb_arches %{jit_arches} %{zero_arches} %global gdb_arches %{jit_arches} %{zero_arches}
# Set of architectures for which we have a portable build # Set of architectures for which we have a portable build
%if 0%{?centos} == 0
%global portable_build_arches %{aarch64} %{ix86} %{power64} x86_64
%else
%global portable_build_arches %{aarch64} %{ix86} %{power64} x86_64 %{zero_arches} %global portable_build_arches %{aarch64} %{ix86} %{power64} x86_64 %{zero_arches}
%endif
# Architecture on which we run Java only tests # Architecture on which we run Java only tests
%if 0%{?centos} == 0 %if 0%{?centos} == 0
# Temporarily include zero_arches until we can use a portable Zero build # Temporarily include zero_arches until we can use a portable Zero build
@ -363,9 +359,9 @@
# eg jdk8u60-b27 -> b27 # eg jdk8u60-b27 -> b27
%global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-}) %global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-})
# rpmrelease numbering must start at 2 to be later than the 9.0 RPM # rpmrelease numbering must start at 2 to be later than the 9.0 RPM
%global rpmrelease 2 %global rpmrelease 3
# Settings used by the portable build # Settings used by the portable build
%global portablerelease 1 %global portablerelease 2
# Portable suffix differs between RHEL and CentOS # Portable suffix differs between RHEL and CentOS
%if 0%{?centos} == 0 %if 0%{?centos} == 0
%global portablesuffix el8 %global portablesuffix el8
@ -935,6 +931,9 @@ exit 0
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libawt.so %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libawt.so
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libawt_headless.so %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libawt_headless.so
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libdt_socket.so %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libdt_socket.so
%ifarch %{zero_arches}
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libffi.so.*
%endif
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libfontmanager.so %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libfontmanager.so
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libhprof.so %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libhprof.so
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libinstrument.so %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libinstrument.so
@ -1096,7 +1095,13 @@ exit 0
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/wsimport %{_jvmdir}/%{sdkdir -- %{?1}}/bin/wsimport
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/xjc %{_jvmdir}/%{sdkdir -- %{?1}}/bin/xjc
%{_jvmdir}/%{sdkdir -- %{?1}}/include/* %{_jvmdir}/%{sdkdir -- %{?1}}/include/*
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/%{archinstall} %dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/%{archinstall}
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/%{archinstall}/jli
%ifarch %{zero_arches}
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/%{archinstall}/libffi.so.*
%endif
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/%{archinstall}/libjawt.so
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/%{archinstall}/jli/libjli.so
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/ct.sym %{_jvmdir}/%{sdkdir -- %{?1}}/lib/ct.sym
%if %{with_systemtap} %if %{with_systemtap}
%{_jvmdir}/%{sdkdir -- %{?1}}/tapset %{_jvmdir}/%{sdkdir -- %{?1}}/tapset
@ -2337,12 +2342,18 @@ for suffix in %{build_loop} ; do
# TODO: should verify checksums when using packages from buildroot # TODO: should verify checksums when using packages from buildroot
tar -xJf ${jdkzip} tar -xJf ${jdkzip}
mv %{name}* ${installdir} 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}
%endif
# Fix build paths in ELF files so it looks like we built them # Fix build paths in ELF files so it looks like we built them
portablenvr="%{name}-portable-%{pversion}-%{prelease}.%{portablesuffix}.%{_arch}" portablenvr="%{name}-portable-%{pversion}-%{prelease}.%{portablesuffix}.%{_arch}"
for file in $(find ${installdir} -type f) ; do for file in $(find ${installdir} -type f) ; do
if ! echo ${file} | grep -q 'libffi' ; then
if file ${file} | grep -q 'ELF'; then if file ${file} | grep -q 'ELF'; then
%{debugedit} -b %{portablebuilddir}/${portablenvr} -d $(pwd) -n ${file} %{debugedit} -b %{portablebuilddir}/${portablenvr} -d $(pwd) -n ${file}
fi fi
fi
done done
# Set tapset variables to match this build # Set tapset variables to match this build
@ -2421,6 +2432,10 @@ export JAVA_HOME=$(pwd)/%{installoutputdir -- $suffix}
export JAVA_HOME=$(pwd)/%{installoutputdir -- $suffix}/images/%{jdkimage} export JAVA_HOME=$(pwd)/%{installoutputdir -- $suffix}/images/%{jdkimage}
%endif %endif
# Basic version check
$JAVA_HOME/jre/bin/java -version
$JAVA_HOME/bin/java -version
# Only test on one architecture (the fastest) for Java only tests # Only test on one architecture (the fastest) for Java only tests
%ifarch %{jdk_test_arch} %ifarch %{jdk_test_arch}
@ -2939,6 +2954,14 @@ cjc.mainProgram(args)
%endif %endif
%changelog %changelog
* Thu Jan 16 2025 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.442.b05-0.3.ea
- Add zero_arches to the portable_build_arches now that the portable build bundles libffi
- Temporarily workaround libffi.so not being in lib/%%{archinstall} by copying it
- Exclude libffi.so from the debugedit run
- Add a simple -version check on both the JDK and JRE bin/java
- Add libffi.so to the filelist, including expanding the lib/%%{archinstall} contents as with jre/lib
- Resolves: RHEL-74302
* Mon Jan 06 2025 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.442.b05-0.2.ea * Mon Jan 06 2025 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.442.b05-0.2.ea
- Update to 8u442-b05 (EA). - Update to 8u442-b05 (EA).
- Update release notes for 8u442-b05. - Update release notes for 8u442-b05.