Blame SPECS/binutils.spec

83c6f5
# rpmbuild parameters:
83c6f5
# --define "binutils_target arm-linux-gnu" to create arm-linux-gnu-binutils.
83c6f5
# --with debug: Build without optimizations and without splitting the debuginfo.
83c6f5
# --without testsuite: Do not run the testsuite.  Default is to run it.
83c6f5
# --with testsuite: Run the testsuite.  Default --with debug is not to run it.
83c6f5
83c6f5
# For DTS-6 on RHEL-6 we only support x86 and x86_64.
83c6f5
# For DTS-6 on RHEL-7 we also support ppc64, ppc64le, s390x and aarch64
83c6f5
83c6f5
%{?scl:%{?scl_package:%scl_package binutils}}
83c6f5
83c6f5
%if 0%{!?binutils_target:1}
83c6f5
%define binutils_target %{_target_platform}
83c6f5
%define isnative 1
83c6f5
%define enable_shared 1
83c6f5
%else
83c6f5
%define cross %{binutils_target}-
83c6f5
%define isnative 0
83c6f5
%define enable_shared 0
83c6f5
%endif
83c6f5
# Disable deterministic archives by default.
83c6f5
# This is for package builders who do not want to have to change
83c6f5
# their build scripts to work with deterministic archives.
83c6f5
%define enable_deterministic_archives 0
83c6f5
# BZ 1342618: Enable support for GCC LTO compilation.
83c6f5
%define enable_lto 1
83c6f5
# Disable the default generation of compressed debug sections.
83c6f5
%define default_compress_debug 0
83c6f5
83c6f5
Summary: A GNU collection of binary utilities
83c6f5
Name: %{?scl_prefix}%{?cross}binutils%{?_with_debug:-debug}
83c6f5
Version: 2.27
83c6f5
Release: 10%{?dist}
83c6f5
License: GPLv3+
83c6f5
Group: Development/Tools
83c6f5
URL: http://sources.redhat.com/binutils
83c6f5
83c6f5
# Note - the Linux Kernel binutils releases are too unstable and contain too
83c6f5
# many controversial patches so we stick with the official FSF version
83c6f5
# instead.
83c6f5
83c6f5
Source: http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.bz2
83c6f5
83c6f5
Source2: binutils-2.19.50.0.1-output-format.sed
83c6f5
83c6f5
Patch01: binutils-2.20.51.0.2-libtool-lib64.patch
83c6f5
Patch02: binutils-2.20.51.0.10-ppc64-pie.patch
83c6f5
Patch03: binutils-2.20.51.0.2-ia64-lib64.patch
83c6f5
Patch04: binutils-2.25-version.patch
83c6f5
Patch05: binutils-2.25-set-long-long.patch
83c6f5
Patch06: binutils-2.20.51.0.10-sec-merge-emit.patch
83c6f5
# Enable -zrelro by default: BZ #621983
83c6f5
Patch07: binutils-2.22.52.0.1-relro-on-by-default.patch
83c6f5
# Local patch - export demangle.h with the binutils-devel rpm.
83c6f5
Patch08: binutils-2.22.52.0.1-export-demangle.h.patch
83c6f5
# Disable checks that config.h has been included before system headers.  BZ #845084
83c6f5
Patch09: binutils-2.22.52.0.4-no-config-h-check.patch
83c6f5
# Fix addr2line to use the dynamic symbol table if it could not find any ordinary symbols.
83c6f5
Patch10: binutils-2.23.52.0.1-addr2line-dynsymtab.patch
83c6f5
# Fix detections little endian PPC shared libraries
83c6f5
Patch11: binutils-2.24-ldforcele.patch
83c6f5
# Import H.J.Lu's Kernel LTO patch.
83c6f5
Patch12: binutils-2.26-lto.patch
83c6f5
Patch13: binutils-2.23.51.0.3-Provide-std-tr1-hash.patch
83c6f5
Patch14: binutils-rh1038339.patch
83c6f5
Patch15: binutils-2.24-rh919508.patch
83c6f5
# Fix the computation of the value for the sh_info field of the .dynsym section.
83c6f5
Patch16: binutils-2.27-local-dynsym-count.patch
83c6f5
# Sort section headers according to increasing section offset.
83c6f5
Patch17: binutils-2.27-monotonic-section-offsets.patch
83c6f5
# Really enable -z relro by default for aarch64
83c6f5
Patch18: binutils-2.27-aarch64-relro-default.patch
83c6f5
# Add support for the Power9 architecture
83c6f5
Patch19: binutils-2.27-power9.patch
83c6f5
83c6f5
Provides: bundled(libiberty)
83c6f5
83c6f5
%define gold_arches %ix86 x86_64 %arm aarch64
83c6f5
83c6f5
%ifarch %gold_arches
83c6f5
%define build_gold	both
83c6f5
%else
83c6f5
%define build_gold	no
83c6f5
%endif
83c6f5
83c6f5
%define alternatives_cmd %{!?scl:%{_sbindir}}%{?scl:%{_root_sbindir}}/alternatives
83c6f5
%define alternatives_cmdline %{alternatives_cmd}%{?scl: --altdir %{_sysconfdir}/alternatives --admindir %{_scl_root}/var/lib/alternatives}
83c6f5
83c6f5
%if 0%{?_with_debug:1}
83c6f5
# Define this if you want to skip the strip step and preserve debug info.
83c6f5
# Useful for testing.
83c6f5
%define __debug_install_post : > %{_builddir}/%{?buildsubdir}/debugfiles.list
83c6f5
%define debug_package %{nil}
83c6f5
%define run_testsuite 0%{?_with_testsuite:1}
83c6f5
%else
83c6f5
%define run_testsuite 0%{!?_without_testsuite:1}
83c6f5
%endif
83c6f5
83c6f5
Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
83c6f5
BuildRequires: texinfo >= 4.0, gettext, flex, bison, zlib-devel
83c6f5
# BZ 920545: We need pod2man in order to build the manual pages.
83c6f5
BuildRequires: /usr/bin/pod2man
83c6f5
# Required for: ld-bootstrap/bootstrap.exp bootstrap with --static
83c6f5
# It should not be required for: ld-elf/elf.exp static {preinit,init,fini} array
83c6f5
%if %{run_testsuite}
83c6f5
# relro_test.sh uses dc which is part of the bc rpm, hence its inclusion here.
83c6f5
BuildRequires: dejagnu, zlib-static, glibc-static, sharutils, bc
83c6f5
%if "%{build_gold}" == "both"
83c6f5
# The GOLD testsuite needs a static libc++
83c6f5
%if 0%{?rhel} >= 7
83c6f5
BuildRequires: libstdc++-static
83c6f5
%endif
83c6f5
%endif
83c6f5
%endif
83c6f5
Conflicts: gcc-c++ < 4.0.0
83c6f5
Requires(post): /sbin/install-info
83c6f5
Requires(preun): /sbin/install-info
83c6f5
%ifarch ia64
83c6f5
Obsoletes: gnupro <= 1117-1
83c6f5
%endif
83c6f5
%{?scl:Requires:%scl_runtime}
83c6f5
83c6f5
# The higher of these two numbers determines the default ld.
83c6f5
%{!?ld_bfd_priority: %global ld_bfd_priority	50}
83c6f5
%{!?ld_gold_priority:%global ld_gold_priority	30}
83c6f5
83c6f5
%if "%{build_gold}" == "both"
83c6f5
Requires(post): coreutils
83c6f5
Requires(post): %{alternatives_cmd}
83c6f5
Requires(preun): %{alternatives_cmd}
83c6f5
%endif
83c6f5
83c6f5
# On ARM EABI systems, we do want -gnueabi to be part of the
83c6f5
# target triple.
83c6f5
%ifnarch %{arm}
83c6f5
%define _gnu %{nil}
83c6f5
%endif
83c6f5
83c6f5
%description
83c6f5
Binutils is a collection of binary utilities, including ar (for
83c6f5
creating, modifying and extracting from archives), as (a family of GNU
83c6f5
assemblers), gprof (for displaying call graph profile data), ld (the
83c6f5
GNU linker), nm (for listing symbols from object files), objcopy (for
83c6f5
copying and translating object files), objdump (for displaying
83c6f5
information from object files), ranlib (for generating an index for
83c6f5
the contents of an archive), readelf (for displaying detailed
83c6f5
information about binary files), size (for listing the section sizes
83c6f5
of an object or archive file), strings (for listing printable strings
83c6f5
from files), strip (for discarding symbols), and addr2line (for
83c6f5
converting addresses to file and line).
83c6f5
83c6f5
%package devel
83c6f5
Summary: BFD and opcodes static and dynamic libraries and header files
83c6f5
Group: System Environment/Libraries
83c6f5
Provides: binutils-static = %{version}-%{release}
83c6f5
Requires(post): /sbin/install-info
83c6f5
Requires(preun): /sbin/install-info
83c6f5
Requires: %{?scl_prefix}binutils = %{version}-%{release}
83c6f5
Requires: zlib-devel
83c6f5
# BZ 1215242: We need touch...
83c6f5
Requires: coreutils
83c6f5
83c6f5
%description devel
83c6f5
This package contains BFD and opcodes static and dynamic libraries.
83c6f5
83c6f5
The dynamic libraries are in this package, rather than a seperate
83c6f5
base package because they are actually linker scripts that force
83c6f5
the use of the static libraries.  This is because the API of the
83c6f5
BFD library is too unstable to be used dynamically.
83c6f5
83c6f5
The static libraries are here because they are now needed by the
83c6f5
dynamic libraries.
83c6f5
83c6f5
Developers starting new projects are strongly encouraged to consider
83c6f5
using libelf instead of BFD.
83c6f5
83c6f5
%prep
83c6f5
%setup -q -n binutils-%{version}
83c6f5
%patch01 -p1 -b .libtool-lib64~
83c6f5
%patch02 -p1 -b .ppc64-pie~
83c6f5
%ifarch ia64
83c6f5
%if "%{_lib}" == "lib64"
83c6f5
%patch03 -p1 -b .ia64-lib64~
83c6f5
%endif
83c6f5
%endif
83c6f5
%patch04 -p1 -b .version~
83c6f5
%patch05 -p1 -b .set-long-long~
83c6f5
%patch06 -p1 -b .sec-merge-emit~
83c6f5
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
83c6f5
%patch07 -p1 -b .relro~
83c6f5
%endif
83c6f5
%patch08 -p1 -b .export-demangle-h~
83c6f5
%patch09 -p1 -b .no-config-h-check~
83c6f5
%patch10 -p1 -b .addr2line~
83c6f5
%ifarch ppc64le
83c6f5
%patch11 -p1 -b .ldforcele~
83c6f5
%endif
83c6f5
%patch12 -p1 -b .kernel-lto~
83c6f5
%patch13 -p1 -b .provide-hash~
83c6f5
%patch14 -p1 -b .manpage~
83c6f5
%patch15 -p1 
83c6f5
%patch16 -p1 
83c6f5
%patch17 -p1 
83c6f5
%patch18 -p1 
83c6f5
%patch19 -p1 
83c6f5
83c6f5
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
83c6f5
83c6f5
# On ppc64 and aarch64, we might use 64KiB pages
83c6f5
sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*ppc.c
83c6f5
sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*aarch64.c
83c6f5
sed -i -e '/common_pagesize/s/4 /64 /' gold/powerpc.cc
83c6f5
sed -i -e '/pagesize/s/0x1000,/0x10000,/' gold/aarch64.cc
83c6f5
# LTP sucks
83c6f5
perl -pi -e 's/i\[3-7\]86/i[34567]86/g' */conf*
83c6f5
sed -i -e 's/%''{release}/%{release}/g' bfd/Makefile{.am,.in}
83c6f5
sed -i -e '/^libopcodes_la_\(DEPENDENCIES\|LIBADD\)/s,$, ../bfd/libbfd.la,' opcodes/Makefile.{am,in}
83c6f5
# Build libbfd.so and libopcodes.so with -Bsymbolic-functions if possible.
83c6f5
if gcc %{optflags} -v --help 2>&1 | grep -q -- -Bsymbolic-functions; then
83c6f5
sed -i -e 's/^libbfd_la_LDFLAGS = /&-Wl,-Bsymbolic-functions /' bfd/Makefile.{am,in}
83c6f5
sed -i -e 's/^libopcodes_la_LDFLAGS = /&-Wl,-Bsymbolic-functions /' opcodes/Makefile.{am,in}
83c6f5
fi
83c6f5
# $PACKAGE is used for the gettext catalog name.
83c6f5
sed -i -e 's/^ PACKAGE=/ PACKAGE=%{?cross}/' */configure
83c6f5
# Undo the name change to run the testsuite.
83c6f5
for tool in binutils gas ld
83c6f5
do
83c6f5
  sed -i -e "2aDEJATOOL = $tool" $tool/Makefile.am
