|
@@ -3,61 +3,86 @@
|
|
|
# --without testsuite: Do not run the testsuite. Default is to run it.
|
|
|
# --with testsuite: Run the testsuite. Default --with debug is not to run it.
|
|
|
|
|
|
+%bcond_with debug
|
|
|
+%bcond_with debuginfod
|
|
|
+%bcond_without gprofng
|
|
|
+%bcond_without testsuite
|
|
|
+%bcond_without docs
|
|
|
+
|
|
|
+#---Start of Configure Options-----------------------------------------------
|
|
|
+
|
|
|
+# Create deterministic archives (ie ones without timestamps).
|
|
|
+# Default is off because of BZ 1195883.
|
|
|
+%define enable_deterministic_archives 0
|
|
|
+
|
|
|
# Enable support for GCC LTO compilation.
|
|
|
+# Disable if it is necessary to work around bugs in LTO.
|
|
|
%define enable_lto 1
|
|
|
|
|
|
# Enable support for generating new dtags in the linker
|
|
|
# Disable if it is necessary to use RPATH instead.
|
|
|
%define enable_new_dtags 1
|
|
|
|
|
|
-# Disable the default generation of compressed debug sections.
|
|
|
+# Enable the compression of debug sections as default behaviour of the
|
|
|
+# assembler and linker. This option is disabled for now. The assembler and
|
|
|
+# linker have command line options to override the default behaviour.
|
|
|
%define default_compress_debug 0
|
|
|
|
|
|
# Default to read-only-relocations (relro) in shared binaries.
|
|
|
+# This is enabled as a security feature.
|
|
|
%define default_relro 1
|
|
|
|
|
|
-# Disable the default generation of GNU Build notes by the assembler.
|
|
|
-# This has turned out to be problematic for the i686 architecture.
|
|
|
-# although the exact reason has not been determined. (See BZ 1572485)
|
|
|
-# It also breaks building EFI binaries on AArch64, as these cannot have
|
|
|
-# relocations against absolute symbols.
|
|
|
+# Enable the default generation of GNU Build notes by the assembler.
|
|
|
+# This option is disabled as it has turned out to be problematic for the i686
|
|
|
+# architecture, although the exact reason has not been determined. (See
|
|
|
+# BZ 1572485). It also breaks building EFI binaries on AArch64, as these
|
|
|
+# cannot have relocations against absolute symbols.
|
|
|
%define default_generate_notes 0
|
|
|
|
|
|
-# Enable thread support in the GOLD linker. This is particularly
|
|
|
-# important if plugins to the linker intend to use threads themselves.
|
|
|
-# See BZ 1636479 for more details. This option is made configurable
|
|
|
-# in case there is ever a need to disable thread support.
|
|
|
+# Enable thread support in the GOLD linker (if it is being built). This is
|
|
|
+# particularly important if plugins to the linker intend to use threads
|
|
|
+# themselves. See BZ 1636479 for more details. This option is made
|
|
|
+# configurable in case there is ever a need to disable thread support.
|
|
|
%define enable_threading 1
|
|
|
|
|
|
+# Enable the use of separate code and data segments for all architectures,
|
|
|
+# not just x86/x86_64.
|
|
|
+%define enable_separate_code 1
|
|
|
+
|
|
|
+#----End of Configure Options------------------------------------------------
|
|
|
+
|
|
|
%define binutils_target %{_target_platform}
|
|
|
%define isnative 1
|
|
|
%define enable_shared 1
|
|
|
|
|
|
-%bcond_without testsuite
|
|
|
-%bcond_without docs
|
|
|
+%undefine _strict_symbol_defs_build
|
|
|
+%undefine __brp_strip_static_archive
|
|
|
+
|
|
|
+%if %{with debug}
|
|
|
+%undefine with_testsuite
|
|
|
+%endif
|
|
|
|
|
|
Summary: A GNU collection of binary utilities.
|
|
|
Summary(ja): GNU 版バイナリユーティリティ集
|
|
|
Name: binutils
|
|
|
-Version: 2.37
|
|
|
-Release: 4%{?_dist_release}
|
|
|
+Version: 2.39
|
|
|
+Release: 1%{?_dist_release}
|
|
|
Group: programming
|
|
|
Vendor: Project Vine
|
|
|
Distribution: Vine Linux
|
|
|
Packager: kenta, shaolin, inagaki
|
|
|
|
|
|
License: GPLv3+
|
|
|
-URL: http://sources.redhat.com/binutils
|
|
|
-# Source: ftp://ftp.kernel.org/pub/linux/devel/binutils/binutils-%{version}.tar.bz2
|
|
|
-# The ftp.kernel.org/pub/linux/devel/binutils/ page is (temporarily) unavailable
|
|
|
-# so we use the GNU site instead.
|
|
|
-# Source: ftp://ftp.kernel.org/pub/linux/devel/binutils/binutils-%{version}.tar.bz2
|
|
|
+URL: https://sourceware.org/binutils
|
|
|
+# Note - the Linux Kernel binutils releases are too unstable and contain
|
|
|
+# too many controversial patches so we stick with the official FSF version
|
|
|
+# instead.
|
|
|
Source: https://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz
|
|
|
Source2: binutils-2.19.50.0.1-output-format.sed
|
|
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
|
|
-Patch00: binutils-2.37-20220129.patch
|
|
|
+Patch00: binutils-%{version}-20220908.patch
|
|
|
|
|
|
# Purpose: Use /lib64 and /usr/lib64 instead of /lib and /usr/lib in the
|
|
|
# default library search path of 64-bit targets.
|
|
@@ -125,101 +150,76 @@ Patch08: binutils-2.27-aarch64-ifunc.patch
|
|
|
Patch09: binutils-do-not-link-with-static-libstdc++.patch
|
|
|
|
|
|
# Purpose: Allow OS specific sections in section groups.
|
|
|
-# Lifetime: Fixed in 2.38 (maybe)
|
|
|
+# Lifetime: Fixed in 2.39 (maybe)
|
|
|
Patch10: binutils-special-sections-in-groups.patch
|
|
|
|
|
|
# Purpose: Fix linker testsuite failures.
|
|
|
-# Lifetime: Fixed in 2.37 (maybe)
|
|
|
+# Lifetime: Fixed in 2.39 (maybe)
|
|
|
Patch11: binutils-fix-testsuite-failures.patch
|
|
|
|
|
|
# Purpose: Stop gold from aborting when input sections with the same name
|
|
|
# have different flags.
|
|
|
-# Lifetime: Fixed in 2.38 (maybe)
|
|
|
+# Lifetime: Fixed in 2.39 (maybe)
|
|
|
Patch12: binutils-gold-mismatched-section-flags.patch
|
|
|
|
|
|
-# Purpose: Add a check to the GOLD linker for a corrupt input file
|
|
|
-# with a fuzzed section offset.
|
|
|
-# Lifetime: Fixed in 2.38 (maybe)
|
|
|
-Patch13: binutils-CVE-2019-1010204.patch
|
|
|
-
|
|
|
# Purpose: Change the gold configuration script to only warn about
|
|
|
# unsupported targets. This allows the binutils to be built with
|
|
|
# BPF support enabled.
|
|
|
# Lifetime: Permanent.
|
|
|
-Patch14: binutils-gold-warn-unsupported.patch
|
|
|
-
|
|
|
-# Purpose: Use the "unsigned long long" type for pointers on hosts where
|
|
|
-# long is a 32-bit type but pointers are a 64-bit type. Necessary
|
|
|
-# because users expect to be able to install both the i686- and
|
|
|
-# x86_64 versions of binutils-devel on the same machine, so they
|
|
|
-# need to identical versions of the bfd.h header file.
|
|
|
-# Lifetime: Permanent.
|
|
|
-Patch15: binutils-use-long-long.patch
|
|
|
+Patch13: binutils-gold-warn-unsupported.patch
|
|
|
|
|
|
# Purpose: Fix testsuite failures due to the patches applied here.
|
|
|
# Lifetime: Permanent, but varying with each new rebase.
|
|
|
-Patch16: binutils-testsuite-fixes.patch
|
|
|
+Patch14: binutils-testsuite-fixes.patch
|
|
|
|
|
|
# Purpose: Enable the creation of .note.gnu.property sections by the GOLD
|
|
|
# linker for x86 binaries.
|
|
|
# Lifetime: Fixed in 2.38 maybe
|
|
|
-Patch17: binutils-gold-i386-gnu-property-notes.patch
|
|
|
-
|
|
|
-# Purpose: Ensure that the 0'th entry in DWARF-5 directory tables generated
|
|
|
-# by gas contains the current working directory.
|
|
|
-# Lifetime: Fixed in 2.38
|
|
|
-Patch18: binutils-dwarf-5-dir0.patch
|
|
|
-
|
|
|
-# Purpose: Ensure that the manual pages are generated.
|
|
|
-# Lifetime: Fixed in 2.38
|
|
|
-#Patch19: binutils-missing-man-pages.patch
|
|
|
-
|
|
|
-# Purpose: Close the file descriptor if there is no archive plugin file
|
|
|
-# descriptor to avoid running out of file descriptors on thin archives
|
|
|
-# with many archive members.
|
|
|
-# Lifetime: Fixed in 2.38
|
|
|
-#Patch20: binutils-bfd-close-fds.patch
|
|
|
-
|
|
|
-# Purpose: Allow the binutils to be configured with any (recent) version of
|
|
|
-# autoconf.
|
|
|
-# Lifetime: Fixed in 2.38 (maybe ?)
|
|
|
-Patch21: binutils-autoconf-version.patch
|
|
|
-
|
|
|
-# Purpose: Set the entry address of shared libraries to 0, so that they can
|
|
|
-# be detected by the loader and not run as an executable.
|
|
|
-# Lifetime: Permanent.
|
|
|
-Patch22: binutils-ld-default-entry-of-0-for-shared.patch
|
|
|
+Patch15: binutils-gold-i386-gnu-property-notes.patch
|
|
|
|
|
|
-# Purpose: Fix a seg-fault compiling the efivar libraries.
|
|
|
-# Lifetime: Fixed in 2.38.
|
|
|
-Patch23: binutils-empty-MIND-string.patch
|
|
|
+# Purpose: Allow the binutils to be configured with any (recent) version of
|
|
|
+# autoconf.
|
|
|
+# Lifetime: Fixed in 2.39 (maybe ?)
|
|
|
+Patch16: binutils-autoconf-version.patch
|
|
|
|
|
|
-# Purpose: Fix ccache test failure introduced with 2.37
|
|
|
-# Lifetime: Fixed in 2.38.
|
|
|
-Patch24: binutils-gas-Use-the-directory-name-in-.file-0.patch
|
|
|
+# Purpose: Stop libtool from inserting useless runpaths into binaries.
|
|
|
+# Lifetime: Who knows.
|
|
|
+Patch17: binutils-libtool-no-rpath.patch
|
|
|
|
|
|
-#----------------------------------------------------------------------------
|
|
|
+%if %{enable_new_dtags}
|
|
|
+# Purpose: Change ld man page so that it says that --enable-new-dtags is the default.
|
|
|
+# Lifetime: Permanent
|
|
|
+Patch18: binutils-update-linker-manual.patch
|
|
|
+%endif
|
|
|
+
|
|
|
+# Purpose: Add a --package-metadata option to the linkers.
|
|
|
+# Lifetime: Fixed in 2.40
|
|
|
+Patch19: binutils-package-metadata.patch
|
|
|
+
|
|
|
+# Purpose: Stop the assembler from generating DIE information for zero-sized functions.
|
|
|
+# Lifetime: Fixed in 2.40
|
|
|
+#Patch20: binutils-gas-dwarf-skip-empty-functions.patch
|
|
|
|
|
|
-Patch1001: binutils-2.26-uio-vine.patch
|
|
|
-Patch2000: CVE-2021-45078.patch
|
|
|
+# Purpose: Stop an infinite loop in the binutils DWARF decoder. (CVE 2022-38128)
|
|
|
+# Lifetime: Fixed in 2.40
|
|
|
+Patch21: binutils-CVE-38128-dwarf-abbrev-parsing.patch
|
|
|
+
|
|
|
+#----------------------------------------------------------------------------
|
|
|
|
|
|
%define gold_arches %ix86 x86_64
|
|
|
|
|
|
-%if 0%{?_with_debug:1}
|
|
|
+%if %{with debug}
|
|
|
# Define this if you want to skip the strip step and preserve debug info.
|
|
|
# Useful for testing.
|
|
|
%define __debug_install_post : > %{_builddir}/%{?buildsubdir}/debugfiles.list
|
|
|
%define debug_package %{nil}
|
|
|
-%define run_testsuite 0%{?_with_testsuite:1}
|
|
|
-%else
|
|
|
-%define run_testsuite 0%{!?_without_testsuite:1}
|
|
|
%endif
|
|
|
|
|
|
-Buildroot: %{_tmppath}/%{name}-%{version}-root
|
|
|
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
|
BuildRequires: texinfo >= 4.0, gettext, flex, bison, zlib-devel
|
|
|
# Required for: ld-bootstrap/bootstrap.exp bootstrap with --static
|
|
|
# It should not be required for: ld-elf/elf.exp static {preinit,init,fini} array
|
|
|
-%if %{run_testsuite}
|
|
|
+%if %{with testsuite}
|
|
|
BuildRequires: dejagnu, zlib-static, glibc-devel, sharutils
|
|
|
#BuildRequires: dejagnu, zlib-static, glibc-static, sharutils
|
|
|
%endif
|
|
@@ -280,6 +280,19 @@ have a stable ABI. Developers starting new projects are strongly encouraged
|
|
|
to consider using libelf instead of BFD.
|
|
|
|
|
|
|
|
|
+%if %{with gprofng}
|
|
|
+
|
|
|
+%package gprofng
|
|
|
+Summary: Next Generating code profiling tool
|
|
|
+Provides: gprofng = %{version}-%{release}
|
|
|
+Requires: binutils >= %{version}
|
|
|
+
|
|
|
+%description gprofng
|
|
|
+Gprofng is the GNU Next Generation profiler for analyzing the performance
|
|
|
+of Linux applications. Gprofng allows you to:
|
|
|
+%endif
|
|
|
+
|
|
|
+
|
|
|
%debug_package
|
|
|
|
|
|
|
|
@@ -287,8 +300,6 @@ to consider using libelf instead of BFD.
|
|
|
%setup -q -n binutils-%{version}
|
|
|
%autopatch -p1
|
|
|
|
|
|
-# We cannot run autotools as there is an exact requirement of autoconf-2.59.
|
|
|
-
|
|
|
# On ppc64 and aarch64, we might use 64KiB pages
|
|
|
sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*ppc.c
|
|
|
sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*aarch64.c
|
|
@@ -311,19 +322,17 @@ do
|
|
|
sed -i -e "2aDEJATOOL = $tool" $tool/Makefile.am
|
|
|
sed -i -e "s/^DEJATOOL = .*/DEJATOOL = $tool/" $tool/Makefile.in
|
|
|
done
|
|
|
-touch */configure
|
|
|
# Touch the .info files so that they are newer then the .texi files and
|
|
|
# hence do not need to be rebuilt. This eliminates the need for makeinfo.
|
|
|
# The -print is there just to confirm that the command is working.
|
|
|
%if %{without docs}
|
|
|
find . -name *.info -print -exec touch {} \;
|
|
|
%endif
|
|
|
-
|
|
|
-# revert development mode
|
|
|
-sed -i -e 's/development=true/development=false/' bfd/development.sh
|
|
|
-
|
|
|
-# use newer autoconf
|
|
|
-sed -i -e 's/2\.69/2.71/' config/override.m4
|
|
|
+# If we are creating the docs, touch the texi files so that the info and
|
|
|
+# man pages will be rebuilt.
|
|
|
+%if %{with docs}
|
|
|
+ find . -name *.texi -print -exec touch {} \;
|
|
|
+%endif
|
|
|
|
|
|
|
|
|
%build
|
|
@@ -331,24 +340,33 @@ echo target is %{binutils_target}
|
|
|
|
|
|
%set_build_flags
|
|
|
|
|
|
-# BZ 1541027 - include the linker flags from redhat-rpm-config as well.
|
|
|
-export LDFLAGS=$RPM_LD_FLAGS
|
|
|
+%if %{with debug}
|
|
|
+export CFLAGS="$CFLAGS -O0 -ggdb2 -Wno-error -D_FORTIFY_SOURCE=0"
|
|
|
+%define enable_shared 0
|
|
|
+%endif
|
|
|
+
|
|
|
%if %{enable_new_dtags}
|
|
|
-export LDFLAGS="$LD_FLAGS -Wl,--enable-new-dtags"
|
|
|
+export LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags"
|
|
|
%endif
|
|
|
|
|
|
-export CFLAGS="$RPM_OPT_FLAGS"
|
|
|
CARGS=
|
|
|
|
|
|
-case %{binutils_target} in i?86*|sparc*|ppc*|s390*|sh*|arm*|aarch64*)
|
|
|
- CARGS="$CARGS --enable-64-bit-bfd"
|
|
|
- ;;
|
|
|
-esac
|
|
|
+%if %{with debuginfod}
|
|
|
+CARGS="$CARGS --with-debuginfod"
|
|
|
+%endif
|
|
|
+
|
|
|
+%ifarch %{ix86} x86_64 ppc %{power64} s390 s390x sh3 sh4 sparc sparc64 arm aarch64 riscv64
|
|
|
+CARGS="$CARGS --enable-64-bit-bfd"
|
|
|
+%endif
|
|
|
|
|
|
-case %{binutils_target} in x86_64*|i?86*|arm*|aarch64*)
|
|
|
- CARGS="$CARGS --enable-targets=x86_64-pep,bpf-unknown-none"
|
|
|
- ;;
|
|
|
-esac
|
|
|
+# Extra targets to build along with the default one.
|
|
|
+#
|
|
|
+# BZ 1920373: Enable PEP support for all targets as the PERF package's
|
|
|
+# testsuite expects to be able to read PE format files ragrdless of
|
|
|
+# the host's architecture.
|
|
|
+#
|
|
|
+# Also enable the BPF target so that strip will work on BPF files.
|
|
|
+CARGS="$CARGS --enable-targets=x86_64-pep,bpf-unknown-none"
|
|
|
|
|
|
%if %{default_relro}
|
|
|
CARGS="$CARGS --enable-relro=yes"
|
|
@@ -356,22 +374,6 @@ esac
|
|
|
CARGS="$CARGS --enable-relro=no"
|
|
|
%endif
|
|
|
|
|
|
-%if 0%{?_with_debug:1}
|
|
|
-CFLAGS="$CFLAGS -O0 -ggdb2 -Wno-error -D_FORTIFY_SOURCE=0"
|
|
|
-%define enable_shared 0
|
|
|
-%endif
|
|
|
-
|
|
|
-# Dependencies are not set up to rebuild the configure files
|
|
|
-# in the subdirectories. So we just rebuild the ones we care
|
|
|
-# about after applying the configure patches
|
|
|
-pushd libiberty
|
|
|
-autoconf
|
|
|
-sed -i -e 's/^ac_aux_dir_candidates=.*$/ac_aux_dir_candidates=../' configure
|
|
|
-popd
|
|
|
-pushd intl
|
|
|
-autoconf
|
|
|
-popd
|
|
|
-
|
|
|
# We could optimize the cross builds size by --enable-shared but the produced
|
|
|
# binaries may be less convenient in the embedded environment.
|
|
|
%configure \
|
|
@@ -391,11 +393,21 @@ popd
|
|
|
--program-prefix=%{cross} \
|
|
|
%endif
|
|
|
--with-system-zlib \
|
|
|
+%if %{with gprofng}
|
|
|
+ --enable-gprofng=yes \
|
|
|
+%else
|
|
|
+ --enable-gprofng=no \
|
|
|
+%endif
|
|
|
%if %{enable_shared}
|
|
|
--enable-shared \
|
|
|
%else
|
|
|
--disable-shared \
|
|
|
%endif
|
|
|
+%if %{enable_deterministic_archives}
|
|
|
+ --enable-deterministic-archives \
|
|
|
+%else
|
|
|
+ --enable-deterministic-archives=no \
|
|
|
+%endif
|
|
|
%if %{enable_lto}
|
|
|
--enable-lto \
|
|
|
%endif
|
|
@@ -417,6 +429,9 @@ popd
|
|
|
--enable-threads=yes \
|
|
|
%else
|
|
|
--enable-threads=no \
|
|
|
+%endif
|
|
|
+%if %{enable_separate_code}
|
|
|
+ --enable-separate-code=yes \
|
|
|
%endif
|
|
|
$CARGS \
|
|
|
--enable-plugins \
|
|
@@ -431,20 +446,23 @@ make %{_smp_mflags} tooldir=%{_prefix} info
|
|
|
%make_build %{_smp_mflags} tooldir=%{_prefix} MAKEINFO=true all
|
|
|
%endif
|
|
|
|
|
|
-# Do not use %%check as it is run after %%install where libbfd.so is rebuild
|
|
|
+# Do not use %%check as it is run after %%install where libbfd.so is rebuilt
|
|
|
# with -fvisibility=hidden no longer being usable in its shared form.
|
|
|
-%if !%{run_testsuite}
|
|
|
+%if %{without testsuite}
|
|
|
echo ====================TESTSUITE DISABLED=========================
|
|
|
%else
|
|
|
+# The GOLD testsuite has lots of problems...
|
|
|
make -k check < /dev/null || :
|
|
|
echo ====================TESTING=========================
|
|
|
cat {gas/testsuite/gas,ld/ld,binutils/binutils}.sum
|
|
|
+%if %{with gold}
|
|
|
if [ -f gold/test-suite.log ]; then
|
|
|
cat gold/test-suite.log
|
|
|
fi
|
|
|
if [ -f gold/testsuite/test-suite.log ]; then
|
|
|
cat gold/testsuite/*.log
|
|
|
fi
|
|
|
+%endif
|
|
|
echo ====================TESTING END=====================
|
|
|
for file in {gas/testsuite/gas,ld/ld,binutils/binutils}.{sum,log}
|
|
|
do
|
|
@@ -453,20 +471,22 @@ done
|
|
|
tar cjf binutils-%{_target_platform}.tar.xz binutils-%{_target_platform}-*.{sum,log}
|
|
|
uuencode binutils-%{_target_platform}.tar.xz binutils-%{_target_platform}.tar.xz
|
|
|
rm -f binutils-%{_target_platform}.tar.xz binutils-%{_target_platform}-*.{sum,log}
|
|
|
+%if %{with gold}
|
|
|
if [ -f gold/testsuite/test-suite.log ]; then
|
|
|
tar cjf binutils-%{_target_platform}-gold.log.tar.xz gold/testsuite/*.log
|
|
|
uuencode binutils-%{_target_platform}-gold.log.tar.xz binutils-%{_target_platform}-gold.log.tar.xz
|
|
|
rm -f binutils-%{_target_platform}-gold.log.tar.xz
|
|
|
fi
|
|
|
%endif
|
|
|
+%endif
|
|
|
|
|
|
|
|
|
%install
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
%if %{with docs}
|
|
|
-%make_install DESTDIR=%{buildroot}
|
|
|
+%make_install
|
|
|
%else
|
|
|
-%make_install DESTDIR=%{buildroot} MAKEINFO=true
|
|
|
+%make_install MAKEINFO=true
|
|
|
%endif
|
|
|
|
|
|
%if %{isnative}
|
|
@@ -476,8 +496,9 @@ make prefix=%{buildroot}%{_prefix} infodir=%{buildroot}%{_infodir} install-info
|
|
|
|
|
|
# Rebuild libiberty.a with -fPIC.
|
|
|
# Future: Remove it together with its header file, projects should bundle it.
|
|
|
-make -C libiberty clean
|
|
|
-make CFLAGS="-g -fPIC $RPM_OPT_FLAGS" -C libiberty
|
|
|
+%make_build -C libiberty clean
|
|
|
+%set_build_flags
|
|
|
+%make_build CFLAGS="-g -fPIC $CFLAGS" -C libiberty
|
|
|
|
|
|
# Rebuild libbfd.a with -fPIC.
|
|
|
# Without the hidden visibility the 3rd party shared libraries would export
|
|
@@ -485,13 +506,25 @@ make CFLAGS="-g -fPIC $RPM_OPT_FLAGS" -C libiberty
|
|
|
make -C bfd clean
|
|
|
make CFLAGS="-g -fPIC $RPM_OPT_FLAGS -fvisibility=hidden" -C bfd
|
|
|
|
|
|
+%if %{enable_new_dtags}
|
|
|
+export LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags"
|
|
|
+%endif
|
|
|
+
|
|
|
+# Rebuild libbfd.a with -fPIC.
|
|
|
+# Without the hidden visibility the 3rd party shared libraries would export
|
|
|
+# the bfd non-stable ABI.
|
|
|
+%make_build -C bfd clean
|
|
|
+%set_build_flags
|
|
|
+%make_build CFLAGS="-g -fPIC $CFLAGS -fvisibility=hidden" -C bfd
|
|
|
+
|
|
|
# Rebuild libopcodes.a with -fPIC.
|
|
|
-make -C opcodes clean
|
|
|
-make CFLAGS="-g -fPIC $RPM_OPT_FLAGS" -C opcodes
|
|
|
+%make_build -C opcodes clean
|
|
|
+%set_build_flags
|
|
|
+%make_build CFLAGS="-g -fPIC $CFLAGS" -C opcodes
|
|
|
|
|
|
-install -m 644 bfd/libbfd.a $RPM_BUILD_ROOT%{_libdir}
|
|
|
-install -m 644 libiberty/libiberty.a $RPM_BUILD_ROOT%{_libdir}
|
|
|
-install -m 644 include/libiberty.h $RPM_BUILD_ROOT%{_prefix}/include
|
|
|
+install -m 644 bfd/libbfd.a %{buildroot}%{_libdir}
|
|
|
+install -m 644 libiberty/libiberty.a %{buildroot}%{_libdir}
|
|
|
+install -m 644 include/libiberty.h %{buildroot}%{_prefix}/include
|
|
|
install -m 644 opcodes/libopcodes.a %{buildroot}%{_libdir}
|
|
|
# Remove Windows/Novell only man pages
|
|
|
rm -f %{buildroot}%{_mandir}/man1/{dlltool,nlmconv,windres,windmc}*
|
|
@@ -501,20 +534,20 @@ rm -f %{buildroot}%{_infodir}/{as,bfd,binutils,gprof,ld}*
|
|
|
%endif
|
|
|
|
|
|
%if %{enable_shared}
|
|
|
-chmod +x $RPM_BUILD_ROOT%{_libdir}/lib*.so*
|
|
|
+chmod +x %{buildroot}%{_libdir}/lib*.so*
|
|
|
%endif
|
|
|
|
|
|
# Prevent programs from linking against libbfd and libopcodes
|
|
|
-# dynamically, as they are change far too often.
|
|
|
-rm -f $RPM_BUILD_ROOT%{_libdir}/lib{bfd,opcodes}.so
|
|
|
+# dynamically, as they are changed far too often.
|
|
|
+rm -f %{buildroot}%{_libdir}/lib{bfd,opcodes}.so
|
|
|
|
|
|
# Remove libtool files, which reference the .so libs
|
|
|
-rm -f $RPM_BUILD_ROOT%{_libdir}/lib{bfd,ctf,ctf-nobfd,opcodes}.la
|
|
|
+rm -f %{buildroot}%{_libdir}/*.la
|
|
|
|
|
|
+# Fix multilib conflicts of generated values by __WORDSIZE-based expressions.
|
|
|
+%ifarch %{ix86} x86_64 ppc %{power64} s390 s390x sh3 sh4 sparc sparc64 arm aarch64 riscv64
|
|
|
# Sanity check --enable-64-bit-bfd really works.
|
|
|
grep '^#define BFD_ARCH_SIZE 64$' %{buildroot}%{_prefix}/include/bfd.h
|
|
|
-# Fix multilib conflicts of generated values by __WORDSIZE-based expressions.
|
|
|
-%ifarch %{ix86} x86_64 ppc %{power64} s390 s390x sh3 sh4 sparc sparc64 arm
|
|
|
sed -i -e '/^#include "ansidecl.h"/{p;s~^.*$~#include <bits/wordsize.h>~;}' \
|
|
|
-e 's/^#define BFD_DEFAULT_TARGET_SIZE \(32\|64\) *$/#define BFD_DEFAULT_TARGET_SIZE __WORDSIZE/' \
|
|
|
-e 's/^#define BFD_HOST_64BIT_LONG [01] *$/#define BFD_HOST_64BIT_LONG (__WORDSIZE == 64)/' \
|
|
@@ -537,7 +570,7 @@ OUTPUT_FORMAT="\
|
|
|
on a multi-architecture system. */
|
|
|
$(gcc $CFLAGS $LDFLAGS -shared -x c /dev/null -o /dev/null -Wl,--verbose -v 2>&1 | sed -n -f "%{SOURCE2}")"
|
|
|
|
|
|
-tee $RPM_BUILD_ROOT%{_libdir}/libbfd.so <<EOH
|
|
|
+tee %{buildroot}%{_libdir}/libbfd.so <<EOH
|
|
|
/* GNU ld script */
|
|
|
|
|
|
$OUTPUT_FORMAT
|
|
@@ -557,26 +590,26 @@ EOH
|
|
|
%endif # !isnative
|
|
|
|
|
|
# This one comes from gcc
|
|
|
-rm -f $RPM_BUILD_ROOT%{_infodir}/dir
|
|
|
-rm -rf $RPM_BUILD_ROOT%{_prefix}/%{binutils_target}
|
|
|
-
|
|
|
-%find_lang binutils
|
|
|
-%find_lang opcodes
|
|
|
-%find_lang bfd
|
|
|
-%find_lang gas
|
|
|
-%find_lang gprof
|
|
|
-cat opcodes.lang >> binutils.lang
|
|
|
-cat bfd.lang >> binutils.lang
|
|
|
-cat gas.lang >> binutils.lang
|
|
|
-cat gprof.lang >> binutils.lang
|
|
|
+rm -f %{buildroot}%{_infodir}/dir
|
|
|
+rm -rf %{buildroot}%{_prefix}/%{binutils_target}
|
|
|
+
|
|
|
+%find_lang %{?cross}binutils
|
|
|
+%find_lang %{?cross}opcodes
|
|
|
+%find_lang %{?cross}bfd
|
|
|
+%find_lang %{?cross}gas
|
|
|
+%find_lang %{?cross}gprof
|
|
|
+cat %{?cross}opcodes.lang >> %{?cross}binutils.lang
|
|
|
+cat %{?cross}bfd.lang >> %{?cross}binutils.lang
|
|
|
+cat %{?cross}gas.lang >> %{?cross}binutils.lang
|
|
|
+cat %{?cross}gprof.lang >> %{?cross}binutils.lang
|
|
|
|
|
|
if [ -x ld/ld-new ]; then
|
|
|
- %find_lang ld
|
|
|
- cat ld.lang >> binutils.lang
|
|
|
+ %find_lang %{?cross}ld
|
|
|
+ cat %{?cross}ld.lang >> %{?cross}binutils.lang
|
|
|
fi
|
|
|
if [ -x gold/ld-new ]; then
|
|
|
- %find_lang gold
|
|
|
- cat gold.lang >> binutils.lang
|
|
|
+ %find_lang %{?cross}gold
|
|
|
+ cat %{?cross}gold.lang >> %{?cross}binutils.lang
|
|
|
fi
|
|
|
|
|
|
/bin/ls %{buildroot}%{_bindir} | sed -e 's|^|%{_bindir}/|' -e '/\/ld$/d' > binutils.list
|
|
@@ -586,56 +619,102 @@ fi
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
|
-%post
|
|
|
-%ifarch %gold_arches
|
|
|
-%__rm -f %{_bindir}/ld
|
|
|
- /sbin/alternatives --install %{_bindir}/ld ld \
|
|
|
- %{_bindir}/ld.bfd %{ld_bfd_priority}
|
|
|
- /sbin/alternatives --install %{_bindir}/ld ld \
|
|
|
- %{_bindir}/ld.gold %{ld_gold_priority}
|
|
|
- /sbin/alternatives --auto ld
|
|
|
-%endif
|
|
|
-
|
|
|
%preun
|
|
|
%ifarch %gold_arches
|
|
|
if [ $1 = 0 ]; then
|
|
|
- /sbi/alternatives --remove ld %{_bindir}/ld.gold
|
|
|
+ /sbin/alternatives --remove ld %{_bindir}/ld.gold
|
|
|
/sbin/alternatives --remove ld %{_bindir}/ld.bfd
|
|
|
fi
|
|
|
%endif
|
|
|
|
|
|
+%post
|
|
|
+%__rm -f %{_bindir}/%{?cross}ld
|
|
|
+/sbin/alternatives --install %{_bindir}/%{?cross}ld %{?cross}ld \
|
|
|
+ %{_bindir}/%{?cross}ld.bfd %{ld_bfd_priority}
|
|
|
+%ifarch %gold_arches
|
|
|
+ /sbin/alternatives --install %{_bindir}/%{?cross}ld %{?cross}ld \
|
|
|
+ %{_bindir}/%{?cross}ld.gold %{ld_gold_priority}
|
|
|
+%endif
|
|
|
+
|
|
|
+# Do not run "alternatives --auto ld" here. Leave the setting to
|
|
|
+# however the user previously had it set. See BZ 1592069 for more details.
|
|
|
+
|
|
|
+/sbin/ldconfig
|
|
|
+
|
|
|
+exit 0
|
|
|
|
|
|
-%files -f binutils.lang -f binutils.list
|
|
|
+
|
|
|
+%files -f binutils.lang
|
|
|
%license COPYING COPYING3 COPYING3.LIB COPYING.LIB
|
|
|
%defattr(-,root,root,-)
|
|
|
%doc README
|
|
|
+%{_bindir}/%{?cross}[!l]*
|
|
|
+%exclude %{_bindir}/gp-*
|
|
|
+%exclude %{_bindir}/gprofng
|
|
|
+# %%verify(symlink) does not work for some reason, so using "owner" instead.
|
|
|
+%verify(owner) %{_bindir}/%{?cross}ld
|
|
|
+%{_bindir}/%{?cross}ld.bfd
|
|
|
%ifarch %gold_arches
|
|
|
-%ghost %{_bindir}/ld
|
|
|
-%else
|
|
|
-%{_bindir}/ld
|
|
|
+%{_bindir}/%{?cross}ld.gold
|
|
|
+%endif
|
|
|
+
|
|
|
+# # Do not export any Windows tools (if they were built)
|
|
|
+# %%exclude %%{_bindir}/%%{?cross}dll*
|
|
|
+# %%exclude %%{_bindir}/%%{?cross}wind*
|
|
|
+
|
|
|
+%if %{with docs}
|
|
|
+%{_mandir}/man1/
|
|
|
+%exclude %{_mandir}/man1/gp-*
|
|
|
+%exclude %{_mandir}/man1/gprofng*
|
|
|
+%if %{isnative}
|
|
|
+%{_infodir}/as.info.*
|
|
|
+%{_infodir}/binutils.info.*
|
|
|
+%{_infodir}/gprof.info.*
|
|
|
+%{_infodir}/ld.info.*
|
|
|
+%{_infodir}/bfd.info.*
|
|
|
+%{_infodir}/ctf-spec.info.*
|
|
|
+%endif
|
|
|
%endif
|
|
|
-%{_mandir}/man1/*
|
|
|
+
|
|
|
%if %{enable_shared}
|
|
|
%{_libdir}/lib*.so
|
|
|
-%{_libdir}/libctf*.so.*
|
|
|
+%{_libdir}/libctf*
|
|
|
%exclude %{_libdir}/libbfd.so
|
|
|
%exclude %{_libdir}/libopcodes.so
|
|
|
-%dir %{_libdir}/bfd-plugins
|
|
|
-%{_libdir}/bfd-plugins/*.so
|
|
|
+%exclude %{_libdir}/libctf.a
|
|
|
+%exclude %{_libdir}/libctf-nobfd.a
|
|
|
+%{_libdir}/bfd-plugins/libdep.so
|
|
|
+%exclude %{_exec_prefix}/lib/debug/%{_libdir}/bfd-plugins/libdep.so-*
|
|
|
%endif
|
|
|
-%{_infodir}/[^b]*info*
|
|
|
-%{_infodir}/binutils*info*
|
|
|
|
|
|
%files devel
|
|
|
%defattr(-,root,root)
|
|
|
%{_prefix}/include/*
|
|
|
+%{_libdir}/lib*.a
|
|
|
%{_libdir}/libbfd.so
|
|
|
%{_libdir}/libopcodes.so
|
|
|
-%{_libdir}/lib*.a
|
|
|
-%{_infodir}/bfd*info*
|
|
|
+
|
|
|
+%if %{with gprofng}
|
|
|
+%files gprofng
|
|
|
+%{_bindir}/gp-*
|
|
|
+%{_bindir}/gprofng
|
|
|
+%{_mandir}/man1/gp-*
|
|
|
+%{_mandir}/man1/gprofng*
|
|
|
+%{_infodir}/gprofng.info.*
|
|
|
+%dir %{_libdir}/gprofng
|
|
|
+%{_libdir}/gprofng/*
|
|
|
+%dir %{_exec_prefix}/lib/debug/%{_libdir}/gprofng
|
|
|
+%{_exec_prefix}/lib/debug/%{_libdir}/gprofng/libgp*
|
|
|
+%{_sysconfdir}/gprofng.rc
|
|
|
+%endif
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
+* Sat Sep 10 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.39-1
|
|
|
+- updated to 2.39.
|
|
|
+- updated Patch00.
|
|
|
+- re-imported patches from rawhide.
|
|
|
+
|
|
|
* Sat Jan 29 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.37-4
|
|
|
- updated Patch00.
|
|
|
|