2007-10-09 04:28:58 +02:00
|
|
|
|
#
|
2011-09-26 11:45:39 +02:00
|
|
|
|
# spec file for package cross-spu-binutils
|
2007-10-09 04:28:58 +02:00
|
|
|
|
#
|
2011-04-19 15:16:39 +02:00
|
|
|
|
# Copyright (c) 2011 SUSE LINUX Products 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/
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
2008-02-16 03:58:48 +01:00
|
|
|
|
|
2011-09-26 11:45:39 +02:00
|
|
|
|
Name: cross-spu-binutils
|
2009-11-27 12:33:30 +01:00
|
|
|
|
BuildRequires: bison dejagnu flex gcc-c++
|
2011-07-11 10:43:27 +02:00
|
|
|
|
# for the testsuite
|
|
|
|
|
%if 0%{suse_version} >= 1210
|
|
|
|
|
BuildRequires: glibc-devel-static
|
|
|
|
|
%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
|
2011-06-28 10:13:36 +02:00
|
|
|
|
Version: 2.21.1
|
2011-08-29 10:10:55 +02:00
|
|
|
|
Release: 10
|
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
|
|
|
|
|
#
|
2010-01-14 15:24:23 +01:00
|
|
|
|
%ifarch alpha armv4l 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)
|
2011-09-26 11:45:39 +02:00
|
|
|
|
%ifarch %ix86 %arm ia64 ppc ppc64 s390 s390x x86_64
|
2007-10-09 04:28:58 +02:00
|
|
|
|
%define build_multitarget 1
|
|
|
|
|
%else
|
|
|
|
|
%define build_multitarget 0
|
|
|
|
|
%endif
|
2011-09-26 11:45:39 +02:00
|
|
|
|
%define target_list alpha armv5l armv7l armv8l hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 s390 s390x sh4 sparc sparc64 x86_64
|
2007-10-09 04:28:58 +02:00
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
Url: http://www.gnu.org/software/binutils/
|
2011-06-27 16:59:47 +02:00
|
|
|
|
License: GNU Free Documentation License, Version 1.1 (GFDL 1.1); GNU Free Documentation License, Version 1.2 (GFDL 1.2); GPL v2 or later; GPL v3 or later; LGPL v2.0 or later; LGPL v2.1 or later; LGPL v3 or later
|
2007-10-09 04:28:58 +02:00
|
|
|
|
Group: Development/Tools/Building
|
|
|
|
|
PreReq: %{install_info_prereq}
|
|
|
|
|
AutoReqProv: on
|
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
|
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
|
2007-10-09 04:28:58 +02:00
|
|
|
|
Patch2: s390-pic.patch
|
|
|
|
|
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
|
|
|
|
|
Patch12: s390-pic-dso.diff
|
2009-06-12 16:47:10 +02:00
|
|
|
|
Patch14: binutils-build-as-needed.diff
|
2010-03-26 00:03:53 +01:00
|
|
|
|
Patch15: fixup-testcase-perturb.diff
|
2011-06-09 16:22:53 +02:00
|
|
|
|
Patch16: amd-bdver2-and-fixes2.diff.gz
|
2011-06-27 16:59:47 +02:00
|
|
|
|
Patch17: binutils-add-pep.diff
|
2011-07-11 16:01:45 +02:00
|
|
|
|
Patch18: gold-depend-on-opcodes.diff
|
2011-07-11 10:43:27 +02:00
|
|
|
|
Patch19: readelf-bad-elf-endless-loop.patch
|
2011-07-12 14:06:37 +02:00
|
|
|
|
Patch20: bso12982.diff
|
2011-08-29 10:10:55 +02:00
|
|
|
|
# Too much fallout for now
|
|
|
|
|
#Patch21: binutils-no-copy-dt-needed-default.patch
|
2011-08-24 11:37:43 +02:00
|
|
|
|
Patch22: bnc713504.diff
|
2011-09-26 11:45:39 +02:00
|
|
|
|
Patch23: arm-ld-12643.diff
|
2007-10-09 04:28:58 +02:00
|
|
|
|
Patch90: cross-avr-nesc-as.patch
|
|
|
|
|
Patch92: cross-avr-omit_section_dynsym.patch
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
%if "%{name}" != "binutils"
|
|
|
|
|
%define _prefix /opt/cross
|
|
|
|
|
%else
|
|
|
|
|
%define _prefix /usr
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
|
--------
|
|
|
|
|
Alan Modra <amodra@bigpond.net.au>
|
|
|
|
|
Andreas Jaeger <aj@suse.de>
|
|
|
|
|
Andreas Schwab <schwab@suse.de>
|
|
|
|
|
Bill Cox <bill@cygnus.com>
|
|
|
|
|
Brendan Kehoe <brendan@cygnus.com>
|
|
|
|
|
D. V. Henkel-Wallace <gumby@cygnus.com>
|
|
|
|
|
DJ Delorie <dj@redhat.com>
|
|
|
|
|
David D "Zoo" Zuhn <zoo@cygnus.com>
|
|
|
|
|
David J. Mackenzie <djm@cygnus.com>
|
|
|
|
|
Denis Chertykov <denisc@overta.ru>
|
|
|
|
|
Diego Novillo <dnovillo@redhat.com>
|
|
|
|
|
Doug Evans <dje@cygnus.com>
|
|
|
|
|
Eric Christopher <echristo@redhat.com>
|
|
|
|
|
Eric Youngdale <eric@aib.com>
|
|
|
|
|
Fred Fish <fnf@cygnus.com>
|
|
|
|
|
Geoff Keating <geoffk@redhat.com>
|
|
|
|
|
H.J.Lu <hjl@gnu.org>
|
|
|
|
|
Hans-Peter Nilsson <hp@axis.com>
|
|
|
|
|
Ian Dall <dall@hfrd.dsto.gov.au>
|
|
|
|
|
Ian Taylor <ian@zembu.com>
|
|
|
|
|
J.T. Conklin <jtc@cygnus.com>
|
|
|
|
|
Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
Jan Hubicka <jh@suse.cz>
|
|
|
|
|
Jason Eckhardt <jle@redhat.com>
|
|
|
|
|
Jason Merrill <jason@redhat.com>
|
|
|
|
|
Jeff Law <law@redhat.com>
|
|
|
|
|
Jeffrey Osier <jeffrey@cygnus.com>
|
|
|
|
|
Jeffrey Wheat <cassidy@cygnus.com>
|
|
|
|
|
Jim Kingdon <kingdon@cygnus.com>
|
|
|
|
|
Jim Wilson <wilson@redhat.com>
|
|
|
|
|
John Gilmore <gnu@cygnus.com>
|
2011-06-27 16:59:47 +02:00
|
|
|
|
J<EFBFBD>rn Rennecke <amylaar@redhat.com>
|
2009-08-21 16:21:10 +02:00
|
|
|
|
K. Richard Pixley <rich@cygnus.com>
|
|
|
|
|
Ken Raeburn <raeburn@cygnus.com>
|
|
|
|
|
Kung Hsu <kung@cygnus.com>
|
|
|
|
|
Mark Eichin <eichin@cygnus.com>
|
|
|
|
|
Michael Meissner <meissner@redhat.com>
|
|
|
|
|
Michael Tiemann <tiemann@cygnus.com>
|
|
|
|
|
Mike Werner <mtw@cygnus.com>
|
|
|
|
|
Nick Clifton <nickc@redhat.com>
|
|
|
|
|
Per Bothner <bothner@cygnus.com>
|
|
|
|
|
Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
|
|
|
|
|
Richard Earnshaw <rwe@pegasus.esprit.ec.org>
|
|
|
|
|
Richard Henderson <rth@redhat.com>
|
|
|
|
|
Richard Stallman <rms@gnu.org>
|
|
|
|
|
Rob Savoye <rob@cygnus.com>
|
|
|
|
|
Roland H. Pesch <pesch@wrs.com>
|
|
|
|
|
Sean Eric Fagan <sef@cygnus.com>
|
|
|
|
|
Stan Shebs <shebs@apple.com>
|
|
|
|
|
Stephane Carrez <Stephane.Carrez@worldnet.fr>
|
|
|
|
|
Steve Chamberlain <sac@cygnus.com>
|
|
|
|
|
Stu Grossman <grossman@cygnus.com>
|
|
|
|
|
Torbjorn Granlund <tege@cygnus.com>
|
|
|
|
|
Ulf Carlsson <ulfc@calypso.engr.sgi.com>
|
|
|
|
|
|
|
|
|
|
The existing GNU linker manual is intended to be accurate
|
|
|
|
|
documentation for features which gold supports. gold supports
|
|
|
|
|
most of the features of the GNU linker for ELF targets. Notable
|
|
|
|
|
omissions--features of the GNU linker not currently supported in
|
|
|
|
|
gold--are: * MEMORY regions in linker scripts
|
|
|
|
|
|
|
|
|
|
* MRI compatible linker scripts
|
|
|
|
|
|
|
|
|
|
* linker map files (-M, -Map)
|
|
|
|
|
|
|
|
|
|
* cross-reference reports (--cref)
|
|
|
|
|
|
|
|
|
|
* linker garbage collection (--gc-sections)
|
|
|
|
|
|
|
|
|
|
* position independent executables (-pie)
|
|
|
|
|
|
|
|
|
|
* various other minor options
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
|
--------
|
|
|
|
|
Ian Lance Taylor <iant@google.com>
|
|
|
|
|
Cary Coutant <ccoutant@google.com>
|
|
|
|
|
Craig Silverstein <csilvers@google.com>
|
|
|
|
|
Andrew Chatham
|
2007-10-09 04:28:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
|
--------
|
|
|
|
|
Alan Modra <amodra@bigpond.net.au>
|
|
|
|
|
Andreas Jaeger <aj@suse.de>
|
|
|
|
|
Andreas Schwab <schwab@suse.de>
|
|
|
|
|
Bill Cox <bill@cygnus.com>
|
|
|
|
|
Brendan Kehoe <brendan@cygnus.com>
|
|
|
|
|
D. V. Henkel-Wallace <gumby@cygnus.com>
|
|
|
|
|
DJ Delorie <dj@redhat.com>
|
|
|
|
|
David D "Zoo" Zuhn <zoo@cygnus.com>
|
|
|
|
|
David J. Mackenzie <djm@cygnus.com>
|
|
|
|
|
Denis Chertykov <denisc@overta.ru>
|
|
|
|
|
Diego Novillo <dnovillo@redhat.com>
|
|
|
|
|
Doug Evans <dje@cygnus.com>
|
|
|
|
|
Eric Christopher <echristo@redhat.com>
|
|
|
|
|
Eric Youngdale <eric@aib.com>
|
|
|
|
|
Fred Fish <fnf@cygnus.com>
|
|
|
|
|
Geoff Keating <geoffk@redhat.com>
|
|
|
|
|
H.J.Lu <hjl@gnu.org>
|
|
|
|
|
Hans-Peter Nilsson <hp@axis.com>
|
|
|
|
|
Ian Dall <dall@hfrd.dsto.gov.au>
|
|
|
|
|
Ian Taylor <ian@zembu.com>
|
|
|
|
|
J.T. Conklin <jtc@cygnus.com>
|
|
|
|
|
Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
Jan Hubicka <jh@suse.cz>
|
|
|
|
|
Jason Eckhardt <jle@redhat.com>
|
|
|
|
|
Jason Merrill <jason@redhat.com>
|
|
|
|
|
Jeff Law <law@redhat.com>
|
|
|
|
|
Jeffrey Osier <jeffrey@cygnus.com>
|
|
|
|
|
Jeffrey Wheat <cassidy@cygnus.com>
|
|
|
|
|
Jim Kingdon <kingdon@cygnus.com>
|
|
|
|
|
Jim Wilson <wilson@redhat.com>
|
|
|
|
|
John Gilmore <gnu@cygnus.com>
|
2011-06-27 16:59:47 +02:00
|
|
|
|
J<EFBFBD>rn Rennecke <amylaar@redhat.com>
|
2007-10-09 04:28:58 +02:00
|
|
|
|
K. Richard Pixley <rich@cygnus.com>
|
|
|
|
|
Ken Raeburn <raeburn@cygnus.com>
|
|
|
|
|
Kung Hsu <kung@cygnus.com>
|
|
|
|
|
Mark Eichin <eichin@cygnus.com>
|
|
|
|
|
Michael Meissner <meissner@redhat.com>
|
|
|
|
|
Michael Tiemann <tiemann@cygnus.com>
|
|
|
|
|
Mike Werner <mtw@cygnus.com>
|
|
|
|
|
Nick Clifton <nickc@redhat.com>
|
|
|
|
|
Per Bothner <bothner@cygnus.com>
|
|
|
|
|
Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
|
|
|
|
|
Richard Earnshaw <rwe@pegasus.esprit.ec.org>
|
|
|
|
|
Richard Henderson <rth@redhat.com>
|
|
|
|
|
Richard Stallman <rms@gnu.org>
|
|
|
|
|
Rob Savoye <rob@cygnus.com>
|
|
|
|
|
Roland H. Pesch <pesch@wrs.com>
|
|
|
|
|
Sean Eric Fagan <sef@cygnus.com>
|
|
|
|
|
Stan Shebs <shebs@apple.com>
|
|
|
|
|
Stephane Carrez <Stephane.Carrez@worldnet.fr>
|
|
|
|
|
Steve Chamberlain <sac@cygnus.com>
|
|
|
|
|
Stu Grossman <grossman@cygnus.com>
|
|
|
|
|
Torbjorn Granlund <tege@cygnus.com>
|
|
|
|
|
Ulf Carlsson <ulfc@calypso.engr.sgi.com>
|
|
|
|
|
|
|
|
|
|
%if "%{name}" != "binutils"
|
2007-11-12 18:39:46 +01:00
|
|
|
|
%define TARGET %(echo %{name} | sed -e "s/cross-\\(.*\\)-binutils/\\1/;s/-/_/g;s/parisc/hppa/;s/i.86/i586/;s/ppc/powerpc/")
|
2007-10-09 04:28:58 +02:00
|
|
|
|
%endif
|
2011-09-26 11:45:39 +02:00
|
|
|
|
%ifarch %{arm} armv5l armv7l armv8l
|
|
|
|
|
%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}
|
|
|
|
|
%if !%{test_vanilla}
|
|
|
|
|
%patch2
|
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
|
|
|
|
|
%patch11
|
|
|
|
|
%patch12
|
2009-06-12 16:47:10 +02:00
|
|
|
|
%patch14
|
2010-03-26 00:03:53 +01:00
|
|
|
|
%patch15
|
2011-06-09 17:26:48 +02:00
|
|
|
|
%patch16 -p1
|
2011-06-27 16:59:47 +02:00
|
|
|
|
%patch17 -p1
|
2011-07-01 12:34:38 +02:00
|
|
|
|
%patch18
|
2011-07-11 10:43:27 +02:00
|
|
|
|
%patch19
|
2011-07-12 10:56:10 +02:00
|
|
|
|
%patch20 -p1
|
2011-08-29 10:10:55 +02:00
|
|
|
|
#%patch21
|
2011-08-23 13:43:54 +02:00
|
|
|
|
%patch22
|
2011-09-26 11:45:39 +02:00
|
|
|
|
%patch23
|
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
|
|
|
|
|
%endif
|
|
|
|
|
#
|
|
|
|
|
# test_vanilla
|
|
|
|
|
%endif
|
2010-03-26 00:03:53 +01: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
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error"
|
|
|
|
|
%if "%{name}" == "binutils"
|
|
|
|
|
# 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
|
|
|
|
|
%ifarch ppc ppc64
|
2011-01-11 14:41:17 +01:00
|
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf"
|
|
|
|
|
%endif
|
2011-09-26 11:45:39 +02:00
|
|
|
|
%ifarch armv5l
|
|
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,armv5l-suse-linux"
|
|
|
|
|
%endif
|
|
|
|
|
%ifarch armv7l
|
|
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,armv7l-suse-linux"
|
|
|
|
|
%endif
|
|
|
|
|
%ifarch armv8l
|
|
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,armv8l-suse-linux"
|
|
|
|
|
%endif
|
2007-10-09 04:28:58 +02:00
|
|
|
|
%endif
|
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 \\\
|
|
|
|
|
--with-pic --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 \
|
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
|
|
|
|
|
|
|
|
|
%check
|
2009-06-13 16:32:14 +02:00
|
|
|
|
export SUSE_ASNEEDED=0
|
2008-03-07 20:18:44 +01:00
|
|
|
|
cd build-dir
|
2011-01-12 12:42:34 +01:00
|
|
|
|
make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" || %{make_check_handling}
|
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"
|
|
|
|
|
EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux"
|
|
|
|
|
%endif
|
2007-10-09 04:28:58 +02:00
|
|
|
|
%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu"
|
|
|
|
|
TARGET_OS=%{TARGET}
|
|
|
|
|
%else
|
|
|
|
|
TARGET_OS=%{TARGET}-linux
|
|
|
|
|
%endif
|
|
|
|
|
../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}" \
|
|
|
|
|
--disable-nls \
|
|
|
|
|
--build=%{HOST} --target=$TARGET_OS \
|
|
|
|
|
%if "%{TARGET}" == "spu"
|
|
|
|
|
--with-sysroot=/usr/spu \
|
|
|
|
|
%else
|
2010-01-14 15:24:23 +01: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
|
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
|
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
|
|
|
|
|
%if "%name" == "binutils"
|
|
|
|
|
# installing native binutils
|
|
|
|
|
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
|
2011-01-12 12:42:34 +01:00
|
|
|
|
# we could eventually use alternatives for /usr/bin/ld
|
|
|
|
|
if test -f $RPM_BUILD_ROOT%{_bindir}/ld.bfd; then
|
|
|
|
|
rm $RPM_BUILD_ROOT%{_bindir}/ld
|
|
|
|
|
ln -sf ld.bfd $RPM_BUILD_ROOT%{_bindir}/ld;
|
|
|
|
|
fi
|
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
|
|
|
|
|
rm $RPM_BUILD_ROOT%{_infodir}/configure* $RPM_BUILD_ROOT%{_infodir}/standards.info*
|
|
|
|
|
rm $RPM_BUILD_ROOT%{_mandir}/man1/dlltool.1 $RPM_BUILD_ROOT%{_mandir}/man1/windres.1 $RPM_BUILD_ROOT%{_mandir}/man1/windmc.1
|
|
|
|
|
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
|
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
|
|
|
|
|
# installing cross-TARGET-binutils
|
|
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install
|
|
|
|
|
%if "%{TARGET}" == "avr"
|
|
|
|
|
install -c gas-nesc/as-new $RPM_BUILD_ROOT%{_prefix}/bin/%{TARGET}-nesc-as
|
|
|
|
|
ln -sf ../../bin/%{TARGET}-nesc-as $RPM_BUILD_ROOT%{_prefix}/%{TARGET}/bin/nesc-as
|
|
|
|
|
%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
|
|
|
|
|
|
|
|
|
|
%clean
|
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
%if "%name" == "binutils"
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
%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
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
%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
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%files -f binutils.lang
|
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
%if "%name" == "binutils"
|
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}/*
|
|
|
|
|
%doc %{_infodir}/*.gz
|
|
|
|
|
%{_libdir}/lib*-%{version}*.so
|
|
|
|
|
%doc %{_mandir}/man1/*.1.gz
|
|
|
|
|
%else
|
|
|
|
|
%{_prefix}
|
|
|
|
|
%endif
|
2008-01-12 02:41:14 +01:00
|
|
|
|
|
2007-10-09 04:28:58 +02:00
|
|
|
|
%changelog
|