From c13a28efbc24b6073e0b82f89685c67954c61e8c Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Jan 27 2022 16:47:47 +0000 Subject: Borrow a patch from the GCC package to stop libtool from inserting needless runpaths into binaries. (#2030667) --- diff --git a/binutils.spec b/binutils.spec index 9037ad5..b03b5b6 100644 --- a/binutils.spec +++ b/binutils.spec @@ -39,7 +39,7 @@ Summary: A GNU collection of binary utilities Name: binutils%{?name_cross}%{?_with_debug:-debug} Version: 2.37 -Release: 24%{?dist} +Release: 25%{?dist} License: GPLv3+ URL: https://sourceware.org/binutils @@ -333,6 +333,10 @@ Patch29: binutils-readelf-recognize-FDO-Packaging-Metadata-ELF-note.patch # Lifetime: Fixed in 2.38. Patch30: binutils-CVE-2021-45078.patch +# Purpose: Stop libtool from inserting useless runpaths into binaries. +# Lifetime: Who knows. +Patch31: gcc12-libtool-no-rpath.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -850,9 +854,6 @@ if [ -x gold/ld-new ]; then cat %{?cross}gold.lang >> %{?cross}binutils.lang fi -# Stop check-rpaths from complaining about standard runpaths. -export QA_RPATHS=0x0001 - #---------------------------------------------------------------------------- %post @@ -945,6 +946,9 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Thu Jan 27 2022 Nick Clifton - 2.37-25 +- Borrow a patch from the GCC package to stop libtool from inserting needless runpaths into binaries. (#2030667) + * Wed Jan 19 2022 Fedora Release Engineering - 2.37-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/gcc12-libtool-no-rpath.patch b/gcc12-libtool-no-rpath.patch new file mode 100644 index 0000000..a4f90a1 --- /dev/null +++ b/gcc12-libtool-no-rpath.patch @@ -0,0 +1,28 @@ +diff -rup binutils.orig/ltmain.sh binutils-2.37/ltmain.sh +--- binutils.orig/ltmain.sh 2022-01-27 16:23:09.304207432 +0000 ++++ binutils-2.37/ltmain.sh 2022-01-27 16:23:18.380143759 +0000 +@@ -7103,6 +7103,7 @@ EOF + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then +@@ -7798,6 +7799,7 @@ EOF + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then +@@ -7849,6 +7851,7 @@ EOF + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then +Only in binutils-2.37: ltmain.sh.orig