pkgname=binutils pkgver=2.43+r4+g7999dae69612 pkgrel=1 pkgdesc="A set of programs to assemble and manipulate binary and object files" arch=('x86_64') url="https://www.gnu.org/software/binutils" license=( 'GPL-2.0-or-later' 'GPL-3.0-or-later' 'LGPL-2.0-or-later' 'LGPL-3.0-or-later' 'GFDL-1.3' 'FSFAP' ) depends=('glibc' 'jansson' 'libelf' 'zlib' 'zstd') makedepends=('git') backup=(etc/gprofng.rc) options=('!staticlibs' '!distcc' '!ccache') source=(git+https://mirrors.tuna.tsinghua.edu.cn/git/binutils-gdb.git#commit=7999dae69612295e1bbffe64aff87044372a0059 gold-warn-unsupported.patch) sha256sums=(4726efb1f887c659cfb6aa198f18ca638d405f58ee1eeda4df3eb201c1169a67 2d430b66f84a19c154725ec535280c493be1d34f1a90f95208dce02fecd0e4e4) pkgver() { cd binutils-gdb git describe --abbrev=12 --tags | sed 's/[^-]*-//;s/[^-]*-/&r/;s/-/+/g;s/_/./' } prepare() { cd binutils-gdb mkdir -p ${srcdir}/binutils-build # Turn off development mode (-Werror, gas run-time checks, date in sonames) sed -i '/^development=/s/true/false/' bfd/development.sh # Creds @Fedora # Change the gold configuration script to only warn about # unsupported targets. This allows the binutils to be built with # BPF support enabled. patch -Np1 -i ${srcdir}/gold-warn-unsupported.patch } build() { cd binutils-build ${srcdir}/binutils-gdb/configure \ --prefix=/usr \ --libdir=/usr/lib64 \ --sysconfdir=/etc \ --with-lib-path=/usr/lib64:/usr/local/lib64 \ --enable-cet \ --enable-colored-disassembly \ --enable-default-execstack=no \ --enable-deterministic-archives \ --enable-gold \ --enable-install-libiberty \ --enable-jansson \ --enable-ld=default \ --enable-new-dtags \ --enable-pgo-build=lto \ --enable-plugins \ --enable-relro \ --enable-shared \ --enable-targets=x86_64-pep,bpf-unknown-none \ --enable-threads \ --disable-gdb \ --disable-gdbserver \ --disable-libdecnumber \ --disable-readline \ --disable-sim \ --disable-werror \ --with-debuginfod \ --with-pic \ --with-system-zlib \ make -O tooldir=/usr } package() { cd binutils-build make DESTDIR=${pkgdir} tooldir=/usr install }