2007-10-09 04:28:58 +02:00
|
|
|
#
|
2012-02-15 12:33:41 +01:00
|
|
|
# spec file for package cross-hppa-binutils
|
2007-10-09 04:28:58 +02:00
|
|
|
#
|
2017-02-07 12:42:42 +01:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
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.
|
|
|
|
|
2007-10-09 04:28:58 +02:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
2012-04-19 13:30:58 +02:00
|
|
|
|
|
|
|
|
2012-06-18 21:15:24 +02:00
|
|
|
Name: cross-hppa-binutils
|
|
|
|
ExcludeArch: hppa
|
2012-02-15 12:33:41 +01:00
|
|
|
%define cross 1
|
|
|
|
%define TARGET hppa
|
2012-01-26 13:50:17 +01:00
|
|
|
BuildRequires: bison
|
|
|
|
BuildRequires: dejagnu
|
|
|
|
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
|
2011-01-12 12:42:34 +01:00
|
|
|
# for some gold tests
|
|
|
|
BuildRequires: bc
|
2009-11-27 12:33:30 +01:00
|
|
|
%if 0%{suse_version} > 1110
|
|
|
|
BuildRequires: zlib-devel-static
|
|
|
|
%else
|
|
|
|
BuildRequires: zlib-devel
|
|
|
|
%endif
|
- Update to binutils 2.28.
* Add support for locating separate debug info files using the build-id
method, where the separate file has a name based upon the build-id of
the original file.
* This version of binutils fixes a problem with PowerPC VLE 16A and 16D
relocations which were functionally swapped, for example,
R_PPC_VLE_HA16A performed like R_PPC_VLE_HA16D while R_PPC_VLE_HA16D
performed like R_PPC_VLE_HA16A. This could have been fixed by
renumbering relocations, which would keep object files created by an
older version of gas compatible with a newer ld. However, that would
require an ABI update, affecting other assemblers and linkers that
create and process the relocations correctly. It is recommended that
all VLE object files be recompiled, but ld can modify the relocations
if --vle-reloc-fixup is passed to ld. If the new ld command line
option is not used, ld will ld warn on finding relocations inconsistent
with the instructions being relocated.
* The nm program has a new command line option (--with-version-strings)
which will display a symbol's version information, if any, after the
symbol's name.
* The ARC port of objdump now accepts a -M option to specify the extra
instruction class(es) that should be disassembled.
* The --remove-section option for objcopy and strip now accepts section
patterns starting with an exclamation point to indicate a non-matching
section. A non-matching section is removed from the set of sections
matched by an earlier --remove-section pattern.
* The --only-section option for objcopy now accepts section patterns
starting with an exclamation point to indicate a non-matching section.
A non-matching section is removed from the set of sections matched by
an earlier --only-section pattern.
* New --remove-relocations=SECTIONPATTERN option for objcopy and strip.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=231
2017-03-08 12:39:36 +01:00
|
|
|
Version: 2.28
|
2012-01-26 13:50:17 +01:00
|
|
|
Release: 0
|
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
|
|
|
|
%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
|
|
|
|
# handle all binary object formats supported by SuSE (and a few more)
|
2013-11-29 16:17:31 +01:00
|
|
|
%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64
|
2007-10-09 04:28:58 +02:00
|
|
|
%define build_multitarget 1
|
|
|
|
%else
|
|
|
|
%define build_multitarget 0
|
|
|
|
%endif
|
2013-11-29 16:17:31 +01:00
|
|
|
%define target_list aarch64 alpha armv5l armv6l armv7l armv8l hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le s390 s390x sh4 sparc sparc64 x86_64
|
2007-10-09 04:28:58 +02:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
Url: http://www.gnu.org/software/binutils/
|
|
|
|
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
|
|
|
%define binutils_version %(echo %version | sed 's/\\.[0-9]\\{8\\}$//')
|
2009-08-21 16:21:10 +02:00
|
|
|
Summary: GNU Binutils
|
2012-01-26 13:50:17 +01:00
|
|
|
License: GFDL-1.3 and GPL-3.0+
|
|
|
|
Group: Development/Tools/Building
|
2007-10-09 04:28:58 +02:00
|
|
|
Source: binutils-%{binutils_version}.tar.bz2
|
|
|
|
Source1: pre_checkin.sh
|
|
|
|
Source2: README.First-for.SuSE.packagers
|
2010-01-14 15:24:23 +01:00
|
|
|
Source3: baselibs.conf
|
- Update to binutils 2.28.
* Add support for locating separate debug info files using the build-id
method, where the separate file has a name based upon the build-id of
the original file.
* This version of binutils fixes a problem with PowerPC VLE 16A and 16D
relocations which were functionally swapped, for example,
R_PPC_VLE_HA16A performed like R_PPC_VLE_HA16D while R_PPC_VLE_HA16D
performed like R_PPC_VLE_HA16A. This could have been fixed by
renumbering relocations, which would keep object files created by an
older version of gas compatible with a newer ld. However, that would
require an ABI update, affecting other assemblers and linkers that
create and process the relocations correctly. It is recommended that
all VLE object files be recompiled, but ld can modify the relocations
if --vle-reloc-fixup is passed to ld. If the new ld command line
option is not used, ld will ld warn on finding relocations inconsistent
with the instructions being relocated.
* The nm program has a new command line option (--with-version-strings)
which will display a symbol's version information, if any, after the
symbol's name.
* The ARC port of objdump now accepts a -M option to specify the extra
instruction class(es) that should be disassembled.
* The --remove-section option for objcopy and strip now accepts section
patterns starting with an exclamation point to indicate a non-matching
section. A non-matching section is removed from the set of sections
matched by an earlier --remove-section pattern.
* The --only-section option for objcopy now accepts section patterns
starting with an exclamation point to indicate a non-matching section.
A non-matching section is removed from the set of sections matched by
an earlier --only-section pattern.
* New --remove-relocations=SECTIONPATTERN option for objcopy and strip.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=231
2017-03-08 12:39:36 +01:00
|
|
|
Patch: binutils-2.28-branch.diff
|
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
|
|
|
|
Patch7: ld-dtags.diff
|
|
|
|
Patch8: ld-relro.diff
|
|
|
|
Patch9: testsuite.diff
|
2011-01-11 14:41:17 +01:00
|
|
|
Patch10: enable-targets-gold.diff
|
2007-10-09 04:28:58 +02:00
|
|
|
Patch11: use-hashtype-both-by-default.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
|
2011-07-11 16:01:45 +02:00
|
|
|
Patch18: gold-depend-on-opcodes.diff
|
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
|
2017-02-24 11:51:58 +01:00
|
|
|
# Backport 758d96d834ba725461a
|
|
|
|
Patch36: binutils-bso21193.diff
|
2017-03-17 16:44:53 +01:00
|
|
|
Patch37: fix-security-bugs.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
|
2012-11-28 11:59:15 +01:00
|
|
|
PreReq: update-alternatives
|
2007-10-09 04:28:58 +02:00
|
|
|
|
|
|
|
%description
|
2009-08-21 16:21:10 +02:00
|
|
|
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.
|
|
|
|
|
|
|
|
|
2012-02-15 12:33:41 +01:00
|
|
|
%package gold
|
|
|
|
Summary: The gold linker
|
|
|
|
License: GPL-3.0+
|
|
|
|
Group: Development/Tools/Building
|
|
|
|
Requires: binutils = %{version}-%{release}
|
2012-11-28 11:59:15 +01:00
|
|
|
PreReq: update-alternatives
|
2012-02-15 12:33:41 +01:00
|
|
|
%if 0%{suse_version} > 1100
|
|
|
|
%if 0%{!?cross:1}
|
2017-02-07 12:42:42 +01:00
|
|
|
%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc
|
2012-02-15 12:33:41 +01:00
|
|
|
%endif
|
|
|
|
%endif
|
2009-08-21 16:21:10 +02:00
|
|
|
|
2012-02-15 12:33:41 +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.
|
2009-08-21 16:21:10 +02:00
|
|
|
|
2012-02-15 12:33:41 +01:00
|
|
|
%package devel
|
|
|
|
Summary: GNU binutils (BFD development files)
|
|
|
|
License: GPL-3.0+
|
|
|
|
Group: Development/Libraries/C and C++
|
2012-04-19 13:30:58 +02:00
|
|
|
Requires: binutils = %{version}-%{release}
|
|
|
|
Requires: zlib-devel
|
2012-02-15 12:33:41 +01:00
|
|
|
Provides: binutils:/usr/include/bfd.h
|
2007-10-09 04:28:58 +02:00
|
|
|
|
2012-02-15 12:33:41 +01:00
|
|
|
%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.
|
2007-10-09 04:28:58 +02:00
|
|
|
|
|
|
|
|
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
|
2010-07-30 12:32:27 +02:00
|
|
|
%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux
|
2011-09-26 11:45:39 +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
|
|
|
|
2007-10-09 04:28:58 +02:00
|
|
|
%prep
|
|
|
|
echo "make check will return with %{make_check_handling} in case of testsuite failures."
|
|
|
|
%setup -q -n binutils-%{binutils_version}
|
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
|
- Update to binutils 2.27.
* Add a configure option, --enable-64-bit-archive, to force use of a
64-bit format when creating an archive symbol index.
* Add --elf-stt-common= option to objcopy for ELF targets to control
whether to convert common symbols to the STT_COMMON type.
GAS:
* Default to --enable-compressed-debug-sections=gas for Linux/x86 targets.
* Add --no-pad-sections to stop the assembler from padding the end of output
sections up to their alignment boundary.
* Support for the ARMv8-M architecture has been added to the ARM port.
Support for the ARMv8-M Security and DSP Extensions has also been added
to the ARM port.
* ARC backend accepts .extInstruction, .extCondCode, .extAuxRegister, and
.extCoreRegister pseudo-ops that allow an user to define custom
instructions, conditional codes, auxiliary and core registers.
* Add a configure option --enable-elf-stt-common to decide whether ELF
assembler should generate common symbols with the STT_COMMON type by
default. Default to no.
* New command line option --elf-stt-common= for ELF targets to control
whether to generate common symbols with the STT_COMMON type.
* Add ability to set section flags and types via numeric values for ELF
based targets.
* Add a configure option --enable-x86-relax-relocations to decide whether
x86 assembler should generate relax relocations by default. Default to
yes, except for x86 Solaris targets older than Solaris 12.
* New command line option -mrelax-relocations= for x86 target to control
whether to generate relax relocations.
* New command line option -mfence-as-lock-add=yes for x86 target to encode
lfence, mfence and sfence as "lock addl $0x0, (%[re]sp)".
* Add assembly-time relaxation option for ARC cpus.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=215
2016-08-24 13:55:45 +02:00
|
|
|
%patch -p1
|
2007-10-09 04:28:58 +02:00
|
|
|
%if !%{test_vanilla}
|
2009-11-23 14:16:14 +01:00
|
|
|
%patch3
|
2007-10-09 04:28:58 +02:00
|
|
|
%patch4
|
|
|
|
%patch5
|
|
|
|
%patch6
|
|
|
|
%patch7 -p1
|
|
|
|
%patch8
|
|
|
|
%patch9
|
|
|
|
%patch10
|
2015-07-21 14:50:51 +02:00
|
|
|
%if "%{TARGET}" != "mips"
|
|
|
|
# The MIPS ABI is incompatible with .gnu.hash, so don't
|
|
|
|
# use it there
|
2007-10-09 04:28:58 +02:00
|
|
|
%patch11
|
2013-04-03 15:09:27 +02:00
|
|
|
%patch12
|
- Update to binutils 2.28
* Add --fix-stm32l4xx-629360 to the ARM linker to enable a link-time
workaround for a bug in the bus matrix / memory controller for some of
the STM32 Cortex-M4 based products (STM32L4xx)
* Add a configure option --enable-compressed-debug-sections={all,ld} to
decide whether DWARF debug sections should be compressed by default.
* Add support for the ARC EM/HS, and ARC600/700 architectures.
* Experimental support for linker garbage collection (--gc-sections)
has been enabled for COFF and PE based targets.
* New command line option for ELF targets to compress DWARF debug
sections, --compress-debug-sections=[none|zlib|zlib-gnu|zlib-gabi].
* New command line option, --orphan-handling=[place|warn|error|discard], to
adjust how orphan sections are handled. The default is 'place' which gives
the current behaviour, 'warn' and 'error' issue a warning or error
respectively when orphan sections are found, and 'discard' will discard all
orphan sections.
* Add support for LLVM plugin.
* Add --print-memory-usage option to report memory blocks usage.
* Add --require-defined option, it's like --undefined except the new symbol
must be defined by the end of the link.
* Add a configure option --enable-compressed-debug-sections={all,gas} to
decide whether DWARF debug sections should be compressed by default.
* Add support for the ARC EM/HS, and ARC600/700 architectures. Remove
assembler support for Argonaut RISC architectures.
* Add option to objcopy to insert new symbols into a file:
--add-symbol <name>=[<section>:]<value>[,<flags>]
* Add support for the ARC EM/HS, and ARC600/700 architectures.
* Extend objcopy --compress-debug-sections option to support
--compress-debug-sections=[none|zlib|zlib-gnu|zlib-gabi] for ELF
targets.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=200
2016-01-27 14:17:46 +01:00
|
|
|
%endif
|
2009-06-12 16:47:10 +02:00
|
|
|
%patch14
|
2011-07-01 12:34:38 +02:00
|
|
|
%patch18
|
2012-11-30 14:00:21 +01:00
|
|
|
%patch22
|
2015-10-14 16:38:50 +02:00
|
|
|
%patch34 -p1
|
2017-02-24 11:51:58 +01:00
|
|
|
%patch36 -p1
|
2017-03-17 16:44:53 +01:00
|
|
|
%patch37 -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
|
2014-02-17 14:21:17 +01:00
|
|
|
%patch93
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
#
|
|
|
|
# test_vanilla
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%build
|
2015-05-18 17:27:56 +02:00
|
|
|
sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h
|
2007-10-09 04:28:58 +02:00
|
|
|
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error"
|
2012-02-15 12:33:41 +01:00
|
|
|
%if 0%{!?cross:1}
|
2007-10-09 04:28:58 +02:00
|
|
|
# Building native binutils
|
|
|
|
echo "Building native binutils."
|
|
|
|
%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 :-/
|
2011-01-12 12:42:34 +01:00
|
|
|
%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\
|
|
|
|
--prefix=%{_prefix} --libdir=%{_libdir} \\\
|
|
|
|
--infodir=%{_infodir} --mandir=%{_mandir} \\\
|
|
|
|
--with-bugurl=http://bugs.opensuse.org/ \\\
|
|
|
|
--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-12 12:42:34 +01:00
|
|
|
../configure %common_flags \
|
2011-01-11 14:41:17 +01:00
|
|
|
${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \
|
|
|
|
--enable-plugins \
|
2012-02-15 12:33:41 +01:00
|
|
|
%ifarch %gold_archs
|
|
|
|
--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 \
|
2012-02-15 12:33:41 +01:00
|
|
|
%endif
|
2011-01-12 12:42:34 +01:00
|
|
|
--enable-shared
|
2010-07-30 12:32:27 +02:00
|
|
|
make %{?_smp_mflags} all-bfd TARGET-bfd=headers
|
2011-01-11 14:41:17 +01:00
|
|
|
# force reconfiguring (???)
|
2007-10-09 04:28:58 +02:00
|
|
|
rm bfd/Makefile
|
2010-07-30 12:32:27 +02:00
|
|
|
make %{?_smp_mflags}
|
2008-03-07 20:18:44 +01:00
|
|
|
|
2007-10-09 04:28:58 +02:00
|
|
|
%else
|
|
|
|
# building cross-TARGET-binutils
|
|
|
|
echo "Building cross binutils."
|
|
|
|
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
|
2007-10-09 04:28:58 +02:00
|
|
|
%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu"
|
2015-07-07 15:41:24 +02:00
|
|
|
%define TARGET_OS %{TARGET}
|
2007-10-09 04:28:58 +02:00
|
|
|
%else
|
2015-07-13 16:13:27 +02:00
|
|
|
%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "rx"
|
|
|
|
%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} \
|
|
|
|
--with-bugurl=http://bugs.opensuse.org/ \
|
|
|
|
--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 \
|
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 \
|
2008-11-07 14:56:00 +01:00
|
|
|
%endif
|
2009-01-22 16:48:12 +01:00
|
|
|
${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"}
|
2010-07-30 12:32:27 +02:00
|
|
|
make %{?_smp_mflags} all-bfd TARGET-bfd=headers
|
2007-10-09 04:28:58 +02:00
|
|
|
# force reconfiguring
|
|
|
|
rm bfd/Makefile
|
2010-07-30 12:32:27 +02:00
|
|
|
make %{?_smp_mflags}
|
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
|
2010-07-30 12:32:27 +02:00
|
|
|
make -C gas-nesc %{?_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}
|
|
|
|
make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" || %{make_check_handling}
|
|
|
|
%else
|
2009-11-23 14:16:14 +01:00
|
|
|
make -k check CFLAGS="$RPM_OPT_FLAGS -Wno-unused -Wno-unprototyped-calls" || :
|
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
|
2012-02-15 12:33:41 +01:00
|
|
|
%ifarch %gold_archs
|
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install-gold
|
|
|
|
ln -sf ld.gold $RPM_BUILD_ROOT%{_bindir}/gold
|
|
|
|
%endif
|
2007-10-09 04:28:58 +02:00
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install-info install
|
|
|
|
make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am
|
2009-01-22 13:04:44 +01:00
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes
|
2012-11-28 11:59:15 +01:00
|
|
|
if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then
|
|
|
|
mv "%buildroot/%_bindir"/{ld,ld.bfd};
|
|
|
|
else
|
|
|
|
rm -f "%buildroot/%_bindir/ld";
|
2011-01-12 12:42:34 +01:00
|
|
|
fi
|
2012-11-28 11:59:15 +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
|
|
|
|
ln -s "%_bindir/ld" "%buildroot/%_sysconfdir/alternatives/ld"
|
|
|
|
%endif
|
2012-11-28 11:59:15 +01:00
|
|
|
ln -s "%_sysconfdir/alternatives/ld" "%buildroot/%_bindir/ld";
|
2009-01-22 13:04:44 +01:00
|
|
|
rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin
|
2007-10-09 04:28:58 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin
|
|
|
|
ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin
|
|
|
|
mv $RPM_BUILD_ROOT%{_prefix}/%{HOST}/lib/ldscripts $RPM_BUILD_ROOT%{_libdir}
|
|
|
|
ln -sf ../../%{_lib}/ldscripts $RPM_BUILD_ROOT%{_prefix}/%{HOST}/lib/ldscripts
|
|
|
|
# Install header files
|
|
|
|
make -C libiberty install_to_libdir target_header_dir=/usr/include DESTDIR=$RPM_BUILD_ROOT
|
|
|
|
# We want the PIC libiberty.a
|
|
|
|
install -m 644 libiberty/pic/libiberty.a $RPM_BUILD_ROOT%{_libdir}
|
|
|
|
#
|
|
|
|
chmod a+x $RPM_BUILD_ROOT%{_libdir}/libbfd-*
|
|
|
|
chmod a+x $RPM_BUILD_ROOT%{_libdir}/libopcodes-*
|
|
|
|
# No shared linking outside binutils
|
2009-01-22 13:04:44 +01:00
|
|
|
rm $RPM_BUILD_ROOT%{_libdir}/lib{bfd,opcodes}.so
|
2011-01-12 12:42:34 +01:00
|
|
|
rm $RPM_BUILD_ROOT%{_libdir}/lib{bfd,opcodes}.la
|
2007-10-09 04:28:58 +02:00
|
|
|
# Remove unwanted files to shut up rpm
|
2014-12-02 17:34:18 +01:00
|
|
|
rm -f $RPM_BUILD_ROOT%{_infodir}/configure* $RPM_BUILD_ROOT%{_infodir}/standards.info*
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_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
|
2012-02-15 12:33:41 +01:00
|
|
|
%ifarch %gold_archs
|
|
|
|
%find_lang gold binutils-gold.lang
|
|
|
|
%endif
|
2008-10-13 15:45:53 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}
|
|
|
|
install -m 644 binutils/NEWS $RPM_BUILD_ROOT%{_docdir}/%{name}/NEWS-binutils
|
|
|
|
install -m 644 gas/NEWS $RPM_BUILD_ROOT%{_docdir}/%{name}/NEWS-gas
|
|
|
|
install -m 644 ld/NEWS $RPM_BUILD_ROOT%{_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
|
2007-10-09 04:28:58 +02:00
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install
|
2012-02-15 10:19:39 +01:00
|
|
|
# Replace hard links by symlinks, so that rpmlint doesn't complain
|
2015-07-07 15:41:24 +02:00
|
|
|
T=$(basename %buildroot/usr/%{TARGET_OS})
|
2012-02-15 10:19:39 +01:00
|
|
|
for f in %buildroot/usr/$T/bin/* ; do
|
|
|
|
ln -sf /usr/bin/$T-$(basename $f) $f
|
|
|
|
done
|
2007-10-09 04:28:58 +02:00
|
|
|
%if "%{TARGET}" == "avr"
|
2015-07-07 15:41:24 +02:00
|
|
|
install -c gas-nesc/as-new $RPM_BUILD_ROOT%{_prefix}/bin/%{TARGET_OS}-nesc-as
|
|
|
|
ln -sf ../../bin/%{TARGET_OS}-nesc-as $RPM_BUILD_ROOT%{_prefix}/%{TARGET_OS}/bin/nesc-as
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
2010-01-14 15:24:23 +01:00
|
|
|
rm -rf $RPM_BUILD_ROOT%{_mandir}
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{_infodir}
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{_prefix}/lib*
|
2007-10-09 04:28:58 +02:00
|
|
|
rm -rf $RPM_BUILD_ROOT%{_prefix}/include
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt
|
|
|
|
> ../binutils.lang
|
|
|
|
%endif
|
|
|
|
|
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
|
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
|
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
|
|
|
|
|
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
|
2012-11-28 11:59:15 +01:00
|
|
|
|
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
|
2012-11-28 11:59:15 +01:00
|
|
|
if [ "$1" = 0 ]; then
|
|
|
|
"%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd";
|
|
|
|
fi;
|
|
|
|
|
|
|
|
%preun gold
|
|
|
|
if [ "$1" = 0 ]; then
|
|
|
|
"%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold";
|
|
|
|
fi;
|
|
|
|
|
2017-02-07 12:42:42 +01:00
|
|
|
%postun
|
|
|
|
/sbin/ldconfig
|
2007-10-09 04:28:58 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%files -f binutils.lang
|
|
|
|
%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
|
|
|
|
%{_bindir}/*
|
2012-11-28 11:59:15 +01:00
|
|
|
%ghost %_sysconfdir/alternatives/ld
|
2012-02-15 12:33:41 +01:00
|
|
|
%ifarch %gold_archs
|
|
|
|
%exclude %{_bindir}/gold
|
|
|
|
%exclude %{_bindir}/ld.gold
|
|
|
|
%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
|
2008-01-12 02:41:14 +01:00
|
|
|
|
2012-02-15 12:33:41 +01:00
|
|
|
%ifarch %gold_archs
|
|
|
|
%files gold -f binutils-gold.lang
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc gold/NEWS gold/README
|
|
|
|
%{_bindir}/gold
|
|
|
|
%{_bindir}/ld.gold
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{!?cross:1}
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_prefix}/include/*.h
|
|
|
|
%{_libdir}/lib*.*a
|
|
|
|
%endif
|
|
|
|
|
2007-10-09 04:28:58 +02:00
|
|
|
%changelog
|