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-74304
This commit is contained in:
Andrew Hughes 2025-01-16 20:55:34 +00:00
parent 8b8410b67d
commit be6098a358

View File

@ -132,7 +132,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
%global portable_build_arches %{aarch64} %{ix86} %{power64} s390x x86_64 %global portable_build_arches %{aarch64} %{ix86} %{power64} x86_64 %{zero_arches}
# Architecture on which we run Java only tests # Architecture on which we run Java only tests
%global jdk_test_arch x86_64 %global jdk_test_arch x86_64
@ -348,7 +348,7 @@
# rpmrelease numbering must start at 2 to be later than the 8.6 RPM # rpmrelease numbering must start at 2 to be later than the 8.6 RPM
%global rpmrelease 3 %global rpmrelease 3
# Settings used by the portable build # Settings used by the portable build
%global portablerelease 1 %global portablerelease 2
%global portablesuffix el8 %global portablesuffix el8
%global portablebuilddir /builddir/build/BUILD %global portablebuilddir /builddir/build/BUILD
@ -893,6 +893,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
@ -1033,7 +1036,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
@ -2052,12 +2061,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
@ -2092,6 +2107,10 @@ for suffix in %{build_loop} ; do
export JAVA_HOME=$(pwd)/%{installoutputdir -- $suffix} export JAVA_HOME=$(pwd)/%{installoutputdir -- $suffix}
# 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}
@ -2684,7 +2703,15 @@ cjc.mainProgram(args)
%endif %endif
%changelog %changelog
* Mon Jan 06 2025 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.442.b05-0.1.ea * 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-74304
* 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.
- Switch to EA mode for pre-release. - Switch to EA mode for pre-release.