83c6f5
  sed -i -e "s/^DEJATOOL = .*/DEJATOOL = $tool/" $tool/Makefile.in
83c6f5
done
83c6f5
touch */configure
83c6f5
83c6f5
%ifarch %{power64}
83c6f5
%define _target_platform %{_arch}-%{_vendor}-%{_host_os}
83c6f5
%endif
83c6f5
83c6f5
%build
83c6f5
echo target is %{binutils_target}
83c6f5
%ifarch %{power64}
83c6f5
#CFLAGS=`echo $RPM_OPT_FLAGS | sed -e -s "s/-Werror//g"`
83c6f5
#export CFLAGS
83c6f5
export CFLAGS="$RPM_OPT_FLAGS -Wno-error"
83c6f5
%else
83c6f5
export CFLAGS="$RPM_OPT_FLAGS"
83c6f5
%endif
83c6f5
CARGS=
83c6f5
83c6f5
case %{binutils_target} in i?86*|sparc*|ppc*|s390*|sh*|arm*|aarch64*)
83c6f5
  CARGS="$CARGS --enable-64-bit-bfd"
83c6f5
  ;;
83c6f5
esac
83c6f5
83c6f5
case %{binutils_target} in ia64*)
83c6f5
  CARGS="$CARGS --enable-targets=i386-linux"
