Bootstrap with gcc-toolset-15-devel

Key changes:

- Always use the system alternatives command, although I doubt if this
  ever even worked.
- Dropped GTS annobin
- Added the !%have_scl path

Resolves: RHEL-90727
This commit is contained in:
Siddhesh Poyarekar 2025-05-07 06:18:35 -04:00 committed by Siddhesh Poyarekar
parent 61e74ef36f
commit d3a36ca2ad

View File

@ -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,14 +470,11 @@ BuildRequires: xxhash-devel
#----------------------------------------------------------------------------
%if %{bootstrapping}
%define alternatives_cmd %{_sbindir}/alternatives
%define alternatives_cmdline %{alternatives_cmd}
%else
%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}
%endif
Requires(post): %{alternatives_cmd}
Requires(preun): %{alternatives_cmd}
@ -663,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"
@ -670,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
@ -1303,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
@ -1465,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
@ -1545,6 +1568,9 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Mon May 12 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 2.44-3
- Avoid using SCL for c10s.
* Thu May 08 2025 Nick Clifton <nickc@redhat.com> - 2.44-2
- Switch back to using SCL macros.