# $Id$ # Maintainer: Allan McRae # toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc pkgname=binutils pkgver=2.27 pkgrel=1.91 pkgdesc="A set of programs to assemble and manipulate binary and object files" arch=('i686' 'x86_64') url="https://www.gnu.org/software/binutils/" license=('GPL') groups=('base-devel') depends=('glibc>=2.24-2' 'zlib') makedepends=('git') checkdepends=('dejagnu' 'bc') conflicts=('binutils-multilib') replaces=('binutils-multilib') options=('staticlibs' '!distcc' '!ccache') source=("https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2"{,.sig}) validpgpkeys=('EAF1C276A747E9ED86210CBAC3126D3B4AE55E93') # Tristan Gingold sha512sums=('cf276f84935312361a2ca077e04d0b469d23a3aed979d8ba5d92ea590904ffb2c2e7ed12cc842822bfc402836be86f479660cef3791aa62f3753d8a1a6f564cb' 'a0eb45809667850c2ef85be64ba0637a9a9b721bc77b24d0630f2f420855c33b9d781378fb58f4b0a4856caebf54c49d5e22d5f90761c419c1d0f7167da48f4a') # https://mirrors.kernel.org/sourceware/binutils/sha512.sum prepare() { cd binutils-$pkgver # hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS" sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure mkdir ${srcdir}/binutils-build } build() { cd binutils-build ../binutils-$pkgver/configure \ --prefix=/usr \ --with-lib-path=/usr/lib:/usr/local/lib \ --with-bugurl=https://bugs.archlinux.org/ \ --enable-threads \ --enable-shared \ --with-pic \ --enable-ld=default \ --enable-gold \ --enable-plugins \ --enable-deterministic-archives \ --disable-werror \ --disable-gdb # check the host environment and makes sure all the necessary tools are available make configure-host make tooldir=/usr } check() { cd binutils-build # unset LDFLAGS as testsuite makes assumptions about which ones are active # ignore failures in gold testsuite... make -k LDFLAGS="" check || true } package() { cd binutils-build make prefix=${pkgdir}/usr tooldir=${pkgdir}/usr install # Remove unwanted files rm ${pkgdir}/usr/share/man/man1/{dlltool,nlmconv,windres,windmc}* # No shared linking to these files outside binutils rm ${pkgdir}/usr/lib/lib{bfd,opcodes}.so echo "INPUT ( /usr/lib/libbfd.a -liberty -lz -ldl )" > "$pkgdir"/usr/lib/libbfd.so echo "INPUT ( /usr/lib/libopcodes.a -lbfd )" > "$pkgdir"/usr/lib/libopcodes.so }