83c6f5
  ;;
83c6f5
esac
83c6f5
83c6f5
case %{binutils_target} in ppc*|ppc64*)
83c6f5
  CARGS="$CARGS --enable-targets=spu"
83c6f5
  ;;
83c6f5
esac
83c6f5
83c6f5
case %{binutils_target} in ppc64-*)
83c6f5
  CARGS="$CARGS --enable-targets=powerpc64le-linux"
83c6f5
  ;;
83c6f5
esac
83c6f5
83c6f5
case %{binutils_target} in  ppc64le*)
83c6f5
    CARGS="$CARGS --enable-targets=powerpc-linux"
83c6f5
    ;;
83c6f5
esac
83c6f5
83c6f5
%if 0%{?_with_debug:1}
83c6f5
CFLAGS="$CFLAGS -O0 -ggdb2 -Wno-error -D_FORTIFY_SOURCE=0"
83c6f5
%define enable_shared 0
83c6f5
%endif
83c6f5
83c6f5
# We could optimize the cross builds size by --enable-shared but the produced
83c6f5
# binaries may be less convenient in the embedded environment.
83c6f5
# The seemingly unncessary --with-sysroot argument is merely meant to enable
83c6f5
# sysroot capabilities in the resulting executables.  That allows customers
83c6f5
# to then use the sysroot capability to set up host-x-host build environments
83c6f5
# easier.
83c6f5
%configure \
83c6f5
  --build=%{_target_platform} --host=%{_target_platform} \
