diff --git a/binutils.spec b/binutils.spec index 085f8a8..1063e25 100644 --- a/binutils.spec +++ b/binutils.spec @@ -1,7 +1,17 @@ +%if 0%{?rhel} < 10 +%global have_scl_utils 1 +%else +%global have_scl_utils 0 +%endif -%{?scl_package:%global scl gcc-toolset-15} -%global scl_prefix gcc-toolset-15- +%global gts_ver 15 +%{?scl_package:%global scl gcc-toolset-%{gts_ver}} +%global scl_prefix gcc-toolset-%{gts_ver}- +%if %have_scl_utils BuildRequires: scl-utils-build +%else +BuildRequires: gcc-toolset-%{gts_ver}-devel +%endif %global __python /usr/bin/python3 %{?scl:%scl_package binutils} @@ -14,7 +24,7 @@ Name: %{?scl_prefix}binutils # The variable %%{source} (see below) should be set to indicate which of these # origins is being used. Version: 2.44 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL-3.0-or-later AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND BSD-3-Clause AND GFDL-1.3-or-later AND GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.0-or-later URL: https://sourceware.org/binutils @@ -373,7 +383,9 @@ BuildRequires: clang compiler-rt %define gcc_package %{?scl_prefix}gcc %define gxx_package %{?scl_prefix}gcc-c++ +%if 0%{rhel} < 9 BuildRequires: %{?scl_prefix}annobin-plugin-gcc +%endif %define gcc_for_binutils %{_scl_root}/usr/bin/gcc %define gxx_for_binutils %{_scl_root}/usr/bin/g++ @@ -458,7 +470,9 @@ BuildRequires: xxhash-devel #---------------------------------------------------------------------------- +%if %have_scl_utils %{?scl:Requires:%scl_runtime} +%endif %define alternatives_cmd %{!?scl:%{_sbindir}}%{?scl:%{_root_sbindir}}/alternatives %define alternatives_cmdline %{alternatives_cmd}%{?scl: --altdir %{_sysconfdir}/alternatives --admindir %{_scl_root}/var/lib/alternatives} @@ -658,6 +672,10 @@ use by developers. It is NOT INTENDED FOR PRODUCTION use. # NB/ Do not add {?scl_prefix} to the -n option below. The binutils sources # uppack into a directory called binutils-VERSION not gcc-toolset-15-binutils-VERSION. +%if 0%{?rhel} < 9 +%setup -q -n binutils-with-gold-%{version} +%autopatch -p1 +%else %if "%{source}" == "snapshot" %autosetup -p1 -n binutils-%{version}-%{commit_id} %elif "%{source}" == "official-release" @@ -665,6 +683,7 @@ use by developers. It is NOT INTENDED FOR PRODUCTION use. %else %autosetup -p1 -n binutils-%{version} %endif +%endif # On ppc64 and aarch64, we might use 64KiB pages sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*ppc.c @@ -1298,6 +1317,10 @@ done # Stop check-rpaths from complaining about standard runpaths. export QA_RPATHS=0x0003 +%if %have_scl_utils == 0 +mkdir -p %{buildroot}%{_scl_root}/etc/alternatives %{buildroot}%{_scl_root}/var/lib/alternatives +%endif + #---------------------------------------------------------------------------- %post @@ -1460,6 +1483,11 @@ exit 0 %endif +%if %have_scl_utils == 0 +%dir %{_scl_root}/etc/alternatives +%dir %{_scl_root}/var/lib/alternatives +%endif + #------------------------------------ %files devel @@ -1540,6 +1568,9 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Mon May 12 2025 Siddhesh Poyarekar - 2.44-3 +- Avoid using SCL for c10s. + * Wed May 07 2025 Siddhesh Poyarekar - 2.44-2 - Use system alternatives even for bootstrap.