2007-10-09 04:28:58 +02:00
|
|
|
#
|
2011-04-21 11:42:38 +02:00
|
|
|
# spec file for package binutils
|
2007-10-09 04:28:58 +02:00
|
|
|
#
|
2023-01-24 13:54:02 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2007-10-09 04:28:58 +02:00
|
|
|
#
|
2008-08-08 17:27:01 +02:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2022-05-25 12:22:57 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2007-10-09 04:28:58 +02:00
|
|
|
#
|
|
|
|
|
2012-04-19 13:30:58 +02:00
|
|
|
|
2022-10-17 17:06:56 +02:00
|
|
|
%define flavor @BUILD_FLAVOR@%{nil}
|
2022-05-04 11:51:41 +02:00
|
|
|
|
|
|
|
%if "%{flavor}" != ""
|
|
|
|
%define cross 1
|
|
|
|
%define targetarch %(echo %flavor | sed -e 's/i.86/i586/;s/ppc/powerpc/')
|
|
|
|
%define TARGET %targetarch
|
|
|
|
|
|
|
|
# Spec parsing does not support execution of external command,
|
|
|
|
# that's why we use the if-else chain.
|
|
|
|
%if "%{flavor}" == "i386"
|
|
|
|
ExcludeArch: %ix86
|
|
|
|
%else
|
|
|
|
%if "%{flavor}" == "arm"
|
|
|
|
ExcludeArch: %arm
|
|
|
|
%else
|
|
|
|
ExcludeArch: %{flavor}
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%{flavor}" == ""
|
2007-10-09 04:28:58 +02:00
|
|
|
Name: binutils
|
2022-05-04 11:51:41 +02:00
|
|
|
%else
|
|
|
|
Name: cross-%{flavor}-binutils
|
|
|
|
%endif
|
|
|
|
|
2021-01-28 14:33:36 +01:00
|
|
|
BuildRequires: bc
|
2012-01-26 13:50:17 +01:00
|
|
|
BuildRequires: bison
|
|
|
|
BuildRequires: dejagnu
|
2022-01-31 14:21:02 +01:00
|
|
|
BuildRequires: fdupes
|
2012-01-26 13:50:17 +01:00
|
|
|
BuildRequires: flex
|
|
|
|
BuildRequires: gcc-c++
|
2011-07-11 10:43:27 +02:00
|
|
|
# for the testsuite
|
|
|
|
%if 0%{suse_version} >= 1210
|
|
|
|
BuildRequires: glibc-devel-static
|
|
|
|
%endif
|
2012-09-10 11:33:05 +02:00
|
|
|
%if 0%{suse_version} > 1220
|
|
|
|
BuildRequires: makeinfo
|
|
|
|
%endif
|
2009-11-27 12:33:30 +01:00
|
|
|
%if 0%{suse_version} > 1110
|
|
|
|
BuildRequires: zlib-devel-static
|
|
|
|
%else
|
|
|
|
BuildRequires: zlib-devel
|
|
|
|
%endif
|
2023-02-22 09:39:07 +01:00
|
|
|
%if %{suse_version} > 1500
|
|
|
|
BuildRequires: libzstd-devel
|
|
|
|
%endif
|
2023-01-24 16:25:48 +01:00
|
|
|
Version: 2.40
|
2012-01-26 13:50:17 +01:00
|
|
|
Release: 0
|
2021-09-20 14:28:03 +02:00
|
|
|
|
2021-10-13 14:19:55 +02:00
|
|
|
# disable libalternatives for now until it's changed to not
|
|
|
|
# introduce cmake/cunit-tests into the bootstrap cycle
|
|
|
|
%if 0 && 0%{?suse_version} > 1500
|
2021-09-20 14:28:03 +02:00
|
|
|
%bcond_without libalternatives
|
|
|
|
%else
|
|
|
|
%bcond_with libalternatives
|
|
|
|
%endif
|
|
|
|
|
2023-01-27 19:30:55 +01:00
|
|
|
%bcond_without bootstrap
|
|
|
|
|
2007-10-09 04:28:58 +02:00
|
|
|
#
|
|
|
|
# RUN_TESTS
|
|
|
|
%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?)
|
|
|
|
# check the vanilla binutils, with no patches applied
|
|
|
|
# TEST_VANILLA
|
|
|
|
%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?)
|
|
|
|
#
|
|
|
|
# handle test suite failures
|
|
|
|
#
|
2012-11-26 15:43:39 +01:00
|
|
|
%ifarch alpha %arm aarch64 hppa mips sh4 %sparc
|
2007-10-09 04:28:58 +02:00
|
|
|
%define make_check_handling true
|
|
|
|
%else
|
2009-11-27 12:33:30 +01:00
|
|
|
# XXX check again
|
2011-01-12 12:42:34 +01:00
|
|
|
# XXX disabled because gold is seriously broken for now
|
2021-01-28 14:33:36 +01:00
|
|
|
# Note that some gold tests fail due to gcc-PIE which leads PIE executables
|
2011-01-12 12:42:34 +01:00
|
|
|
%define make_check_handling true
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
# let make check fail anyway if RUN_TESTS was requested
|
|
|
|
%if %{run_tests}
|
|
|
|
%define make_check_handling false
|
|
|
|
%endif
|
2019-09-02 16:56:36 +02:00
|
|
|
# handle all binary object formats supported by SUSE (and a few more)
|
2023-01-20 18:08:10 +01:00
|
|
|
%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le riscv64 s390 s390x x86_64 %x86_64
|
2007-10-09 04:28:58 +02:00
|
|
|
%define build_multitarget 1
|
|
|
|
%else
|
|
|
|
%define build_multitarget 0
|
|
|
|
%endif
|
2022-02-12 17:21:49 +01:00
|
|
|
%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa
|
2023-01-27 19:30:55 +01:00
|
|
|
|
|
|
|
%define build_gprofng 0
|
2023-01-30 13:48:54 +01:00
|
|
|
|
|
|
|
%if %{suse_version} > 1500
|
|
|
|
%ifarch aarch64 %ix86 x86_64 %x86_64
|
2023-01-27 19:30:55 +01:00
|
|
|
%define build_gprofng 1
|
|
|
|
%endif
|
2023-01-30 13:48:54 +01:00
|
|
|
%endif
|
2023-01-27 19:30:55 +01:00
|
|
|
|
2007-10-09 04:28:58 +02:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
2022-05-25 12:24:02 +02:00
|
|
|
URL: https://www.gnu.org/software/binutils/
|
2022-10-17 17:06:56 +02:00
|
|
|
PreReq: %{install_info_prereq}
|
2008-11-01 23:16:56 +01:00
|
|
|
# bug437293
|
|
|
|
%ifarch ppc64
|
|
|
|
Obsoletes: binutils-64bit
|
|
|
|
%endif
|
|
|
|
#
|
2007-10-09 04:28:58 +02:00
|
|
|
Summary: GNU Binutils
|
2018-02-26 16:56:02 +01:00
|
|
|
License: GFDL-1.3-only AND GPL-3.0-or-later
|
2012-01-26 13:50:17 +01:00
|
|
|
Group: Development/Tools/Building
|
2017-09-01 10:04:50 +02:00
|
|
|
Source: binutils-%{version}.tar.bz2
|
2022-05-04 14:08:59 +02:00
|
|
|
Source2: binutils-%{version}.tar.bz2.sig
|
|
|
|
Source3: binutils.keyring
|
|
|
|
Source4: baselibs.conf
|
2023-01-24 16:25:48 +01:00
|
|
|
Patch1: binutils-2.40-branch.diff.gz
|
2007-10-09 04:28:58 +02:00
|
|
|
Patch3: binutils-skip-rpaths.patch
|
|
|
|
Patch4: s390-biarch.diff
|
|
|
|
Patch5: x86-64-biarch.patch
|
|
|
|
Patch6: unit-at-a-time.patch
|
|
|
|
Patch8: ld-relro.diff
|
|
|
|
Patch9: testsuite.diff
|
2011-01-11 14:41:17 +01:00
|
|
|
Patch10: enable-targets-gold.diff
|
2013-04-03 15:09:27 +02:00
|
|
|
Patch12: s390-pic-dso.diff
|
2009-06-12 16:47:10 +02:00
|
|
|
Patch14: binutils-build-as-needed.diff
|
2022-03-22 14:30:49 +01:00
|
|
|
Patch15: binutils-znow.patch
|
2012-11-30 14:00:21 +01:00
|
|
|
Patch22: binutils-bfd_h.patch
|
2015-10-14 16:38:50 +02:00
|
|
|
Patch34: aarch64-common-pagesize.patch
|
2018-03-06 17:02:58 +01:00
|
|
|
Patch36: binutils-pr22868.diff
|
2018-08-28 16:17:33 +02:00
|
|
|
Patch37: binutils-revert-plt32-in-branches.diff
|
2019-11-20 17:24:56 +01:00
|
|
|
Patch38: binutils-fix-invalid-op-errata.diff
|
2020-08-11 16:14:33 +02:00
|
|
|
Patch39: binutils-revert-nm-symversion.diff
|
|
|
|
Patch40: binutils-fix-abierrormsg.diff
|
2020-12-04 15:56:26 +01:00
|
|
|
Patch41: binutils-fix-relax.diff
|
2021-09-08 20:16:29 +02:00
|
|
|
Patch42: binutils-compat-old-behaviour.diff
|
2021-11-05 17:57:07 +01:00
|
|
|
Patch43: binutils-revert-hlasm-insns.diff
|
2022-10-17 17:04:37 +02:00
|
|
|
Patch44: binutils-revert-rela.diff
|
2023-01-24 16:25:48 +01:00
|
|
|
Patch45: extensa-gcc-4_3-fix.diff
|
2019-11-20 17:24:56 +01:00
|
|
|
Patch100: add-ulp-section.diff
|
2007-10-09 04:28:58 +02:00
|
|
|
Patch90: cross-avr-nesc-as.patch
|
|
|
|
Patch92: cross-avr-omit_section_dynsym.patch
|
2014-02-17 14:21:17 +01:00
|
|
|
Patch93: cross-avr-size.patch
|
2007-10-09 04:28:58 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2021-09-20 14:28:03 +02:00
|
|
|
%if %{with libalternatives}
|
|
|
|
Requires: alts
|
|
|
|
%else
|
2012-11-28 11:59:15 +01:00
|
|
|
PreReq: update-alternatives
|
2021-09-20 14:28:03 +02:00
|
|
|
%endif
|
2007-10-09 04:28:58 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib,
|
|
|
|
size, strings, and strip. These utilities are needed whenever you want
|
|
|
|
to compile a program or kernel.
|
|
|
|
|
2009-01-22 13:04:44 +01:00
|
|
|
%package gold
|
|
|
|
Summary: The gold linker
|
2018-02-26 16:56:02 +01:00
|
|
|
License: GPL-3.0-or-later
|
2009-01-22 13:04:44 +01:00
|
|
|
Group: Development/Tools/Building
|
2012-01-26 13:50:17 +01:00
|
|
|
Requires: binutils = %{version}-%{release}
|
2021-09-20 14:28:03 +02:00
|
|
|
%if %{with libalternatives}
|
|
|
|
Requires: alts
|
|
|
|
%else
|
2012-11-28 11:59:15 +01:00
|
|
|
PreReq: update-alternatives
|
2021-09-20 14:28:03 +02:00
|
|
|
%endif
|
2022-02-23 18:53:55 +01:00
|
|
|
%if 0%{!?cross:1} && 0%{?suse_version} >= 1310
|
2023-01-20 18:08:10 +01:00
|
|
|
%define gold_archs %ix86 aarch64 %arm x86_64 %x86_64 ppc ppc64 ppc64le s390x %sparc
|
2009-10-20 23:55:16 +02:00
|
|
|
%endif
|
2009-01-22 13:04:44 +01:00
|
|
|
|
|
|
|
%description gold
|
|
|
|
gold is an ELF linker. It is intended to have complete support for ELF
|
|
|
|
and to run as fast as possible on modern systems. For normal use it is
|
|
|
|
a drop-in replacement for the older GNU linker.
|
|
|
|
|
2007-10-09 04:28:58 +02:00
|
|
|
%package devel
|
|
|
|
Summary: GNU binutils (BFD development files)
|
2018-02-26 16:56:02 +01:00
|
|
|
License: GPL-3.0-or-later
|
2012-01-26 13:50:17 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2012-04-19 13:30:58 +02:00
|
|
|
Requires: binutils = %{version}-%{release}
|
|
|
|
Requires: zlib-devel
|
2007-10-09 04:28:58 +02:00
|
|
|
Provides: binutils:/usr/include/bfd.h
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
This package includes header files and static libraries necessary to
|
|
|
|
build programs which use the GNU BFD library, which is part of
|
|
|
|
binutils.
|
|
|
|
|
2020-02-17 15:18:06 +01:00
|
|
|
%package -n libctf0
|
|
|
|
Summary: Compact C Type Format library (runtime, BFD dependency)
|
|
|
|
License: GFDL-1.3-only AND GPL-3.0-or-later
|
|
|
|
Group: Development/Tools/Building
|
|
|
|
|
|
|
|
%description -n libctf0
|
|
|
|
This package includes the libctf shared library.
|
|
|
|
The Compact C Type Format (CTF) is a way of representing information about a binary program
|
|
|
|
|
|
|
|
%package -n libctf-nobfd0
|
|
|
|
Summary: Compact C Type Format library (runtime, no BFD dependency)
|
|
|
|
License: GFDL-1.3-only AND GPL-3.0-or-later
|
|
|
|
Group: Development/Tools/Building
|
|
|
|
|
|
|
|
%description -n libctf-nobfd0
|
|
|
|
This package includes the libctf-nobfd shared library.
|
|
|
|
The Compact C Type Format (CTF) is a way of representing information about a binary program
|
2007-10-09 04:28:58 +02:00
|
|
|
|
2022-08-08 16:03:30 +02:00
|
|
|
%package -n gprofng
|
|
|
|
Summary: The next generation profiling tool for Linux
|
|
|
|
License: GFDL-1.3-only AND GPL-3.0-or-later
|
|
|
|
Group: Development/Tools/Building
|
|
|
|
|
|
|
|
%description -n gprofng
|
|
|
|
The next generation profiling tool for Linux
|
|
|
|
|
2012-01-04 13:35:38 +01:00
|
|
|
%ifarch %arm
|
2011-09-26 11:45:39 +02:00
|
|
|
%define HOST %{_target_cpu}-suse-linux-gnueabi
|
|
|
|
%else
|
2023-01-20 18:08:10 +01:00
|
|
|
%define HOST %(echo %{_target_cpu} | sed -s -e "s/x86_64_v./x86_64/" -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux
|
2019-09-02 16:56:36 +02:00
|
|
|
%endif
|
2007-11-12 18:39:46 +01:00
|
|
|
%define DIST %(echo '%distribution' | sed 's/ (.*)//')
|
2008-01-12 02:41:14 +01:00
|
|
|
|
2022-05-09 14:46:21 +02:00
|
|
|
%if 0%{suse_version} >= 1500
|
|
|
|
# Synchronize output by lines, useful for configure output
|
|
|
|
%define make_output_sync -Oline
|
|
|
|
%endif
|
|
|
|
|
2007-10-09 04:28:58 +02:00
|
|
|
%prep
|
|
|
|
echo "make check will return with %{make_check_handling} in case of testsuite failures."
|
2017-09-01 10:04:50 +02:00
|
|
|
%setup -q -n binutils-%{version}
|
2022-02-28 15:38:04 +01:00
|
|
|
|
|
|
|
# Backup flex and biscon files for later verification.
|
|
|
|
cp ld/ldlex.l ld/ldlex.l.orig
|
|
|
|
cp ld/ldgram.y ld/ldgram.y.orig
|
|
|
|
|
2016-07-06 15:30:57 +02:00
|
|
|
# Patch is outside test_vanilla because it's supposed to be the
|
2013-12-09 16:23:12 +01:00
|
|
|
# patch bringing the tarball to the newest upstream version
|
2022-08-08 16:03:30 +02:00
|
|
|
%patch1 -p1
|
2007-10-09 04:28:58 +02:00
|
|
|
%if !%{test_vanilla}
|
2020-02-17 15:18:06 +01:00
|
|
|
%patch3 -p1
|
2007-10-09 04:28:58 +02:00
|
|
|
%patch4
|
|
|
|
%patch5
|
|
|
|
%patch6
|
|
|
|
%patch8
|
|
|
|
%patch9
|
|
|
|
%patch10
|
2013-04-03 15:09:27 +02:00
|
|
|
%patch12
|
2009-06-12 16:47:10 +02:00
|
|
|
%patch14
|
2022-03-22 14:30:49 +01:00
|
|
|
%patch15
|
2012-11-30 14:00:21 +01:00
|
|
|
%patch22
|
2015-10-14 16:38:50 +02:00
|
|
|
%patch34 -p1
|
2018-03-06 17:02:58 +01:00
|
|
|
%patch36 -p1
|
2018-08-28 16:17:33 +02:00
|
|
|
%if %{suse_version} < 1550
|
|
|
|
%patch37 -p1
|
|
|
|
%endif
|
2019-11-18 18:07:49 +01:00
|
|
|
%patch38
|
2020-08-11 16:14:33 +02:00
|
|
|
%patch39 -p1
|
|
|
|
%patch40 -p1
|
2020-12-04 15:56:26 +01:00
|
|
|
%patch41 -p1
|
2021-09-08 20:16:29 +02:00
|
|
|
%if %{suse_version} < 1550
|
|
|
|
%patch42 -p1
|
2021-11-05 17:57:07 +01:00
|
|
|
%patch43 -p1
|
2022-08-26 15:26:14 +02:00
|
|
|
%patch44 -p1
|
2022-10-17 17:04:37 +02:00
|
|
|
%patch45 -p1
|
2023-01-24 16:25:48 +01:00
|
|
|
%endif
|
2020-07-31 16:32:51 +02:00
|
|
|
%patch100 -p1
|
2007-10-09 04:28:58 +02:00
|
|
|
%if "%{TARGET}" == "avr"
|
|
|
|
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
|
|
|
|
%patch90
|
|
|
|
%patch92
|
2019-10-31 13:46:17 +01:00
|
|
|
%patch93 -p1
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
#
|
|
|
|
# test_vanilla
|
|
|
|
%endif
|
2022-02-28 15:38:04 +01:00
|
|
|
|
|
|
|
# Due to legacy flex version present in SLE-12 (and older), we cannot
|
|
|
|
# re-generate flex and bison files and so we verify that any patch modify these files.
|
|
|
|
diff -u ld/ldlex.l ld/ldlex.l.orig
|
|
|
|
diff -u ld/ldgram.y ld/ldgram.y.orig
|
2007-10-09 04:28:58 +02:00
|
|
|
|
|
|
|
%build
|
2020-02-17 15:18:06 +01:00
|
|
|
%define _lto_cflags %{nil}
|
2015-05-18 17:27:56 +02:00
|
|
|
sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h
|
2019-09-09 20:33:03 +02:00
|
|
|
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error"
|
2019-02-05 12:46:59 +01:00
|
|
|
|
2012-02-15 12:33:41 +01:00
|
|
|
%if 0%{!?cross:1}
|
2007-10-09 04:28:58 +02:00
|
|
|
# Building native binutils
|
2019-09-02 16:56:36 +02:00
|
|
|
echo "Building native binutils."
|
2007-10-09 04:28:58 +02:00
|
|
|
%if %build_multitarget
|
2009-01-22 16:48:12 +01:00
|
|
|
EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)"
|
2011-06-27 16:59:47 +02:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep"
|
2007-10-09 04:28:58 +02:00
|
|
|
%else
|
2009-01-22 16:48:12 +01:00
|
|
|
EXTRA_TARGETS=
|
2007-10-09 04:28:58 +02:00
|
|
|
%ifarch sparc
|
2011-01-11 14:41:17 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux"
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
%ifarch ppc
|
2011-01-11 14:41:17 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux"
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
%ifarch s390
|
2011-01-11 14:41:17 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux"
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
%ifarch s390x
|
2011-01-11 14:41:17 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux"
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
%ifarch %ix86
|
2011-01-11 14:41:17 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux"
|
2009-01-22 16:48:12 +01:00
|
|
|
%endif
|
2013-11-29 16:17:31 +01:00
|
|
|
%ifarch ppc ppc64 ppc64le
|
2011-01-11 14:41:17 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf"
|
|
|
|
%endif
|
2012-01-04 13:35:38 +01:00
|
|
|
%ifarch %arm
|
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi"
|
2011-09-26 11:45:39 +02:00
|
|
|
%endif
|
2012-11-26 15:43:39 +01:00
|
|
|
%ifarch aarch64
|
2012-11-28 12:01:22 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux"
|
2012-11-26 15:43:39 +01:00
|
|
|
%endif
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
2014-02-21 18:00:54 +01:00
|
|
|
# Normally we'd like to add --enable-deterministic-archives
|
|
|
|
# here (which by default makes uid/mtime be zero for archive
|
|
|
|
# members), to increase chances of getting a reproducable build
|
|
|
|
# But this breaks Makefile rules when directly accessing archives:
|
|
|
|
# rebuilding the same archive from unchanged .o files recreates
|
|
|
|
# it, because timestamps in the .a are 0, unequal to the actual timestamp
|
|
|
|
# of the .o files :-/
|
2022-08-08 16:03:30 +02:00
|
|
|
#
|
|
|
|
# Enable the following 2 configure options explicitly
|
|
|
|
# (--enable-warn-execstack=yes, --enable-warn-rwx-segments=yes)
|
|
|
|
# as they are not enabled by default for some targets (and we use --enable-targets=[many]).
|
2009-01-22 13:04:44 +01:00
|
|
|
%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\
|
2009-01-29 22:44:00 +01:00
|
|
|
--prefix=%{_prefix} --libdir=%{_libdir} \\\
|
|
|
|
--infodir=%{_infodir} --mandir=%{_mandir} \\\
|
2022-05-25 12:24:02 +02:00
|
|
|
--with-bugurl=https://bugs.opensuse.org/ \\\
|
2008-12-05 15:07:53 +01:00
|
|
|
--with-pkgversion="GNU Binutils; %{DIST}" \\\
|
|
|
|
--with-separate-debug-dir=%{_prefix}/lib/debug \\\
|
2017-03-06 19:00:36 +01:00
|
|
|
--with-pic --with-system-zlib --build=%{HOST}
|
2009-01-22 13:04:44 +01:00
|
|
|
mkdir build-dir
|
|
|
|
cd build-dir
|
2011-01-11 14:41:17 +01:00
|
|
|
../configure %common_flags \
|
|
|
|
${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \
|
2011-01-11 16:36:40 +01:00
|
|
|
--enable-plugins \
|
2011-01-11 14:41:17 +01:00
|
|
|
%ifarch %gold_archs
|
2011-01-11 16:36:40 +01:00
|
|
|
--enable-gold \
|
2012-09-03 12:14:26 +02:00
|
|
|
--enable-threads \
|
2016-03-17 14:11:29 +01:00
|
|
|
%endif
|
|
|
|
%if %{suse_version} <= 1320
|
|
|
|
--disable-x86-relax-relocations \
|
2017-03-31 12:45:35 +02:00
|
|
|
--disable-compressed-debug-sections \
|
|
|
|
%endif
|
|
|
|
%if %{suse_version} > 1320
|
|
|
|
--enable-compressed-debug-sections=gas \
|
2018-07-31 13:46:23 +02:00
|
|
|
%endif
|
|
|
|
%if %{suse_version} < 1550
|
2021-10-11 16:53:18 +02:00
|
|
|
--disable-x86-used-note \
|
2018-07-31 13:46:23 +02:00
|
|
|
--disable-separate-code \
|
2011-01-11 14:41:17 +01:00
|
|
|
%endif
|
2017-07-26 10:42:03 +02:00
|
|
|
--enable-new-dtags \
|
2018-02-26 16:56:02 +01:00
|
|
|
%if "%{TARGET}" != "mips"
|
|
|
|
--enable-default-hash-style=both \
|
|
|
|
%endif
|
2021-01-28 14:33:36 +01:00
|
|
|
--enable-shared \
|
2021-07-23 14:46:58 +02:00
|
|
|
%if %{suse_version} > 1500
|
2023-01-27 19:30:55 +01:00
|
|
|
%if %{with bootstrap}
|
2021-07-23 14:46:58 +02:00
|
|
|
--enable-pgo-build=lto \
|
2023-01-27 19:30:55 +01:00
|
|
|
%endif
|
2023-01-24 16:25:48 +01:00
|
|
|
--enable-colored-disassembly \
|
2022-08-08 16:03:30 +02:00
|
|
|
%endif
|
2023-01-27 19:30:55 +01:00
|
|
|
%if ! %build_gprofng
|
2022-08-08 16:03:30 +02:00
|
|
|
--disable-gprofng \
|
2021-07-23 14:46:58 +02:00
|
|
|
%endif
|
Accepting request 993443 from home:marxin:branches:devel:gcc
- Update to binutils 2.39:
* The ELF linker will now generate a warning message if the stack is made
executable. Similarly it will warn if the output binary contains a
segment with all three of the read, write and execute permission
bits set. These warnings are intended to help developers identify
programs which might be vulnerable to attack via these executable
memory regions.
The warnings are enabled by default but can be disabled via a command
line option. It is also possible to build a linker with the warnings
disabled, should that be necessary.
* The ELF linker now supports a --package-metadata option that allows
embedding a JSON payload in accordance to the Package Metadata
specification.
* In linker scripts it is now possible to use TYPE=<type> in an output
section description to set the section type value.
* The objdump program now supports coloured/colored syntax
highlighting of its disassembler output for some architectures.
(Currently: AVR, RiscV, s390, x86, x86_64).
* The nm program now supports a --no-weak/-W option to make it ignore
weak symbols.
* The readelf and objdump programs now support a -wE option to prevent
them from attempting to access debuginfod servers when following
links.
* The objcopy program's --weaken, --weaken-symbol, and
--weaken-symbols options now works with unique symbols as well.
- Rebase binutils-compat-old-behaviour.diff, binutils-revert-hlasm-insns.diff,
binutils-revert-plt32-in-branches.diff and remove binutils-2.38-branch.diff.gz.
- For now use --disable-gprofng.
- Includes fixes for these CVEs:
bnc#1142579 aka CVE-2019-1010204 aka PR23765
OBS-URL: https://build.opensuse.org/request/show/993443
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=413
2022-08-06 15:10:01 +02:00
|
|
|
--enable-obsolete \
|
2022-08-08 16:03:30 +02:00
|
|
|
--enable-warn-execstack=yes \
|
|
|
|
--enable-warn-rwx-segments=yes
|
2021-07-23 14:46:58 +02:00
|
|
|
|
2023-02-23 10:15:27 +01:00
|
|
|
#FIXME: enable in the future
|
|
|
|
#%if %{suse_version} > 1550
|
|
|
|
# --enable-default-compressed-debug-sections-algorithm=zstd \
|
|
|
|
#%endif
|
|
|
|
|
2021-10-19 17:51:00 +02:00
|
|
|
# we patch headers (bfd-in.h) that are input to other headers
|
|
|
|
# which are generated only with --enable-maintainer-mode (which we
|
|
|
|
# don't do) or explicitely by make headers, so do this:
|
2022-05-09 14:46:21 +02:00
|
|
|
make %{?make_output_sync} %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1
|
2021-10-19 18:31:03 +02:00
|
|
|
# the above interacts with --enable-pgo-build=lto because all-bfd doesn't
|
|
|
|
# have the PGO handling, hence it's config.cache files are wrong
|
|
|
|
# remove all of those for reconfigure
|
|
|
|
rm */config.cache
|
2021-10-19 17:51:00 +02:00
|
|
|
# force reconfiguring
|
|
|
|
rm bfd/Makefile
|
2022-05-09 14:46:21 +02:00
|
|
|
make %{?make_output_sync} %{?_smp_mflags} V=1
|
2008-03-07 20:18:44 +01:00
|
|
|
|
2007-10-09 04:28:58 +02:00
|
|
|
%else
|
|
|
|
# building cross-TARGET-binutils
|
2019-09-02 16:56:36 +02:00
|
|
|
echo "Building cross binutils."
|
2007-10-09 04:28:58 +02:00
|
|
|
mkdir build-dir
|
|
|
|
cd build-dir
|
2009-01-22 16:48:12 +01:00
|
|
|
EXTRA_TARGETS=
|
2007-10-09 04:28:58 +02:00
|
|
|
%if "%{TARGET}" == "sparc"
|
2009-01-22 16:48:12 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux"
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
%if "%{TARGET}" == "powerpc"
|
2009-01-22 16:48:12 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux"
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
%if "%{TARGET}" == "s390"
|
2009-01-22 16:48:12 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux"
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
%if "%{TARGET}" == "s390x"
|
2009-01-22 16:48:12 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux"
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
%if "%{TARGET}" == "i586"
|
2009-01-22 16:48:12 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux"
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
%if "%{TARGET}" == "hppa"
|
2009-01-22 16:48:12 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux"
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
2011-09-26 11:45:39 +02:00
|
|
|
%if "%{TARGET}" == "arm"
|
2012-01-04 13:35:38 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi"
|
2011-09-26 11:45:39 +02:00
|
|
|
%endif
|
2012-11-26 15:43:39 +01:00
|
|
|
%if "%{TARGET}" == "aarch64"
|
2012-11-28 12:01:22 +01:00
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux"
|
2012-11-26 15:43:39 +01:00
|
|
|
%endif
|
2022-02-12 17:21:49 +01:00
|
|
|
%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru"
|
2015-07-07 15:41:24 +02:00
|
|
|
%define TARGET_OS %{TARGET}
|
2007-10-09 04:28:58 +02:00
|
|
|
%else
|
2018-02-26 16:56:02 +01:00
|
|
|
%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx"
|
2015-07-13 16:13:27 +02:00
|
|
|
%define TARGET_OS %{TARGET}-elf
|
2014-11-04 17:19:26 +01:00
|
|
|
%else
|
2012-06-21 14:18:52 +02:00
|
|
|
%if "%{TARGET}" == "arm"
|
2015-07-07 15:41:24 +02:00
|
|
|
%define TARGET_OS %{TARGET}-suse-linux-gnueabi
|
2012-06-21 14:18:52 +02:00
|
|
|
%else
|
2015-07-07 15:41:24 +02:00
|
|
|
%define TARGET_OS %{TARGET}-suse-linux
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
2012-06-21 14:18:52 +02:00
|
|
|
%endif
|
2014-11-04 17:19:26 +01:00
|
|
|
%endif
|
2007-10-09 04:28:58 +02:00
|
|
|
../configure CFLAGS="${RPM_OPT_FLAGS}" \
|
2008-11-07 14:56:00 +01:00
|
|
|
--prefix=%{_prefix} \
|
2022-05-25 12:24:02 +02:00
|
|
|
--with-bugurl=https://bugs.opensuse.org/ \
|
2008-11-07 14:56:00 +01:00
|
|
|
--with-pkgversion="GNU Binutils; %{DIST}" \
|
2017-03-06 19:00:36 +01:00
|
|
|
--with-system-zlib \
|
2008-11-07 14:56:00 +01:00
|
|
|
--disable-nls \
|
2017-07-26 10:42:03 +02:00
|
|
|
--enable-new-dtags \
|
2021-01-28 14:33:36 +01:00
|
|
|
--enable-obsolete \
|
Accepting request 993443 from home:marxin:branches:devel:gcc
- Update to binutils 2.39:
* The ELF linker will now generate a warning message if the stack is made
executable. Similarly it will warn if the output binary contains a
segment with all three of the read, write and execute permission
bits set. These warnings are intended to help developers identify
programs which might be vulnerable to attack via these executable
memory regions.
The warnings are enabled by default but can be disabled via a command
line option. It is also possible to build a linker with the warnings
disabled, should that be necessary.
* The ELF linker now supports a --package-metadata option that allows
embedding a JSON payload in accordance to the Package Metadata
specification.
* In linker scripts it is now possible to use TYPE=<type> in an output
section description to set the section type value.
* The objdump program now supports coloured/colored syntax
highlighting of its disassembler output for some architectures.
(Currently: AVR, RiscV, s390, x86, x86_64).
* The nm program now supports a --no-weak/-W option to make it ignore
weak symbols.
* The readelf and objdump programs now support a -wE option to prevent
them from attempting to access debuginfod servers when following
links.
* The objcopy program's --weaken, --weaken-symbol, and
--weaken-symbols options now works with unique symbols as well.
- Rebase binutils-compat-old-behaviour.diff, binutils-revert-hlasm-insns.diff,
binutils-revert-plt32-in-branches.diff and remove binutils-2.38-branch.diff.gz.
- For now use --disable-gprofng.
- Includes fixes for these CVEs:
bnc#1142579 aka CVE-2019-1010204 aka PR23765
OBS-URL: https://build.opensuse.org/request/show/993443
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=413
2022-08-06 15:10:01 +02:00
|
|
|
--disable-gprofng \
|
2016-03-17 14:11:29 +01:00
|
|
|
%if %{suse_version} <= 1320
|
|
|
|
--disable-x86-relax-relocations \
|
|
|
|
%endif
|
2015-07-07 15:41:24 +02:00
|
|
|
--build=%{HOST} --target=%{TARGET_OS} \
|
2008-11-07 14:56:00 +01:00
|
|
|
%if "%{TARGET}" == "spu"
|
|
|
|
--with-sysroot=/usr/spu \
|
|
|
|
%else
|
2015-07-07 15:41:24 +02:00
|
|
|
--with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \
|
2018-02-26 16:56:02 +01:00
|
|
|
%endif
|
|
|
|
%if "%{TARGET}" != "mips"
|
|
|
|
--enable-default-hash-style=both \
|
2008-11-07 14:56:00 +01:00
|
|
|
%endif
|
2009-01-22 16:48:12 +01:00
|
|
|
${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"}
|
2022-05-09 14:46:21 +02:00
|
|
|
make %{?make_output_sync} %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1
|
2021-10-19 18:31:03 +02:00
|
|
|
rm */config.cache
|
2007-10-09 04:28:58 +02:00
|
|
|
# force reconfiguring
|
|
|
|
rm bfd/Makefile
|
2022-05-09 14:46:21 +02:00
|
|
|
make %{?make_output_sync} %{?_smp_mflags} V=1
|
2007-10-09 04:28:58 +02:00
|
|
|
%if "%{TARGET}" == "avr"
|
|
|
|
# build an extra nesC version because nesC requires $'s in identifiers
|
|
|
|
cp -a gas gas-nesc
|
|
|
|
echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h
|
|
|
|
make -C gas-nesc clean
|
2022-05-09 14:46:21 +02:00
|
|
|
make -C gas-nesc %{?make_output_sync} %{?_smp_mflags}
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
2012-02-15 12:33:41 +01:00
|
|
|
%endif
|
2008-03-07 20:18:44 +01:00
|
|
|
|
|
|
|
%check
|
2009-06-13 16:32:14 +02:00
|
|
|
unset SUSE_ASNEEDED
|
2008-03-07 20:18:44 +01:00
|
|
|
cd build-dir
|
2012-02-15 12:33:41 +01:00
|
|
|
%if 0%{?cross:1}
|
2020-01-07 16:09:54 +01:00
|
|
|
make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling}
|
2012-02-15 12:33:41 +01:00
|
|
|
%else
|
2021-09-08 20:16:29 +02:00
|
|
|
make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling}
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%install
|
|
|
|
cd build-dir
|
2012-02-15 12:33:41 +01:00
|
|
|
%if 0%{!?cross:1}
|
2007-10-09 04:28:58 +02:00
|
|
|
# installing native binutils
|
2009-01-22 13:04:44 +01:00
|
|
|
%ifarch %gold_archs
|
2022-01-31 14:21:02 +01:00
|
|
|
make DESTDIR=%{buildroot} install-gold
|
|
|
|
ln -sf ld.gold %{buildroot}%{_bindir}/gold
|
|
|
|
%endif
|
|
|
|
make DESTDIR=%{buildroot} install-info install
|
|
|
|
make DESTDIR=%{buildroot} install-bfd install-opcodes
|
|
|
|
if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then
|
|
|
|
mv "%{buildroot}/%_bindir"/{ld,ld.bfd};
|
2012-11-28 11:59:15 +01:00
|
|
|
else
|
2022-01-31 14:21:02 +01:00
|
|
|
rm -f "%{buildroot}/%_bindir/ld";
|
2011-01-11 14:41:17 +01:00
|
|
|
fi
|
2021-09-20 14:28:03 +02:00
|
|
|
%if ! 0%{with libalternatives}
|
2022-01-31 14:21:02 +01:00
|
|
|
mkdir -p "%{buildroot}/%_sysconfdir/alternatives";
|
2015-01-15 11:22:03 +01:00
|
|
|
# Keep older versions of brp-symlink happy
|
|
|
|
%if %{suse_version} < 1310
|
2022-01-31 14:21:02 +01:00
|
|
|
ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld"
|
2015-01-15 11:22:03 +01:00
|
|
|
%endif
|
2022-01-31 14:21:02 +01:00
|
|
|
ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld";
|
2021-09-20 14:28:03 +02:00
|
|
|
%else
|
2022-01-31 14:21:02 +01:00
|
|
|
ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld";
|
2021-09-20 14:28:03 +02:00
|
|
|
mkdir -p %{buildroot}%{_datadir}/libalternatives/ld;
|
|
|
|
cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf <<EOF
|
|
|
|
binary=%{_bindir}/ld.gold
|
|
|
|
EOF
|
|
|
|
cat > %{buildroot}%{_datadir}/libalternatives/ld/2.conf <<EOF
|
|
|
|
binary=%{_bindir}/ld.bfd
|
|
|
|
EOF
|
|
|
|
%endif
|
|
|
|
|
2022-01-31 14:21:02 +01:00
|
|
|
rm -rf %{buildroot}%{_prefix}/%{HOST}/bin
|
|
|
|
mkdir -p %{buildroot}%{_prefix}/%{HOST}/bin
|
|
|
|
ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} %{buildroot}%{_prefix}/%{HOST}/bin
|
|
|
|
mv %{buildroot}%{_prefix}/%{HOST}/lib/ldscripts $RPM_BUILD_ROOT%{_libdir}
|
|
|
|
ln -sf ../../%{_lib}/ldscripts %{buildroot}%{_prefix}/%{HOST}/lib/ldscripts
|
2007-10-09 04:28:58 +02:00
|
|
|
# Install header files
|
2022-01-31 14:21:02 +01:00
|
|
|
make -C libiberty install_to_libdir target_header_dir=/usr/include DESTDIR=%{buildroot}
|
2007-10-09 04:28:58 +02:00
|
|
|
# We want the PIC libiberty.a
|
2022-01-31 14:21:02 +01:00
|
|
|
install -m 644 libiberty/pic/libiberty.a %{buildroot}%{_libdir}
|
2007-10-09 04:28:58 +02:00
|
|
|
#
|
2022-01-31 14:21:02 +01:00
|
|
|
chmod a+x %{buildroot}%{_libdir}/libbfd-*
|
|
|
|
chmod a+x %{buildroot}%{_libdir}/libopcodes-*
|
2007-10-09 04:28:58 +02:00
|
|
|
# No shared linking outside binutils
|
2022-01-31 14:21:02 +01:00
|
|
|
rm %{buildroot}%{_libdir}/lib{bfd,opcodes}.so
|
2022-02-23 18:53:55 +01:00
|
|
|
rm %{buildroot}%{_libdir}/lib{bfd,opcodes,ctf,ctf-nobfd}.la
|
2023-01-27 19:30:55 +01:00
|
|
|
rm -f %{buildroot}%{_libdir}/gprofng/lib*.{l,}a
|
2007-10-09 04:28:58 +02:00
|
|
|
# Remove unwanted files to shut up rpm
|
2022-01-31 14:21:02 +01:00
|
|
|
rm -f %{buildroot}%{_infodir}/configure* $RPM_BUILD_ROOT%{_infodir}/standards.info*
|
|
|
|
rm -f %{buildroot}%{_mandir}/man1/dlltool.1 $RPM_BUILD_ROOT%{_mandir}/man1/windres.1 $RPM_BUILD_ROOT%{_mandir}/man1/windmc.1
|
2007-10-09 04:28:58 +02:00
|
|
|
cd ..
|
|
|
|
%find_lang binutils
|
|
|
|
%find_lang bfd binutils.lang
|
|
|
|
%find_lang gas binutils.lang
|
|
|
|
%find_lang ld binutils.lang
|
|
|
|
%find_lang opcodes binutils.lang
|
|
|
|
%find_lang gprof binutils.lang
|
2009-04-02 17:22:50 +02:00
|
|
|
%ifarch %gold_archs
|
|
|
|
%find_lang gold binutils-gold.lang
|
|
|
|
%endif
|
2022-01-31 14:21:02 +01:00
|
|
|
mkdir -p %{buildroot}%{_docdir}/%{name}
|
|
|
|
install -m 644 binutils/NEWS %{buildroot}%{_docdir}/%{name}/NEWS-binutils
|
|
|
|
install -m 644 gas/NEWS %{buildroot}%{_docdir}/%{name}/NEWS-gas
|
|
|
|
install -m 644 ld/NEWS %{buildroot}%{_docdir}/%{name}/NEWS-ld
|
2007-10-09 04:28:58 +02:00
|
|
|
%else
|
2012-02-15 10:19:39 +01:00
|
|
|
# installing cross-TARGET-binutils and TARGET-binutils
|
2022-01-31 14:21:02 +01:00
|
|
|
make DESTDIR=%{buildroot} install
|
2012-02-15 10:19:39 +01:00
|
|
|
# Replace hard links by symlinks, so that rpmlint doesn't complain
|
2022-01-31 14:21:02 +01:00
|
|
|
T=$(basename %{buildroot}/usr/%{TARGET_OS})
|
|
|
|
for f in %{buildroot}/usr/$T/bin/* ; do
|
2012-02-15 10:19:39 +01:00
|
|
|
ln -sf /usr/bin/$T-$(basename $f) $f
|
|
|
|
done
|
2018-01-18 16:44:48 +01:00
|
|
|
%if "%{TARGET}" == "arm"
|
|
|
|
# Instead of building duplicate binutils, add symlinks
|
2022-03-01 13:43:50 +01:00
|
|
|
for f in %{buildroot}%{_bindir}/${T}-* ; do
|
|
|
|
_toolname=${f##$(dirname $f)/${T}-}
|
2018-01-18 16:44:48 +01:00
|
|
|
for p in arm-none-eabi; do
|
2022-03-01 13:43:50 +01:00
|
|
|
ln -sf %{_bindir}/$T-${_toolname} %{buildroot}%{_bindir}/$p-${_toolname}
|
2018-01-18 16:44:48 +01:00
|
|
|
done
|
|
|
|
done
|
|
|
|
%endif
|
2018-05-14 09:39:38 +02:00
|
|
|
%if "%{TARGET}" == "riscv64"
|
|
|
|
# Instead of building duplicate binutils, add symlinks
|
2022-01-31 14:21:02 +01:00
|
|
|
for f in %{buildroot}/usr/$T/bin/* ; do
|
2018-05-14 09:39:38 +02:00
|
|
|
for p in riscv64-elf; do
|
2022-01-31 14:21:02 +01:00
|
|
|
ln -sf %{_bindir}/$T-$(basename $f) %{buildroot}%{_bindir}/$p-$(basename $f)
|
2018-05-14 09:39:38 +02:00
|
|
|
done
|
|
|
|
done
|
|
|
|
%endif
|
2007-10-09 04:28:58 +02:00
|
|
|
%if "%{TARGET}" == "avr"
|
2022-01-31 14:21:02 +01:00
|
|
|
install -c gas-nesc/as-new %{buildroot}%{_prefix}/bin/%{TARGET_OS}-nesc-as
|
|
|
|
ln -sf ../../bin/%{TARGET_OS}-nesc-as %{buildroot}%{_prefix}/%{TARGET_OS}/bin/nesc-as
|
|
|
|
%endif
|
|
|
|
rm -rf %{buildroot}%{_mandir}
|
|
|
|
rm -rf %{buildroot}%{_infodir}
|
|
|
|
rm -rf %{buildroot}%{_prefix}/lib*
|
|
|
|
rm -rf %{buildroot}%{_prefix}/include
|
|
|
|
rm -f %{buildroot}%{_prefix}/bin/*-c++filt
|
2007-10-09 04:28:58 +02:00
|
|
|
> ../binutils.lang
|
|
|
|
%endif
|
2022-01-31 14:21:02 +01:00
|
|
|
%fdupes %{buildroot}%{_prefix}
|
2007-10-09 04:28:58 +02:00
|
|
|
|
2012-02-15 12:33:41 +01:00
|
|
|
%if 0%{!?cross:1}
|
2007-10-09 04:28:58 +02:00
|
|
|
%post
|
2017-02-07 12:42:42 +01:00
|
|
|
/sbin/ldconfig
|
2021-09-20 14:28:03 +02:00
|
|
|
%if ! %{with libalternatives}
|
2012-11-28 11:59:15 +01:00
|
|
|
"%_sbindir/update-alternatives" --install \
|
2012-11-28 12:00:47 +01:00
|
|
|
"%_bindir/ld" ld "%_bindir/ld.bfd" 2
|
2021-09-20 14:28:03 +02:00
|
|
|
%endif
|
2007-10-09 04:28:58 +02:00
|
|
|
%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz
|
|
|
|
%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz
|
|
|
|
%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz
|
|
|
|
%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz
|
|
|
|
%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz
|
|
|
|
|
2021-09-20 14:28:03 +02:00
|
|
|
%if ! %{with libalternatives}
|
2012-11-28 11:59:15 +01:00
|
|
|
%post gold
|
|
|
|
"%_sbindir/update-alternatives" --install \
|
2012-11-28 12:00:47 +01:00
|
|
|
"%_bindir/ld" ld "%_bindir/ld.gold" 1
|
2021-09-20 14:28:03 +02:00
|
|
|
%endif
|
2012-11-28 11:59:15 +01:00
|
|
|
|
2020-02-17 15:18:06 +01:00
|
|
|
%post -n libctf0 -p /sbin/ldconfig
|
|
|
|
%post -n libctf-nobfd0 -p /sbin/ldconfig
|
|
|
|
|
2021-09-20 14:28:03 +02:00
|
|
|
%if %{with libalternatives}
|
|
|
|
%pre
|
|
|
|
# removing old update-alternatives entries
|
|
|
|
if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then
|
|
|
|
"%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd";
|
|
|
|
fi;
|
|
|
|
|
|
|
|
%pre gold
|
|
|
|
# removing old update-alternatives entries
|
|
|
|
if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then
|
|
|
|
"%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold";
|
|
|
|
fi;
|
|
|
|
%endif
|
|
|
|
|
2015-05-18 17:14:41 +02:00
|
|
|
%preun
|
2007-10-09 04:28:58 +02:00
|
|
|
%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz
|
|
|
|
%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz
|
|
|
|
%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz
|
|
|
|
%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz
|
|
|
|
%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz
|
2021-09-20 14:28:03 +02:00
|
|
|
%if ! %{with libalternatives}
|
2012-11-28 11:59:15 +01:00
|
|
|
if [ "$1" = 0 ]; then
|
|
|
|
"%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd";
|
|
|
|
fi;
|
2021-09-20 14:28:03 +02:00
|
|
|
%endif
|
2012-11-28 11:59:15 +01:00
|
|
|
|
2021-09-20 14:28:03 +02:00
|
|
|
%if ! %{with libalternatives}
|
2012-11-28 11:59:15 +01:00
|
|
|
%preun gold
|
|
|
|
if [ "$1" = 0 ]; then
|
|
|
|
"%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold";
|
|
|
|
fi;
|
2021-09-20 14:28:03 +02:00
|
|
|
%endif
|
2012-11-28 11:59:15 +01:00
|
|
|
|
2020-02-17 15:18:06 +01:00
|
|
|
%postun -n libctf0 -p /sbin/ldconfig
|
|
|
|
%postun -n libctf-nobfd0 -p /sbin/ldconfig
|
|
|
|
|
2022-01-31 14:21:02 +01:00
|
|
|
%postun -p /sbin/ldconfig
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%files -f binutils.lang
|
2022-02-23 18:53:55 +01:00
|
|
|
%defattr(-,root,root)
|
2012-02-15 12:33:41 +01:00
|
|
|
%if 0%{!?cross:1}
|
2008-10-13 15:45:53 +02:00
|
|
|
%{_docdir}/%{name}
|
2007-10-09 04:28:58 +02:00
|
|
|
%{_prefix}/%{HOST}/bin/*
|
|
|
|
%{_prefix}/%{HOST}/lib/ldscripts
|
|
|
|
%{_libdir}/ldscripts
|
2023-01-24 16:25:48 +01:00
|
|
|
%{_libdir}/libsframe.so.*
|
2023-01-27 19:30:55 +01:00
|
|
|
%if %build_gprofng
|
|
|
|
%{_libdir}/libgprofng.so.*
|
|
|
|
%endif
|
2021-01-28 14:33:36 +01:00
|
|
|
%dir %{_libdir}/bfd-plugins
|
|
|
|
%{_libdir}/bfd-plugins/libdep.so
|
2007-10-09 04:28:58 +02:00
|
|
|
%{_bindir}/*
|
2021-09-20 14:28:03 +02:00
|
|
|
%if ! 0%{with libalternatives}
|
2012-11-28 11:59:15 +01:00
|
|
|
%ghost %_sysconfdir/alternatives/ld
|
2021-09-20 14:28:03 +02:00
|
|
|
%else
|
|
|
|
%dir %{_datadir}/libalternatives
|
|
|
|
%dir %{_datadir}/libalternatives/ld
|
|
|
|
%{_datadir}/libalternatives/ld/2.conf
|
|
|
|
%endif
|
2009-01-22 13:04:44 +01:00
|
|
|
%ifarch %gold_archs
|
|
|
|
%exclude %{_bindir}/gold
|
2011-01-11 14:41:17 +01:00
|
|
|
%exclude %{_bindir}/ld.gold
|
2009-01-22 13:04:44 +01:00
|
|
|
%endif
|
2007-10-09 04:28:58 +02:00
|
|
|
%doc %{_infodir}/*.gz
|
|
|
|
%{_libdir}/lib*-%{version}*.so
|
|
|
|
%doc %{_mandir}/man1/*.1.gz
|
|
|
|
%else
|
2015-07-07 15:41:24 +02:00
|
|
|
%{_prefix}/%{TARGET_OS}
|
2012-02-15 10:19:39 +01:00
|
|
|
%{_prefix}/bin/*
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
2009-01-22 13:04:44 +01:00
|
|
|
|
2012-02-15 12:33:41 +01:00
|
|
|
%ifarch %gold_archs
|
2009-04-02 17:22:50 +02:00
|
|
|
%files gold -f binutils-gold.lang
|
2022-02-23 18:53:55 +01:00
|
|
|
%defattr(-,root,root)
|
2009-01-22 13:04:44 +01:00
|
|
|
%doc gold/NEWS gold/README
|
|
|
|
%{_bindir}/gold
|
2011-01-11 14:41:17 +01:00
|
|
|
%{_bindir}/ld.gold
|
2021-09-20 14:28:03 +02:00
|
|
|
%if %{with libalternatives}
|
|
|
|
%dir %{_datadir}/libalternatives
|
|
|
|
%dir %{_datadir}/libalternatives/ld
|
|
|
|
%{_datadir}/libalternatives/ld/1.conf
|
|
|
|
%endif
|
2009-01-22 13:04:44 +01:00
|
|
|
%endif
|
2007-10-09 04:28:58 +02:00
|
|
|
|
2012-02-15 12:33:41 +01:00
|
|
|
%if 0%{!?cross:1}
|
2007-10-09 04:28:58 +02:00
|
|
|
%files devel
|
2022-02-23 18:53:55 +01:00
|
|
|
%defattr(-,root,root)
|
2007-10-09 04:28:58 +02:00
|
|
|
%{_prefix}/include/*.h
|
2008-12-05 15:07:53 +01:00
|
|
|
%{_libdir}/lib*.*a
|
2020-02-17 15:18:06 +01:00
|
|
|
%{_libdir}/libctf.so
|
|
|
|
%{_libdir}/libctf-nobfd.so
|
2023-01-24 16:25:48 +01:00
|
|
|
%{_libdir}/libsframe.so
|
2023-01-27 19:30:55 +01:00
|
|
|
%if %build_gprofng
|
|
|
|
%{_libdir}/libgprofng.so
|
|
|
|
%endif
|
2020-02-17 15:18:06 +01:00
|
|
|
|
|
|
|
%files -n libctf0
|
2022-02-23 18:53:55 +01:00
|
|
|
%defattr(-,root,root)
|
2020-02-17 15:18:06 +01:00
|
|
|
%{_libdir}/libctf.so.*
|
|
|
|
|
|
|
|
%files -n libctf-nobfd0
|
2022-02-23 18:53:55 +01:00
|
|
|
%defattr(-,root,root)
|
2020-02-17 15:18:06 +01:00
|
|
|
%{_libdir}/libctf-nobfd.so.*
|
2022-08-08 16:03:30 +02:00
|
|
|
|
|
|
|
%if %{suse_version} > 1500
|
2023-01-20 18:08:10 +01:00
|
|
|
%ifarch %ix86 x86_64 %x86_64 aarch64
|
2022-08-08 16:03:30 +02:00
|
|
|
%files -n gprofng
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%dir %{_libdir}/gprofng/
|
|
|
|
%{_libdir}/gprofng/lib*.so
|
|
|
|
%{_distconfdir}/gprofng.rc
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
2012-02-15 12:33:41 +01:00
|
|
|
%endif
|
2008-01-12 02:41:14 +01:00
|
|
|
|
2007-10-09 04:28:58 +02:00
|
|
|
%changelog
|