83c6f5
  --target=%{binutils_target} \
83c6f5
  --with-sysroot=/ \
83c6f5
%ifarch %gold_arches
83c6f5
%if "%{build_gold}" == "both"
83c6f5
  --enable-gold=default --enable-ld \
83c6f5
%else
83c6f5
  --enable-gold \
83c6f5
%endif
83c6f5
%endif
83c6f5
%if %{isnative}
83c6f5
  --with-sysroot=/ \
83c6f5
%else
83c6f5
  --enable-targets=%{_host} \
83c6f5
  --with-sysroot=%{_prefix}/%{binutils_target}/sys-root \
83c6f5
  --program-prefix=%{cross} \
83c6f5
%endif
83c6f5
%if %{enable_shared}
83c6f5
  --enable-shared \
83c6f5
%else
83c6f5
  --disable-shared \
83c6f5
%endif
83c6f5
%if %{enable_deterministic_archives}
83c6f5
  --enable-deterministic-archives \
83c6f5
%else    
83c6f5
  --enable-deterministic-archives=no \
83c6f5
%endif
83c6f5
%if %{enable_lto}
83c6f5
  --enable-lto \
83c6f5
%endif
83c6f5
%if %{default_compress_debug}
83c6f5
  --enable-compressed-debug-sections=all \
83c6f5
%else
83c6f5
  --enable-compressed-debug-sections=none \
83c6f5
%endif
83c6f5
  $CARGS \
83c6f5
  --enable-plugins \
83c6f5
  --with-bugurl=http://bugzilla.redhat.com/bugzilla/
