Skip to content

Commit

Permalink
addpkg: x86_64-linux-gnu-binutils 2.43-1
Browse files Browse the repository at this point in the history
Based on aarch64-linux-gnu-binutils.
  • Loading branch information
kxxt committed Dec 9, 2024
1 parent e2a3dfb commit 713b020
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions x86_64-linux-gnu-binutils/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Contributor: Levi Zim <[email protected]>
# Contributor: Anatol Pomozov <[email protected]>

_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) <[email protected]>

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
}

0 comments on commit 713b020

Please sign in to comment.