Disable building GOLD.

Resolves: #2149646
This commit is contained in:
Nick Clifton 2022-12-12 17:02:23 +00:00
parent 0f14bb08c8
commit 3391c3cb7a

View File

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