83c6f5
83c6f5
make %{_smp_mflags} tooldir=%{_prefix} all
83c6f5
make %{_smp_mflags} tooldir=%{_prefix} info
83c6f5
83c6f5
# Do not use %%check as it is run after %%install where libbfd.so is rebuild
83c6f5
# with -fvisibility=hidden no longer being usable in its shared form.
83c6f5
%if !%{run_testsuite}
83c6f5
echo ====================TESTSUITE DISABLED=========================
83c6f5
%else
83c6f5
make -k check < /dev/null || :
83c6f5
echo ====================TESTING=========================
83c6f5
cat {gas/testsuite/gas,ld/ld,binutils/binutils}.sum
83c6f5
echo ====================TESTING END=====================
83c6f5
for file in {gas/testsuite/gas,ld/ld,binutils/binutils}.{sum,log}
83c6f5
do
83c6f5
  ln $file binutils-%{_target_platform}-$(basename $file) || :
83c6f5
done
83c6f5
tar cjf binutils-%{_target_platform}.tar.bz2 binutils-%{_target_platform}-*.{sum,log}
83c6f5
uuencode binutils-%{_target_platform}.tar.bz2 binutils-%{_target_platform}.tar.bz2
83c6f5
rm -f binutils-%{_target_platform}.tar.bz2 binutils-%{_target_platform}-*.{sum,log}
83c6f5
%endif
83c6f5
83c6f5
%install
83c6f5
rm -rf %{buildroot}
83c6f5
make install DESTDIR=%{buildroot}
83c6f5
%if %{isnative}
83c6f5
make prefix=%{buildroot}%{_prefix} infodir=%{buildroot}%{_infodir} install-info
83c6f5
83c6f5
# Rebuild libiberty.a with -fPIC.
83c6f5
# Future: Remove it together with its header file, projects should bundle it.
83c6f5
make -C libiberty clean
83c6f5
make CFLAGS="-g -fPIC $RPM_OPT_FLAGS" -C libiberty
83c6f5
83c6f5
# Rebuild libbfd.a with -fPIC.
83c6f5
# Without the hidden visibility the 3rd party shared libraries would export
83c6f5
# the bfd non-stable ABI.
83c6f5
make -C bfd clean
83c6f5
make CFLAGS="-g -fPIC $RPM_OPT_FLAGS -fvisibility=hidden" -C bfd
83c6f5
83c6f5
# Rebuild libopcodes.a with -fPIC.
83c6f5
make -C opcodes clean
83c6f5
make CFLAGS="-g -fPIC $RPM_OPT_FLAGS" -C opcodes
83c6f5
83c6f5
install -m 644 bfd/libbfd.a %{buildroot}%{_libdir}
83c6f5
install -m 644 libiberty/libiberty.a %{buildroot}%{_libdir}
83c6f5
install -m 644 include/libiberty.h %{buildroot}%{_prefix}/include
83c6f5
install -m 644 opcodes/libopcodes.a %{buildroot}%{_libdir}
83c6f5
# Remove Windows/Novell only man pages
83c6f5
rm -f %{buildroot}%{_mandir}/man1/{dlltool,nlmconv,windmc,windres}*
83c6f5
83c6f5
%if %{enable_shared}
83c6f5
chmod +x %{buildroot}%{_libdir}/lib*.so*
83c6f5
%endif
83c6f5
83c6f5
# Prevent programs from linking against libbfd and libopcodes
83c6f5
# dynamically, as they are change far too often.
83c6f5
rm -f %{buildroot}%{_libdir}/lib{bfd,opcodes}.so
83c6f5
83c6f5
# Remove libtool files, which reference the .so libs
83c6f5
rm -f %{buildroot}%{_libdir}/lib{bfd,opcodes}.la
83c6f5
83c6f5
# Sanity check --enable-64-bit-bfd really works.
83c6f5
grep '^#define BFD_ARCH_SIZE 64$' %{buildroot}%{_prefix}/include/bfd.h
83c6f5
# Fix multilib conflicts of generated values by __WORDSIZE-based expressions.
83c6f5
%ifarch %{ix86} x86_64 ppc %{power64} s390 s390x sh3 sh4 sparc sparc64 arm
83c6f5
sed -i -e '/^#include "ansidecl.h"/{p;s~^.*$~#include <bits/wordsize.h>~;}' \
83c6f5
    -e 's/^#define BFD_DEFAULT_TARGET_SIZE \(32\|64\) *$/#define BFD_DEFAULT_TARGET_SIZE __WORDSIZE/' \
83c6f5
    -e 's/^#define BFD_HOST_64BIT_LONG [01] *$/#define BFD_HOST_64BIT_LONG (__WORDSIZE == 64)/' \
