# # spec file for package binutils (Version 2.20.0) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # 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. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: binutils BuildRequires: bison dejagnu flex gcc-c++ %if 0%{suse_version} > 1110 BuildRequires: zlib-devel-static %else BuildRequires: zlib-devel %endif Version: 2.20.0 Release: 1 # # 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 # %ifarch alpha armv4l hppa mips sh4 %sparc %define make_check_handling true %else # XXX check again %define make_check_handling false %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) %ifarch %ix86 ia64 ppc ppc64 s390 s390x x86_64 %define build_multitarget 1 %else %define build_multitarget 0 %endif %define target_list alpha arm hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 s390 s390x sh4 sparc sparc64 x86_64 # # # Url: http://www.gnu.org/software/binutils/ License: GFDLv1.1 ; GFDLv1.2 ; GPLv2+ ; GPLv3+ ; LGPLv2.0+ ; LGPLv2.1+ ; LGPLv3+ Group: Development/Tools/Building PreReq: %{install_info_prereq} AutoReqProv: on # bug437293 %ifarch ppc64 Obsoletes: binutils-64bit %endif # %define binutils_version %(echo %version | sed 's/\\.[0-9]\\{8\\}$//') Summary: GNU Binutils Source: binutils-%{binutils_version}.tar.bz2 Source1: pre_checkin.sh Source2: README.First-for.SuSE.packagers 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 Patch10: enable-targets.diff Patch11: use-hashtype-both-by-default.diff Patch12: s390-pic-dso.diff Patch14: binutils-build-as-needed.diff 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 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 Andreas Jaeger Andreas Schwab Bill Cox Brendan Kehoe D. V. Henkel-Wallace DJ Delorie David D "Zoo" Zuhn David J. Mackenzie Denis Chertykov Diego Novillo Doug Evans Eric Christopher Eric Youngdale Fred Fish Geoff Keating H.J.Lu Hans-Peter Nilsson Ian Dall Ian Taylor J.T. Conklin Jakub Jelinek Jan Hubicka Jason Eckhardt Jason Merrill Jeff Law Jeffrey Osier Jeffrey Wheat Jim Kingdon Jim Wilson John Gilmore Joern Rennecke K. Richard Pixley Ken Raeburn Kung Hsu Mark Eichin Michael Meissner Michael Tiemann Mike Werner Nick Clifton Per Bothner Peter Schauer Richard Earnshaw Richard Henderson Richard Stallman Rob Savoye Roland H. Pesch Sean Eric Fagan Stan Shebs Stephane Carrez Steve Chamberlain Stu Grossman Torbjorn Granlund Ulf Carlsson %package gold License: GPLv3+ Summary: The gold linker AutoReqProv: on Requires: binutils = %{version}-%{release} Group: Development/Tools/Building %if 0%{suse_version} > 1100 %define gold_archs %ix86 x86_64 ppc ppc64 %sparc %endif %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. 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 Cary Coutant Craig Silverstein Andrew Chatham %package devel License: GPLv2+ ; LGPLv2.1+ Summary: GNU binutils (BFD development files) AutoReqProv: on Requires: binutils = %{version}-%{release}, zlib-devel Provides: binutils:/usr/include/bfd.h Group: Development/Libraries/C and C++ %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. Authors: -------- Alan Modra Andreas Jaeger Andreas Schwab Bill Cox Brendan Kehoe D. V. Henkel-Wallace DJ Delorie David D "Zoo" Zuhn David J. Mackenzie Denis Chertykov Diego Novillo Doug Evans Eric Christopher Eric Youngdale Fred Fish Geoff Keating H.J.Lu Hans-Peter Nilsson Ian Dall Ian Taylor J.T. Conklin Jakub Jelinek Jan Hubicka Jason Eckhardt Jason Merrill Jeff Law Jeffrey Osier Jeffrey Wheat Jim Kingdon Jim Wilson John Gilmore Joern Rennecke K. Richard Pixley Ken Raeburn Kung Hsu Mark Eichin Michael Meissner Michael Tiemann Mike Werner Nick Clifton Per Bothner Peter Schauer Richard Earnshaw Richard Henderson Richard Stallman Rob Savoye Roland H. Pesch Sean Eric Fagan Stan Shebs Stephane Carrez Steve Chamberlain Stu Grossman Torbjorn Granlund Ulf Carlsson %if "%{name}" != "binutils" %define TARGET %(echo %{name} | sed -e "s/cross-\\(.*\\)-binutils/\\1/;s/-/_/g;s/parisc/hppa/;s/i.86/i586/;s/ppc/powerpc/") %endif %define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64.*/sparc/" -e "s/sparcv.*/sparc/")-suse-linux %define DIST %(echo '%distribution' | sed 's/ (.*)//') %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 %patch3 %patch4 %patch5 %patch6 %patch7 -p1 %patch8 %patch9 %patch10 %patch11 %patch12 %patch14 %if "%{TARGET}" == "avr" cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h %patch90 %patch92 %endif # # test_vanilla %endif sed -i -e '/BFD_VERSION_DATE/s/$/-%{release}/' bfd/version.h %build RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" %if "%{name}" == "binutils" # Building native binutils echo "Building native binutils." %if %build_multitarget EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf" %if !%{test_vanilla} EXTRA_TARGETS="$EXTRA_TARGETS,i386-macos10" %endif %else EXTRA_TARGETS= %endif EXTRA_LD_TARGETS= %ifarch sparc EXTRA_LD_TARGETS="$EXTRA_LD_TARGETS,sparc64-suse-linux" %endif %ifarch ppc EXTRA_LD_TARGETS="$EXTRA_LD_TARGETS,powerpc64-suse-linux" %endif %ifarch s390 EXTRA_LD_TARGETS="$EXTRA_LD_TARGETS,s390x-suse-linux" %endif %ifarch s390x EXTRA_LD_TARGETS="$EXTRA_LD_TARGETS,s390-suse-linux" %endif %ifarch %ix86 EXTRA_LD_TARGETS="$EXTRA_LD_TARGETS,x86_64-suse-linux" %endif EXTRA_GOLD_TARGETS=$EXTRA_LD_TARGETS %ifarch ppc ppc64 EXTRA_LD_TARGETS="$EXTRA_LD_TARGETS,spu-elf" %endif %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} \\\ ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} %define extra_ld_targets \\\ ${EXTRA_LD_TARGETS:+--enable-ld-targets="${EXTRA_LD_TARGETS#,}"} %define extra_gold_targets \\\ ${EXTRA_GOLD_TARGETS:+--enable-ld-targets="${EXTRA_GOLD_TARGETS#,}"} mkdir build-dir cd build-dir ../configure %common_flags %extra_ld_targets --enable-shared make %{?jobs:-j%jobs} all-bfd TARGET-bfd=headers # force reconfiguring rm bfd/Makefile make %{?jobs:-j%jobs} %ifarch %gold_archs mkdir ../build-dir2 cd ../build-dir2 ../configure --disable-ld-targets %common_flags %extra_gold_targets \ --enable-shared --enable-gold --program-prefix=go --enable-plugins make %{?jobs:-j%jobs} %endif mkdir ../build-dir3 cd ../build-dir3 ../configure %common_flags --disable-shared make %{?jobs:-j%jobs} all-bfd all-opcodes %check export SUSE_ASNEEDED=0 cd build-dir %ifnarch %arm make -k check CFLAGS="$RPM_OPT_FLAGS -Wno-unused -Wno-unprototyped-calls" || %{make_check_handling} %ifarch %gold_archs cd ../build-dir2 make -k check-gold CFLAGS="$RPM_OPT_FLAGS -Wno-unused -Wno-unprototyped-calls" || : %endif %endif # # # %else # building cross-TARGET-binutils echo "Building cross binutils." mkdir build-dir cd build-dir EXTRA_TARGETS= %if "%{TARGET}" == "sparc" EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" %endif %if "%{TARGET}" == "powerpc" EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" %endif %if "%{TARGET}" == "s390" EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" %endif %if "%{TARGET}" == "s390x" EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" %endif %if "%{TARGET}" == "i586" EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" %endif %if "%{TARGET}" == "hppa" EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" %endif %if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" TARGET_OS=%{TARGET} %else TARGET_OS=%{TARGET}-linux %endif ../configure CFLAGS="${RPM_OPT_FLAGS}" \ --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 --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ %endif ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} make %{?jobs:-j%jobs} all-bfd TARGET-bfd=headers # force reconfiguring rm bfd/Makefile make %{?jobs:-j%jobs} %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 make -C gas-nesc %{?jobs:-j%jobs} %endif %check unset SUSE_ASNEEDED cd build-dir make -k check CFLAGS="$RPM_OPT_FLAGS -Wno-unused -Wno-unprototyped-calls" || : %endif %install cd build-dir %if "%name" == "binutils" # installing native binutils %ifarch %gold_archs cd ../build-dir2 make DESTDIR=$RPM_BUILD_ROOT install-gold cd ../build-dir %endif make DESTDIR=$RPM_BUILD_ROOT install-info install make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am cd ../build-dir3 make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes cd ../build-dir rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin 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 rm $RPM_BUILD_ROOT%{_libdir}/lib{bfd,opcodes}.so # 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 %ifarch %gold_archs %find_lang gold binutils-gold.lang %endif 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 %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 rm -rf $RPM_BUILD_ROOT%{_prefix}/man rm -rf $RPM_BUILD_ROOT%{_prefix}/info rm -rf $RPM_BUILD_ROOT%{_prefix}/lib 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" %{_docdir}/%{name} %{_prefix}/%{HOST}/bin/* %{_prefix}/%{HOST}/lib/ldscripts %{_libdir}/ldscripts %{_bindir}/* %ifarch %gold_archs %exclude %{_bindir}/gold %endif %doc %{_infodir}/*.gz %{_libdir}/lib*-%{version}*.so %doc %{_mandir}/man1/*.1.gz %else %{_prefix} %endif %ifarch %gold_archs %files gold -f binutils-gold.lang %defattr(-,root,root) %doc gold/NEWS gold/README %{_bindir}/gold %endif %files devel %defattr(-,root,root) %{_prefix}/include/*.h %{_libdir}/lib*.*a %changelog