diff --git a/x86_64-linux-gnu-binutils/PKGBUILD b/x86_64-linux-gnu-binutils/PKGBUILD new file mode 100644 index 000000000..27c94afad --- /dev/null +++ b/x86_64-linux-gnu-binutils/PKGBUILD @@ -0,0 +1,72 @@ +# Contributor: Levi Zim +# Contributor: Anatol Pomozov + +_target=x86_64-linux-gnu +pkgname=$_target-binutils +pkgver=2.43 +pkgrel=1 +pkgdesc='A set of programs to assemble and manipulate binary and object files for the ARM64 target' +arch=(riscv64) +url='https://www.gnu.org/software/binutils/' +license=(GPL) +depends=(zlib libelf) +source=(https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2{,.sig}) +sha1sums=('9b0b465bf52fdbb677bd67ba64424842e297ebcd' + 'SKIP') +sha256sums=('fed3c3077f0df7a4a1aa47b080b8c53277593ccbb4e5e78b73ffb4e3f265e750' + 'SKIP') +validpgpkeys=('3A24BC1E8FB409FA9F14371813FCEF89DD9E3C4F') # Nick Clifton (Chief Binutils Maintainer) + +prepare() { + cd binutils-$pkgver + sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure +} + +build() { + cd binutils-$pkgver + + if [ "${CARCH}" != "i686" ]; + then + # enabling gold linker at i686 makes the install fail + enable_gold='--enable-gold' + fi + + ./configure --target=$_target \ + --with-sysroot=/usr/$_target \ + --prefix=/usr \ + --enable-multilib \ + --with-gnu-as \ + --with-gnu-ld \ + --disable-nls \ + --enable-ld=default \ + $enable_gold \ + --enable-plugins \ + --enable-deterministic-archives + + make +} + +check() { + cd binutils-$pkgver + + # unset LDFLAGS as testsuite makes assumptions about which ones are active + # do not abort on errors - manually check log files + make -k LDFLAGS="" check || true +} + +package() { + cd binutils-$pkgver + + make DESTDIR="$pkgdir" install + + # Remove file conflicting with host binutils and manpages for MS Windows tools + rm "$pkgdir"/usr/share/man/man1/$_target-{dlltool,windres,windmc}* + rm "$pkgdir"/usr/lib/bfd-plugins/libdep.so + rm "$pkgdir"/usr/etc/gprofng.rc + rm "$pkgdir"/usr/lib/libgprofng.a + rm -r "$pkgdir"/usr/include + rm -r "$pkgdir"/usr/lib/gprofng/ + + # Remove info documents that conflict with host version + rm -r "$pkgdir"/usr/share/info +}