83c6f5
    -e 's/^#define BFD_HOST_64_BIT \(long \)\?long *$/#if __WORDSIZE == 32\
83c6f5
#define BFD_HOST_64_BIT long long\
83c6f5
#else\
83c6f5
#define BFD_HOST_64_BIT long\
83c6f5
#endif/' \
83c6f5
    -e 's/^#define BFD_HOST_U_64_BIT unsigned \(long \)\?long *$/#define BFD_HOST_U_64_BIT unsigned BFD_HOST_64_BIT/' \
83c6f5
    %{buildroot}%{_prefix}/include/bfd.h
83c6f5
%endif
83c6f5
touch -r bfd/bfd-in2.h %{buildroot}%{_prefix}/include/bfd.h
83c6f5
83c6f5
# Generate .so linker scripts for dependencies; imported from glibc/Makerules:
83c6f5
83c6f5
# This fragment of linker script gives the OUTPUT_FORMAT statement
83c6f5
# for the configuration we are building.
83c6f5
OUTPUT_FORMAT="\
83c6f5
/* Ensure this .so library will not be used by a link for a different format
83c6f5
   on a multi-architecture system.  */
83c6f5
$(gcc $CFLAGS $LDFLAGS -shared -x c /dev/null -o /dev/null -Wl,--verbose -v 2>&1 | sed -n -f "%{SOURCE2}")"
83c6f5
83c6f5
tee %{buildroot}%{_libdir}/libbfd.so <
83c6f5
/* GNU ld script */
83c6f5
83c6f5
$OUTPUT_FORMAT
83c6f5
83c6f5
/* The libz dependency is unexpected by legacy build scripts.  */
83c6f5
/* The libdl dependency is for plugin support.  (BZ 889134)  */
83c6f5
INPUT ( %{_libdir}/libbfd.a -liberty -lz -ldl )
83c6f5
EOH
83c6f5
83c6f5
tee %{buildroot}%{_libdir}/libopcodes.so <
83c6f5
/* GNU ld script */
83c6f5
83c6f5
$OUTPUT_FORMAT
83c6f5
83c6f5
INPUT ( %{_libdir}/libopcodes.a -lbfd )
83c6f5
EOH
83c6f5
83c6f5
%else # !%{isnative}
83c6f5
# For cross-binutils we drop the documentation.
83c6f5
rm -rf %{buildroot}%{_infodir}
83c6f5
# We keep these as one can have native + cross binutils of different versions.
83c6f5
#rm -rf %{buildroot}%{_prefix}/share/locale
83c6f5
#rm -rf %{buildroot}%{_mandir}
83c6f5
rm -rf %{buildroot}%{_libdir}/libiberty.a
83c6f5
%endif # !%{isnative}
83c6f5
83c6f5
# This one comes from gcc
83c6f5
rm -f %{buildroot}%{_infodir}/dir
83c6f5
rm -rf %{buildroot}%{_prefix}/%{binutils_target}
83c6f5
83c6f5
%find_lang %{?cross}binutils
83c6f5
%find_lang %{?cross}opcodes
83c6f5
%find_lang %{?cross}bfd
83c6f5
%find_lang %{?cross}gas
83c6f5
%find_lang %{?cross}gprof
83c6f5
cat %{?cross}opcodes.lang >> %{?cross}binutils.lang
83c6f5
cat %{?cross}bfd.lang >> %{?cross}binutils.lang
83c6f5
cat %{?cross}gas.lang >> %{?cross}binutils.lang
83c6f5
cat %{?cross}gprof.lang >> %{?cross}binutils.lang
83c6f5
83c6f5
if [ -x ld/ld-new ]; then
83c6f5
  %find_lang %{?cross}ld
83c6f5
  cat %{?cross}ld.lang >> %{?cross}binutils.lang
83c6f5
fi
83c6f5
if [ -x gold/ld-new ]; then
83c6f5
  %find_lang %{?cross}gold
83c6f5
  cat %{?cross}gold.lang >> %{?cross}binutils.lang
83c6f5
fi
83c6f5
83c6f5
%clean
83c6f5
rm -rf %{buildroot}
83c6f5
83c6f5
%post
83c6f5
%if "%{build_gold}" == "both"
83c6f5
%__rm -f %{_bindir}/%{?cross}ld
83c6f5
%{alternatives_cmdline} --install %{_bindir}/%{?cross}ld %{?cross}ld \
83c6f5
  %{_bindir}/%{?cross}ld.bfd %{ld_bfd_priority}
83c6f5
%{alternatives_cmdline} --install %{_bindir}/%{?cross}ld %{?cross}ld \
83c6f5
  %{_bindir}/%{?cross}ld.gold %{ld_gold_priority}
