diff --git a/binutils.spec b/binutils.spec index cbc56ad087aaf9f69a680bbdd7e36e8aac2c3530..4a61253bc2dd277c9012d36bb91d7f816e693144 100644 --- a/binutils.spec +++ b/binutils.spec @@ -1,12 +1,19 @@ Summary: Binary utilities Name: binutils Version: 2.34 -Release: 5 +Release: 6 License: GPLv3+ URL: https://sourceware.org/binutils 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 Patch1: export-demangle.h-in-devel-package.patch #BUZ:845084 @@ -48,8 +55,10 @@ Requires(preun):info chkconfig %define _gnu %{nil} # The higher of these two numbers determines the default ld. %{!?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 The GNU Binutils are a collection of binary tools. The main ones are: @@ -133,7 +142,10 @@ export LDFLAGS=$RPM_LD_FLAGS --quiet \ --build=%{_target_platform} --host=%{_target_platform} \ --target=%{_target_platform} \ - --enable-gold=default --enable-ld \ + --enable-ld \ +%if %{with gold} + --enable-gold=default \ +%endif --with-sysroot=/ \ --enable-deterministic-archives=no \ --enable-lto \ @@ -237,7 +249,11 @@ rm -f %{buildroot}%{_infodir}/dir rm -rf %{buildroot}%{_prefix}/%{_target_platform} %find_lang binutils +%if %{with gold} for library in opcodes bfd gas gprof ld gold +%else +for library in opcodes bfd gas gprof ld +%endif do %find_lang $library cat $library.lang >> binutils.lang @@ -247,8 +263,12 @@ done %__rm -f %{_bindir}/ld %{_sbindir}/alternatives --install %{_bindir}/ld ld \ %{_bindir}/ld.bfd %{ld_bfd_priority} + +%if %{with gold} %{_sbindir}/alternatives --install %{_bindir}/ld ld \ %{_bindir}/ld.gold %{ld_gold_priority} +%endif + if [ $1 = 0 ]; then %{_sbindir}/alternatives --auto ld fi @@ -264,7 +284,10 @@ done %preun if [ $1 = 0 ]; then %{_sbindir}/alternatives --remove ld %{_bindir}/ld.bfd + +%if %{with gold} %{_sbindir}/alternatives --remove ld %{_bindir}/ld.gold +%endif fi %preun help @@ -322,6 +345,11 @@ fi %{_infodir}/bfd*info* %changelog +* Tue Nov 3 2020 Qingqing Li - 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 - 2.34-5 - Type:bugfix - ID:NA