From 9fc91f31a596235fe365551d798487c7234dc2e0 Mon Sep 17 00:00:00 2001 From: Jiri Date: Sat, 9 Dec 2023 11:52:37 +0100 Subject: [PATCH] proeprly filing debugsources pkg by addedd symlinks restructuring the structure for original build sources according to logs, some are still missing probably generated during the build, and thus not existing in prep, when the sources subpkg is created after patching --- java-11-openjdk.spec | 50 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/java-11-openjdk.spec b/java-11-openjdk.spec index 4981fdb..1b78305 100644 --- a/java-11-openjdk.spec +++ b/java-11-openjdk.spec @@ -196,6 +196,9 @@ %global vm_variant server %endif +# debugedit tool for rewriting ELF file paths +%global debugedit %( if [ -f "%{_rpmconfigdir}/debugedit" ]; then echo "%{_rpmconfigdir}/debugedit" ; else echo "/usr/bin/debugedit"; fi ) + # 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 @@ -273,6 +276,7 @@ %global interimver 0 %global updatever 21 %global patchver 0 + # 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} @@ -317,10 +321,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 9 -%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 @@ -1702,6 +1706,8 @@ if [ %{include_debug_build} -eq 0 -a %{include_normal_build} -eq 0 -a %{includ echo "You have disabled all builds (normal,fastdebug,slowdebug). That is a no go." exit 14 fi + +%setup -q -c -n %{uniquesuffix ""} -T # https://bugzilla.redhat.com/show_bug.cgi?id=1189084 prioritylength=`expr length %{priority}` if [ $prioritylength -ne 8 ] ; then @@ -1779,6 +1785,29 @@ done done %build +# we need to symlink sources to expected lcoation, so debuginfo strip can locate debugsources +src_image=`ls -d %{compatiblename}*%{version}*portable.sources.noarch` +ln -s $src_image/%{vcstag} %{vcstag} # this one shpuld be enoug +# cpio is complaining baout several files from build dir. Attempt here, but seems not to be correct +# as those sources are generated during build and so it have to be fixed in portables first +mkdir build +pushd build + ln -s ../$src_image/%{vcstag}/src jdk%{featurever}.build + ln -s ../$src_image/%{vcstag}/src jdk%{featurever}.build-fastdebug + ln -s ../$src_image/%{vcstag}/src jdk%{featurever}.build-slowdebug +popd +doc_image=`ls -d %{compatiblename}*%{version}*portable.docs.%{_arch}` +# in addition the builddir must match the builddir of the portables, including release +# be aware, even os may be different, especially with buildonce, repack everywhere +# so deducting it from installed deps +portablenvr=`ls -d %{compatiblename}*%{version}*portable*.misc.%{_arch} | sed "s/portable.*.misc.//"` +portablebuilddir=/builddir/build/BUILD + # Fix build paths in ELF files so it looks like we built them + for file in $(find `pwd` -type f | grep -v -e "$src_image" -e "$doc_image") ; do + if file ${file} | grep -q 'ELF'; then + %{debugedit} -b "${portablebuilddir}/${portablenvr}" -d "$(pwd)" -n "${file}" + fi + done %install function installjdk() { @@ -1963,7 +1992,7 @@ pushd ${jdk_image} # Install systemtap support files install -dm 755 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/tapset # note, that uniquesuffix is in BUILD dir in this case - cp -a $RPM_BUILD_DIR/tapset$suffix/*.stp $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/tapset/ + cp -a $RPM_BUILD_DIR/%{uniquesuffix ""}/tapset$suffix/*.stp $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/tapset/ pushd $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/tapset/ tapsetFiles=`ls *.stp` popd @@ -2088,9 +2117,9 @@ 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 $JAVA_HOME/bin/%{alt_java_name} | grep prctl %else -if ! nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation ; then true ; else false; fi +if ! nm $JAVA_HOME/bin/%{alt_java_name} | grep prctl ; then true ; else false; fi %endif # Check correct vendor values have been set @@ -2107,8 +2136,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=${JAVA_HOME}/%{static_libs_install_dir} -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 @@ -2393,6 +2422,13 @@ end %endif %changelog +* Sat Dec 09 2023 Jiri Vanek - 1:11.0.21.0.9-2 +- proeprly filing debugsources pkg + by addedd symlinks restructuring the structure for original build sources +- according to logs, some are still missing + probably generated during the build, and thus not existing in prep, + when the sources subpkg is created after patching + * Wed Nov 22 2023 Jiri Vanek - 1:11.0.21.0.9-1 - updated to OpenJDK 11.0.9 (2023-10-17)