%define test 0 %define static 0 %define scm 0 Summary: A GNU collection of binary utilities. %if "%?cross" != "" Name: binutils-cross-%cross Requires: binutils %else Name: binutils %endif Version: 2.22.51.0.1 %if %scm Release: 0.%scm.1ark Source: ftp://ftp.kernel.org/pub/linux/devel/binutils/binutils-%scm.tar.xz %else %if %static Release: 1arkstatic %else Release: 1ark %endif # HJL version is available as git release tags only - no download URL Source: binutils-%{version}.tar.xz # GNU version #Source: http://ftp.gnu.org/gnu/binutils/binutils-%version.tar.bz2 %endif License: GPL Group: Development/Tools URL: http://sources.redhat.com/binutils Patch: binutils-gold-ld-coexist.patch # Atari MiNT support # Forward-ported from bits at http://vincent.riviere.free.fr/soft/m68k-atari-mint/ Patch1: binutils-2.22.51.0.1-mint.patch # uClibc toolchain patches from SVN: # svn://uclibc.org/trunk/buildroot/toolchain Patch12: binutils-300-001_ld_makefile_patch.patch Buildroot: /var/tmp/binutils-root BuildRequires: texinfo >= 4.0, gettext BuildRequires: flex %if %test BuildRequires: dejagnu %endif Prereq: /sbin/install-info %define _gnu %{nil} %description Binutils is a collection of binary utilities, including ar (for creating, modifying and extracting from archives), as (a family of GNU assemblers), gprof (for displaying call graph profile data), ld (the GNU linker), nm (for listing symbols from object files), objcopy (for copying and translating object files), objdump (for displaying information from object files), ranlib (for generating an index for the contents of an archive), size (for listing the section sizes of an object or archive file), strings (for listing printable strings from files), strip (for discarding symbols), and addr2line (for converting addresses to file and line). %package devel Summary: Development files for %name Group: Development/Libraries/C Requires: %name = %version-%release %description devel Development files for %name The most common use of %name-devel is building plugins for the GOLD linker. %track prog %name = { version = %version url = ftp://ftp.kernel.org/pub/linux/devel/binutils/ regex = release.binutils-(__VER__) } %prep # We don't use %name here because %name changes for crosscompilers %if %scm %setup -q -n binutils %else %setup -q -n binutils-%version %endif # Needed when building the version from gnu.org/sourceware.org # as opposed to kernel.org #patch -p1 -b .coexist~ %patch1 -p1 -b .mint~ %patch12 -p1 -b .ld_makefile~ %build # FIXME --disable-initfini-array is a workaround for binutils bug 12343 # and should be removed when that bug is fixed export LD_SYMBOLIC_FUNCTIONS=1 mkdir build-%{_target_platform} cd build-%{_target_platform} CARGS= %ifarch sparc ppc s390 CARGS=--enable-64-bit-bfd %endif %ifarch ia64 CARGS=--enable-targets=i386-linux %endif %if %static CFLAGS="${CFLAGS:-%optflags} -static" LDFLAGS="-static" CXXFLAGS="${CXXFLAGS:-%optflags} -static" \ %else CFLAGS="${CFLAGS:-%optflags}" CXXFLAGS="${CXXFLAGS:-%optflags}" \ %endif ../configure \ %if "%?cross" != "" --target=%cross \ --with-sysroot=%_prefix/%cross/sys-root \ %else %{_target_platform} \ %endif --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \ --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \ --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \ --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \ --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \ --infodir=%{_infodir} --enable-gold=yes --enable-ld=default --enable-plugins --enable-threads --disable-initfini-array $CARGS %if %static # For some reason, just make CCLD="gcc -all-static" won't work find .. -name "Make*" |xargs perl -pi -e 's,\$\(CCLD\),gcc -all-static,g' %endif # The lack of %?_smp_mflags is intentional for now -- makefiles aren't SMP clean # as of 2.18.50.0.1 make tooldir=%{_prefix} all all-gold info %if %test echo ====================TESTING========================= make -k check || : echo ====================TESTING END===================== %endif cd .. %install TOP=`pwd` mkdir -p %{buildroot}%{_prefix} cd build-%{_target_platform} make install DESTDIR="$RPM_BUILD_ROOT" #install -m 644 libiberty/libiberty.a %{buildroot}%{_libdir} install -m 644 ../include/libiberty.h %{buildroot}%{_includedir} # Remove Windows/Novell only man pages rm -f %{buildroot}%{_mandir}/man1/{dlltool,nlmconv,windres}* rm -f %{buildroot}%{_infodir}/dir # This one comes from gcc rm -rf %{buildroot}%{_prefix}/%{_target_platform} # libtool sucks... rm %buildroot%_libdir/*.la || : cd .. %find_lang binutils || touch binutils.lang %find_lang opcodes || touch opcodes.lang %find_lang bfd || touch bfd.lang %find_lang gas || touch gas.lang %find_lang ld || touch ld.lang %find_lang gprof || touch gprof.lang %find_lang gold || touch gold.lang cat opcodes.lang >> binutils.lang cat bfd.lang >> binutils.lang cat gas.lang >> binutils.lang cat ld.lang >> binutils.lang cat gprof.lang >> binutils.lang cat gold.lang >> binutils.lang %if "%?cross" == "" cd $RPM_BUILD_ROOT/%_bindir for i in *; do ln -s $i %_target_platform-$i done # Install the gold plugin interface... cd $TOP cp -a include $RPM_BUILD_ROOT%_includedir/%name %endif # Add links to allow setting the linker by adjusting $PATH %if "%?cross" == "" mkdir -p $RPM_BUILD_ROOT%_libexecdir/ld.{bfd,gold} ln $RPM_BUILD_ROOT%_bindir/ld.bfd $RPM_BUILD_ROOT%_libexecdir/ld.bfd/ld ln $RPM_BUILD_ROOT%_bindir/ld.gold $RPM_BUILD_ROOT%_libexecdir/ld.gold/ld %else if [ -e $RPM_BUILD_ROOT%_bindir/%cross-ld.gold ]; then # Not always the case -- gold is ELF only, and we might be crosscompiling # to a weirdo platform using PE, COFF, Mach-O, a.out or other obscure # binary formats mkdir -p $RPM_BUILD_ROOT%_libexecdir/ld.{bfd,gold} ln $RPM_BUILD_ROOT%_bindir/%cross-ld.bfd $RPM_BUILD_ROOT%_libexecdir/ld.bfd/%cross-ld ln $RPM_BUILD_ROOT%_bindir/%cross-ld.gold $RPM_BUILD_ROOT%_libexecdir/ld.gold/%cross-ld fi %endif %clean rm -rf %{buildroot} %post %if ! %static /sbin/ldconfig %endif %if "%?cross" == "" /sbin/install-info --info-dir=%{_infodir} %{_infodir}/as.info.* /sbin/install-info --info-dir=%{_infodir} %{_infodir}/bfd.info.* /sbin/install-info --info-dir=%{_infodir} %{_infodir}/binutils.info.* /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gprof.info.* /sbin/install-info --info-dir=%{_infodir} %{_infodir}/ld.info.* /sbin/install-info --info-dir=%{_infodir} %{_infodir}/standards.info.* %endif %if "%?cross" == "" %preun if [ $1 = 0 ] ;then /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/as.info.* /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/bfd.info.* /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/binutils.info.* /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gprof.info.* /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.* /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/standards.info.* fi %endif %if ! %static %postun -p /sbin/ldconfig %endif %files -f binutils.lang %defattr(-,root,root) %doc README %_bindir/* %_libdir/ldscripts %optional %_libexecdir/* %_mandir/man1/* %if "%?cross" == "" %_infodir/*info* %else %optional %_prefix/%_host %_prefix/%cross %optional %_prefix/*/%cross %endif %if "%?cross" == "" %files devel %_includedir/* %_libdir/libiberty.a %endif %changelog * Fri Jan 13 2012 Bernhard Rosenkraenzer <bero@arklinux.ch> 2.22.51.0.1-1ark - 2.22.51.0.1 - Add patch for MiNT support * Tue Aug 16 2011 Bernhard Rosenkraenzer <bero@arklinux.org> 2.21.53.0.2-1ark - 2.21.53.0.2 * Wed Aug 3 2011 Bernhard Rosenkraenzer <bero@arklinux.org> 2.21.53.0.1-1ark - 2.21.53.0.1 * Mon Jun 27 2011 Bernhard Rosenkraenzer <bero@arklinux.org> 2.21.52.0.2-1ark - 2.21.52.0.2 * Thu Jun 9 2011 Bernhard Rosenkraenzer <bero@arklinux.org> 2.21.52.0.1-1ark - 2.21.52.0.1 * Thu May 19 2011 Bernhard Rosenkraenzer <bero@arklinux.org> 2.21.51.0.9-1ark - 2.21.51.0.9 * Tue Apr 12 2011 Bernhard Rosenkraenzer <bero@arklinux.org> 2.21.51.0.8-1ark - 2.21.51.0.8 * Sat Mar 12 2011 Bernhard Rosenkraenzer <bero@arklinux.org> 2.21.51.0.7-1ark - 2.21.51.0.7 * Thu Jan 20 2011 Bernhard Rosenkraenzer <bero@arklinux.org> 2.21.51.0.6-1ark - 2.21.51.0.6 * Thu Jan 6 2011 Bernhard Rosenkraenzer <bero@arklinux.org> 2.21.51.0.5-1ark - 2.21.51.0.5 * Fri Dec 24 2010 Bernhard Rosenkraenzer <bero@arklinux.org> 2.21.51.0.4-2ark - Use --disable-initfini-array for the time being (binutils bug #12343) * Tue Dec 7 2010 Bernhard Rosenkraenzer <bero@arklinux.org> 2.21.51.0.2-1ark - 2.21.51.0.2 - Package libiberty.a, kmtrace (in kdesdk) can use it * Wed Nov 24 2010 Bernhard Rosenkraenzer <bero@arklinux.org> 2.21.51.0.1-1ark - 2.21.51.0.1 * Sat Nov 6 2010 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.12-1ark - 2.20.51.0.12 * Mon Oct 18 2010 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.11-2ark - Get rid of libbfd/libopcodes shared libraries, nothing but binutils uses them (at least not the same fork - gcc has its own) - Allow building crosscompilers to weirdo platforms that don't use ELF * Tue Aug 17 2010 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.11-1ark - 2.20.51.0.11 * Sun Aug 8 2010 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.10-1ark - 2.20.51.0.10 * Sat Jun 12 2010 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.9-2ark - Default to ld.bfd over ld.gold for the time being * Sun May 30 2010 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.9-1ark - 2.20.51.0.9 * Wed Apr 14 2010 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.8-1ark - 2.20.51.0.8 * Tue Feb 9 2010 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.6-1ark - 2.20.51.0.6 * Thu Jan 21 2010 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.5-1ark - Update - Add %_libexecdir/ld.bfd/ld and %_libexecdir/ld.gold/ld links so we can tell gcc what linker to use at runtime by just adjusting the PATH - Default to using gold, now that there's an easy way to switch * Thu Nov 12 2009 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.3-0.20091112.1ark - Update - Add patch to allow gold and traditional ld to coexist * Tue Nov 10 2009 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.3-0.20091110.1ark - Update * Tue Oct 20 2009 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.2-2ark - Update gold and elfcpp from CVS to fix kernel linkage error * Fri Oct 16 2009 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.2-1ark - 2.20.51.0.2 * Sat Sep 19 2009 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.1-2ark - Switch to using the gold linker - Split out -devel package - Package "internal" headers needed to use the gold plugin interface * Sun Sep 13 2009 Bernhard Rosenkraenzer <bero@arklinux.org> 2.20.51.0.1-1ark - 2.20.51.0.1 * Wed Aug 19 2009 Bernhard Rosenkraenzer <bero@arklinux.org> 2.19.51.0.14-1ark - 2.19.51.0.14 * Mon Jun 8 2009 Bernhard Rosenkraenzer <bero@arklinux.org> 2.19.51.0.9-1ark - 2.19.51.0.9 - Fix building cross toolchains (no *.la files to delete here...) * Thu May 28 2009 Bernhard Rosenkraenzer <bero@arklinux.org> 2.19.51.0.5-1ark - 2.19.51.0.5 - Add rpm5 tracking info * Mon Mar 16 2009 Bernhard Rosenkraenzer <bero@arklinux.org> 2.19.51.0.3-1ark - 2.19.51.0.3 - Drop *.la files * Sat Feb 28 2009 Bernhard Rosenkraenzer <bero@arklinux.org> 2.19.51.0.2-1ark - 2.19.51.0.2 * Sun Jan 18 2009 Bernhard Rosenkraenzer <bero@arklinux.org> 2.19.51.0.1-1ark - 2.19.51.0.1 * Fri Jan 2 2009 Bernhard Rosenkraenzer <bero@arklinux.org> 2.19.50.0.1-1ark - 2.19.50.0.1 * Thu Sep 25 2008 Bernhard Rosenkraenzer <bero@arklinux.org> 2.18.50.0.9-1ark - 2.18.50.0.9 * Fri Jul 18 2008 Bernhard Rosenkraenzer <bero@arklinux.org> 2.18.50.0.8-1ark - 2.18.50.0.8 * Sat May 10 2008 Bernhard Rosenkraenzer <bero@arklinux.org> 2.18.50.0.7-1ark - 2.18.50.0.7 * Wed Mar 19 2008 Bernhard Rosenkraenzer <bero@arklinux.org> 2.18.50.0.5-1ark - 2.18.50.0.5 * Thu Feb 14 2008 Bernhard Rosenkraenzer <bero@arklinux.org> 2.18.50.0.4-1ark - 2.18.50.0.4 * Tue Jan 8 2008 Bernhard Rosenkraenzer <bero@arklinux.org> 2.18.50.0.3-1ark - 2.18.50.0.3 * Sat Oct 6 2007 Bernhard Rosenkraenzer <bero@arklinux.org> 2.18.50.0.2-1ark - 2.18.50.0.2 * Mon Sep 10 2007 Bernhard Rosenkraenzer <bero@arklinux.org> 2.18.50.0.1-1ark - 2.18.50.0.1 * Sat Jun 23 2007 Bernhard Rosenkraenzer <bero@arklinux.org> 2.17.50.0.17-1ark - 2.17.50.0.17 * Mon May 14 2007 Bernhard Rosenkraenzer <bero@arklinux.org> 2.17.50.0.16-1ark - 2.17.50.0.16 * Sun Apr 1 2007 Bernhard Rosenkraenzer <bero@arklinux.org> 2.17.50.0.14-1ark - 2.17.50.0.14 * Wed Mar 21 2007 Bernhard Rosenkraenzer <bero@arklinux.org> 2.17.50.0.13-1ark - 2.17.50.0.13 * Sat Oct 21 2006 Bernhard Rosenkraenzer <bero@arklinux.org> 2.17.50.0.6-1ark - 2.17.50.0.6 * Thu Sep 28 2006 Bernhard Rosenkraenzer <bero@arklinux.org> 2.17.50.0.5-1ark - 2.17.50.0.5 * Sat Jul 22 2006 Bernhard Rosenkraenzer <bero@arklinux.org> 2.17.50.0.3-1ark - 2.17.50.0.3 * Sun Jun 18 2006 Bernhard Rosenkraenzer <bero@arklinux.org> 2.17.50.0.2-2ark - Fix ld --as-needed * Sun May 28 2006 Bernhard Rosenkraenzer <bero@arklinux.org> 2.17.50.0.2-1ark - 2.17.50.0.2 * Tue Feb 14 2006 Bernhard Rosenkraenzer <bero@arklinux.org> 2.16.91.0.6-1ark - 2.16.91.0.6 * Thu Dec 29 2005 Bernhard Rosenkraenzer <bero@arklinux.org> 2.16.91.0.5-1ark - 2.16.91.0.5 * Wed Nov 30 2005 Bernhard Rosenkraenzer <bero@arklinux.org> 2.16.91.0.4-1ark - 2.16.91.0.4 * Sat Jul 2 2005 Bernhard Rosenkraenzer <bero@arklinux.org> 2.16.1-1ark - Downgrade to 2.16.1 with kernel.org patches merged manually. 2.16.9*.* is too broken to use for now (breaks OOo, breaks gcc 4.1, ...) * Sun Jun 26 2005 Bernhard Rosenkraenzer <bero@arklinux.org> 2.16.91.0.1-1ark - 2.16.91.0.1 * Mon Jun 20 2005 Bernhard Rosenkraenzer <bero@arklinux.org> 2.16.90.0.3-3ark - Fix handling of indirect symbols, http://sourceware.org/bugzilla/show_bug.cgi?id=1025 * Thu May 12 2005 Bernhard Rosenkraenzer <bero@arklinux.org> 2.16.90.0.3-2ark - Simplify building crosscompiler toolchains -- we can now simply rpm --rebuild --define 'cross anything-anything-linux' binutils*rpm without having to modify the spec file. * Thu May 12 2005 Bernhard Rosenkraenzer <bero@arklinux.org> 2.16.90.0.3-1ark - 2.16.90.0.3 * Mon May 2 2005 Bernhard Rosenkraenzer <bero@arklinux.org> 2.16.90.0.2-1ark - 2.16.90.0.2 * Tue Apr 12 2005 Bernhard Rosenkraenzer <bero@arklinux.org> 2.16.90.0.1-1ark - 2.16.90.0.1 * Thu Feb 24 2005 Bernhard Rosenkraenzer <bero@arklinux.org> 2.15.94.0.2.2-1ark - 2.15.94.0.2.2 * Sun Dec 26 2004 Bernhard Rosenkraenzer <bero@arklinux.org> 2.15.94.0.2-2ark - Fix build on x86_64 * Mon Dec 20 2004 Bernhard Rosenkraenzer <bero@arklinux.org> 2.15.94.0.2-1ark - 2.15.94.0.2 * Thu Dec 9 2004 Bernhard Rosenkraenzer <bero@arklinux.org> 2.15.94.0.1-1ark - 2.15.94.0.1 * Thu Sep 30 2004 Bernhard Rosenkraenzer <bero@arklinux.org> 2.15.92.0.2-1ark - Update * Sun Sep 26 2004 Bernhard Rosenkraenzer <bero@arklinux.org> 2.15.91.0.2-3ark - Add patches from uClibc buildroot * Wed Sep 22 2004 Bernhard Rosenkraenzer <bero@arklinux.org> 2.15.91.0.2-2ark - Add %_prefix/%_target_platform-* even for non-crosscompilers * Tue Aug 3 2004 Bernhard Rosenkraenzer <bero@arklinux.org> 2.15.91.0.2-1ark - 2.15.91.0.2 - Some crosscompiler build tweaks - BuildRequires flex * Thu Jun 10 2004 Bernhard Rosenkraenzer <bero@arklinux.org> 2.15.91.0.1-1ark - 2.15.91.0.1 * Sat May 1 2004 Bernhard Rosenkraenzer <bero@arklinux.org> 2.15.90.0.3-1ark - 2.15.90.0.3 * Mon Mar 15 2004 Bernhard Rosenkraenzer <bero@arklinux.org> 2.15.90.0.1.1-1ark - 2.15.90.0.1.1 - Add compiletime option for crosscompiling * Fri Jan 30 2004 Bernhard Rosenkraenzer <bero@arklinux.org> 2.14.90.0.8-1ark - 2.14.90.0.8 - Add compiletime option for static linking