!34 【轻量级 PR】:riscv64 do not support gold linker, disable it.

From: @liqingqing_1229
Reviewed-by: @xiezhipeng1,@hanxinke
Signed-off-by: @hanxinke
This commit is contained in:
openeuler-ci-bot 2020-11-03 21:00:47 +08:00 committed by Gitee
commit eae241c348

View File

@ -1,12 +1,19 @@
Summary: Binary utilities Summary: Binary utilities
Name: binutils Name: binutils
Version: 2.34 Version: 2.34
Release: 5 Release: 6
License: GPLv3+ License: GPLv3+
URL: https://sourceware.org/binutils URL: https://sourceware.org/binutils
Source: https://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz Source: https://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz
# risc-v do not support gold linker.
%ifnarch riscv64
%bcond_without gold
%else
%bcond_with gold
%endif
Patch0: binutils-2.20.51.0.2-libtool-lib64.patch Patch0: binutils-2.20.51.0.2-libtool-lib64.patch
Patch1: export-demangle.h-in-devel-package.patch Patch1: export-demangle.h-in-devel-package.patch
#BUZ:845084 #BUZ:845084
@ -48,8 +55,10 @@ Requires(preun):info chkconfig
%define _gnu %{nil} %define _gnu %{nil}
# The higher of these two numbers determines the default ld. # The higher of these two numbers determines the default ld.
%{!?ld_bfd_priority: %global ld_bfd_priority 50} %{!?ld_bfd_priority: %global ld_bfd_priority 50}
%{!?ld_gold_priority:%global ld_gold_priority 30}
%if %{with gold}
%{!?ld_gold_priority:%global ld_gold_priority 30}
%endif
%description %description
The GNU Binutils are a collection of binary tools. The main ones are: The GNU Binutils are a collection of binary tools. The main ones are:
@ -133,7 +142,10 @@ export LDFLAGS=$RPM_LD_FLAGS
--quiet \ --quiet \
--build=%{_target_platform} --host=%{_target_platform} \ --build=%{_target_platform} --host=%{_target_platform} \
--target=%{_target_platform} \ --target=%{_target_platform} \
--enable-gold=default --enable-ld \ --enable-ld \
%if %{with gold}
--enable-gold=default \
%endif
--with-sysroot=/ \ --with-sysroot=/ \
--enable-deterministic-archives=no \ --enable-deterministic-archives=no \
--enable-lto \ --enable-lto \
@ -237,7 +249,11 @@ rm -f %{buildroot}%{_infodir}/dir
rm -rf %{buildroot}%{_prefix}/%{_target_platform} rm -rf %{buildroot}%{_prefix}/%{_target_platform}
%find_lang binutils %find_lang binutils
%if %{with gold}
for library in opcodes bfd gas gprof ld gold for library in opcodes bfd gas gprof ld gold
%else
for library in opcodes bfd gas gprof ld
%endif
do do
%find_lang $library %find_lang $library
cat $library.lang >> binutils.lang cat $library.lang >> binutils.lang
@ -247,8 +263,12 @@ done
%__rm -f %{_bindir}/ld %__rm -f %{_bindir}/ld
%{_sbindir}/alternatives --install %{_bindir}/ld ld \ %{_sbindir}/alternatives --install %{_bindir}/ld ld \
%{_bindir}/ld.bfd %{ld_bfd_priority} %{_bindir}/ld.bfd %{ld_bfd_priority}
%if %{with gold}
%{_sbindir}/alternatives --install %{_bindir}/ld ld \ %{_sbindir}/alternatives --install %{_bindir}/ld ld \
%{_bindir}/ld.gold %{ld_gold_priority} %{_bindir}/ld.gold %{ld_gold_priority}
%endif
if [ $1 = 0 ]; then if [ $1 = 0 ]; then
%{_sbindir}/alternatives --auto ld %{_sbindir}/alternatives --auto ld
fi fi
@ -264,7 +284,10 @@ done
%preun %preun
if [ $1 = 0 ]; then if [ $1 = 0 ]; then
%{_sbindir}/alternatives --remove ld %{_bindir}/ld.bfd %{_sbindir}/alternatives --remove ld %{_bindir}/ld.bfd
%if %{with gold}
%{_sbindir}/alternatives --remove ld %{_bindir}/ld.gold %{_sbindir}/alternatives --remove ld %{_bindir}/ld.gold
%endif
fi fi
%preun help %preun help
@ -322,6 +345,11 @@ fi
%{_infodir}/bfd*info* %{_infodir}/bfd*info*
%changelog %changelog
* Tue Nov 3 2020 Qingqing Li <liqingqing3@huawei.com> - 2.34-6
- Type:bugfix
- ID:NA
- SUG:riscv64 do not support gold linker, add a condition to distinguish it.
* Sat Oct 31 2020 Qingqing Li <liqingqing3@huawei.com> - 2.34-5 * Sat Oct 31 2020 Qingqing Li <liqingqing3@huawei.com> - 2.34-5
- Type:bugfix - Type:bugfix
- ID:NA - ID:NA