Disable building GOLD.

Resolves: #2149646
This commit is contained in:
Nick Clifton 2022-12-12 17:02:23 +00:00
parent 0f14bb08c8
commit 3391c3cb7a
1 changed files with 25 additions and 15 deletions

View File

@ -2,7 +2,7 @@
Summary: A GNU collection of binary utilities
Name: binutils%{?_with_debug:-debug}
Version: 2.35.2
Release: 29%{?dist}
Release: 30%{?dist}
License: GPLv3+
URL: https://sourceware.org/binutils
@ -683,10 +683,6 @@ set_build_configuration()
CARGS="$CARGS --enable-relro=no"
%endif
%if %{with gold}
CARGS="$CARGS --enable-gold=default"
%endif
%if %{with systemzlib}
CARGS="$CARGS --with-system-zlib"
%endif
@ -811,15 +807,21 @@ build()
;;
esac
# We disable the GOLD linker for cross builds because although it does
# support sysroots specified on the command line, it does not support
# them in linker scripts via the =/$SYSROOT prefix.
if test x$native == x1 ; then
SARGS="--with-sysroot=/ \
--prefix=%{_prefix} \
--libdir=%{_libdir}"
--libdir=%{_libdir} \
--enable-gold=default"
else
TARGS=""
SARGS="--with-sysroot=%{_prefix}/$target/sys-root \
--program-prefix=$target- \
--prefix=%{_prefix}/$target"
--prefix=%{_prefix}/$target \
--disable-gold"
fi
if test x$shared == x1 ; then
@ -1082,6 +1084,9 @@ EOH
install $target_root/bin/$target-ld.* $local_bindir
install $target_root/bin/$target-[!l]* $local_bindir
pushd $local_bindir
ln -s $target-ld.bfd $target-ld
popd
rm $target_root/bin/$target-*
# Also install the binaries into the sysroot.
@ -1141,13 +1146,13 @@ export QA_RPATHS=0x0003
%post
%__rm -f %{_bindir}/%{?cross}ld
%{_sbindir}/alternatives --install %{_bindir}/%{?cross}ld %{?cross}ld \
%{_bindir}/%{?cross}ld.bfd %{ld_bfd_priority}
%__rm -f %{_bindir}/ld
%{_sbindir}/alternatives --install %{_bindir}/ld ld \
%{_bindir}/ld.bfd %{ld_bfd_priority}
%if %{with gold}
%{_sbindir}/alternatives --install %{_bindir}/%{?cross}ld %{?cross}ld \
%{_bindir}/%{?cross}ld.gold %{ld_gold_priority}
%{_sbindir}/alternatives --install %{_bindir}/ld ld \
%{_bindir}/ld.gold %{ld_gold_priority}
%endif
# Do not run "alternatives --auto ld" here. Leave the setting to
@ -1161,11 +1166,11 @@ exit 0
%preun
if [ $1 = 0 ]; then
%{_sbindir}/alternatives --remove %{?cross}ld %{_bindir}/%{?cross}ld.bfd
%{_sbindir}/alternatives --remove ld %{_bindir}/ld.bfd
fi
%if %{with gold}
if [ $1 = 0 ]; then
%{_sbindir}/alternatives --remove %{?cross}ld %{_bindir}/%{?cross}ld.gold
%{_sbindir}/alternatives --remove ld %{_bindir}/ld.gold
fi
%endif
@ -1218,11 +1223,13 @@ exit 0
%{_libdir}/lib*.so*
%exclude %{_libdir}/libbfd.so
%exclude %{_libdir}/libopcodes.so
%exclude %{_libdir}/libctf.a
%exclude %{_libdir}/libctf-nobfd.a
%endif
%if %{with gold}
%files gold
%{_bindir}/%{?cross}ld.gold
%{_bindir}/ld.gold
%endif
%files devel
@ -1261,6 +1268,9 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Mon Dec 12 2022 Nick Clifton <nickc@redhat.com> - 2.35.2-30
- Disable building GOLD for cross-binutils.
* Wed Dec 07 2022 Nick Clifton <nickc@redhat.com> - 2.35.2-29
- Eliminate duplicates between sub-packages and add missing shared libraries. (#2149646)