83c6f5
%{alternatives_cmdline} --auto %{?cross}ld
83c6f5
%endif
83c6f5
%if %{isnative}
83c6f5
/sbin/ldconfig
83c6f5
# For --excludedocs:
83c6f5
if [ -e %{_infodir}/binutils.info.gz ]
83c6f5
then
83c6f5
  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/as.info.gz
83c6f5
  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz
83c6f5
  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz
83c6f5
  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/ld.info.gz
83c6f5
fi
83c6f5
%endif # %{isnative}
83c6f5
exit 0
83c6f5
83c6f5
%preun
83c6f5
%if "%{build_gold}" == "both"
83c6f5
if [ $1 = 0 ]; then
83c6f5
  %{alternatives_cmdline} --remove %{?cross}ld %{_bindir}/%{?cross}ld.bfd
83c6f5
  %{alternatives_cmdline} --remove %{?cross}ld %{_bindir}/%{?cross}ld.gold
83c6f5
fi
83c6f5
%endif
83c6f5
%if %{isnative}
83c6f5
if [ $1 = 0 ]; then
83c6f5
  if [ -e %{_infodir}/binutils.info.gz ]
83c6f5
  then
83c6f5
    /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/as.info.gz
83c6f5
    /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz
83c6f5
    /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz
83c6f5
    /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz
83c6f5
  fi
83c6f5
fi
83c6f5
%endif
83c6f5
exit 0
83c6f5
83c6f5
%if %{isnative}
83c6f5
%postun -p /sbin/ldconfig
83c6f5
%endif # %{isnative}
83c6f5
83c6f5
%files -f %{?cross}binutils.lang
83c6f5
%defattr(-,root,root,-)
83c6f5
%doc README
83c6f5
%{_bindir}/%{?cross}[!l]*
83c6f5
%if "%{build_gold}" == "both"
83c6f5
%{_bindir}/%{?cross}ld.*
83c6f5
%ghost %{_bindir}/%{?cross}ld
83c6f5
%else
83c6f5
%{_bindir}/%{?cross}ld*
83c6f5
%endif
83c6f5
%{_mandir}/man1/*
83c6f5
%if %{enable_shared}
83c6f5
%{_libdir}/lib*.so
83c6f5
%exclude %{_libdir}/libbfd.so
83c6f5
%exclude %{_libdir}/libopcodes.so
83c6f5
%endif
83c6f5
83c6f5
%if %{isnative}
83c6f5
%{_infodir}/[^b]*info*
83c6f5
%{_infodir}/binutils*info*
83c6f5
83c6f5
%files devel
83c6f5
%defattr(-,root,root,-)
83c6f5
%{_prefix}/include/*
83c6f5
%{_libdir}/lib*.a
83c6f5
%{_libdir}/libbfd.so
83c6f5
%{_libdir}/libopcodes.so
83c6f5
%{_infodir}/bfd*info*
83c6f5
83c6f5
%endif # %{isnative}
83c6f5
83c6f5
%changelog
83c6f5
* Wed Sep 28 2016 Nick Clifton  <nickc@redhat.com> 2.27-10
83c6f5
- Use correct default sysroot for native targets.
83c6f5
- Add Power9 ISA 3.0 support.
83c6f5
83c6f5
* Mon Sep 05 2016 Carlos O'Donell <carlos@redhat.com>  2.27-9
83c6f5
- Enable '--sysroot' option support for all configurations.
83c6f5
83c6f5
* Thu Sep 01 2016 Nick Clifton  <nickc@redhat.com> 2.27-8
83c6f5
- Properly disable the default generation of compressed debug sections.
83c6f5
  (#1366182)
83c6f5
83c6f5
* Thu Aug 18 2016 Nick Clifton  <nickc@redhat.com> 2.27-7
83c6f5
- Allow -z relro to be enabled by default for the AArch64 target.
83c6f5
  (#1367862)
83c6f5
83c6f5
* Wed Aug 17 2016 Nick Clifton  <nickc@redhat.com> 2.27-6
83c6f5
- Move .shstrtab section to end of section list so that the monotonic ordering of section offsets is restored.
83c6f5
  (#1366145)
83c6f5
83c6f5
* Fri Aug 12 2016 Nick Clifton  <nickc@redhat.com> 2.27-5
83c6f5
- Fix the computation of the sh_info field in the header of the .dynsym section.
83c6f5
  (#1366185)
83c6f5
83c6f5
* Thu Aug 04 2016 Nick Clifton  <nickc@redhat.com> 2.27-4
83c6f5
- Rebase on official FSF binutils 2.27 release.
83c6f5
  (#1358353)
83c6f5
83c6f5
* Thu Jul 21 2016 Nick Clifton  <nickc@redhat.com> 2.27-3
83c6f5
- Version bump so that the Brew build can be rerun, this time including ppc64 (big-endian)
83c6f5
  (#1358353)
83c6f5
83c6f5
* Wed Jul 20 2016 Nick Clifton  <nickc@redhat.com> 2.27-2
83c6f5
- Remove sim sources from tarball.
83c6f5
  (#1358353)
83c6f5
83c6f5
* Mon Jul 18 2016 Nick Clifton  <nickc@redhat.com> 2.27-1
83c6f5
- Rebase on FSF binutils 2.27 release. (#1356661)
83c6f5
- Retire: binutils-2.20.51.0.10-copy-osabi.patch
83c6f5
- Retire: binutils-2.23.2-aarch64-em.patch
83c6f5
- Retire: binutils-2.23.51.0.3-arm-ldralt.patch
83c6f5
- Retire: binutils-2.23.52.0.1-revert-pr15149.patch
83c6f5
- Retire: binutils-2.25.1-gold-testsuite-fixes.patch
83c6f5
- Retire: binutils-2.25-kernel-ld-r.bugfix.patch
83c6f5
- Retire: binutils-2.25-kernel-ld-r.patch
83c6f5
- Retire: binutils-2.25-only-keep-debug.patch
83c6f5
- Retire: binutils-2.25-x86_64-pie-relocs.patch
83c6f5
- Retire: binutils-pr18879.patch
83c6f5
- Retire: binutils-rh1224751.patch
83c6f5
- Retire: binutils-rh1309347.patch
83c6f5
- Retire: binutils-rh895241.patch
83c6f5
83c6f5
* Mon Apr 04 2016 Patsy Franklin <pfrankli@redhat.com> 2.25.1-10
83c6f5
- Fix a case where a string was being used after the memory
83c6f5
  containing the string had been freed.
83c6f5
83c6f5
* Wed Mar 02 2016 Nick Clifton <nickc@redhat.com> 2.25.1-9
83c6f5
- Bump release number by 2 in order to enable build.
83c6f5
83c6f5
* Wed Mar 02 2016 Nick Clifton <nickc@redhat.com> 2.25.1-7
83c6f5
- Fix GOLD testsuite failures.
83c6f5
  (#1312376)
83c6f5
83c6f5
* Thu Feb 25 2016 Nick Clifton <nickc@redhat.com> 2.25.1-6
83c6f5
- Change ar's default to be the creation of non-deterministic archives.
83c6f5
83c6f5
* Thu Feb 18 2016 Nick Clifton <nickc@redhat.com> 2.25.1-4
83c6f5
- Add support for Intel Memory Protection Key instructions.
83c6f5
  (#1309347)
83c6f5
83c6f5
* Thu Feb 04 2016 Nick Clifton <nickc@redhat.com> 2.25.1-2
83c6f5
- Import patch for FSF PR 18879
83c6f5
  (#1260034)
83c6f5
83c6f5
* Thu Jan 14 2016 Nick Clifton <nickc@redhat.com> 2.25.1-1
83c6f5
- Rebase on FSF binutils 2.25.1 release.
83c6f5
- Retire patch binutils-2.25-x86_64-pie-relocs.patch
83c6f5
83c6f5
* Tue Sep 22 2015 Nick Clifton <nickc@redhat.com> 2.25-10
83c6f5
- Improved patch to preserve the sh_link and sh_info fields in stripped ELF sections.
83c6f5
  (#1246390)
83c6f5
83c6f5
* Wed Aug 5 2015 Nick Clifton <nickc@redhat.com> 2.25-9
83c6f5
- Import patch from FSF to preserve the sh_link and sh_info fields in stripped ELF sections.
83c6f5
  (#1246390)
83c6f5
83c6f5
* Tue Aug 4 2015 Jeff Law <law@redhat.com> 2.25-8
83c6f5
- Backport Cary's patch to silence pedantic warning in gold
83c6f5
  (#895241)
83c6f5
83c6f5
* Thu Jun 4 2015 Jeff Law <law@redhat.com> 2.25-7
83c6f5
- Resync with Fedora (binutils-2.25)
83c6f5
  Reapply DTS specific patches
83c6f5
  Backport testsuite patch to fix gold testsuite failure
83c6f5