# Automatically generated aport, do not edit! # Generator: pmbootstrap aportgen binutils-riscv64 # Based on: main/binutils CTARGET_ARCH=riscv64 CTARGET="$(arch_to_hostspec $CTARGET_ARCH)" pkgname=binutils-riscv64 pkgver=2.40 pkgrel=2 pkgdesc="Tools necessary to build programs for riscv64 targets" url="https://www.gnu.org/software/binutils/" makedepends_build="bison flex texinfo" makedepends_host="zlib-dev zstd-dev" makedepends="$makedepends_build $makedepends_host" arch="x86_64" license="GPL-2.0-or-later AND LGPL-2.1-or-later AND BSD-3-Clause" subpackages="binutils-dev binutils-doc" source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2 binutils-ld-fix-static-linking.patch 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch " builddir="$srcdir/binutils-$pkgver" if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then subpackages="$subpackages binutils-gold" fi if [ "$CHOST" != "$CTARGET" ]; then pkgname="binutils-$CTARGET_ARCH" subpackages="" sonameprefix="binutils:" fi # secfixes: # 2.39-r2: # - CVE-2022-38533 # 2.39-r0: # - CVE-2022-38126 # 2.35.2-r1: # - CVE-2021-3487 # 2.32-r0: # - CVE-2018-19931 # - CVE-2018-19932 # - CVE-2018-20002 # - CVE-2018-20712 # 2.28-r1: # - CVE-2017-7614 build() { local _sysroot=/ local _cross_configure="--enable-install-libiberty --enable-shared" local _arch_configure="" local _gold_configure="--disable-gold" local _plugin_configure="--enable-plugins" case "$CARCH" in riscv64) # binutils creates empty textrels here # https://sourceware.org/bugzilla/show_bug.cgi?id=25694 local no_textrels="" ;; *) # set -z text by default # this is the default for linkers such as ld.lld too local no_textrels="--enable-textrel-check=error" ;; esac if [ "$CHOST" != "$CTARGET" ]; then _sysroot="$CBUILDROOT" _cross_configure="--disable-install-libiberty" _plugin_configure="--disable-plugins" fi if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then _gold_configure="--enable-gold" fi if [ "$CTARGET_ARCH" = "x86_64" ]; then _arch_configure="--enable-targets=x86_64-pep" fi if [ "$CTARGET_ARCH" = "riscv64" ]; then _gold_configure="--disable-gold" fi ./configure \ --build=$CBUILD \ --host=$CHOST \ --target=$CTARGET \ --with-build-sysroot="$CBUILDROOT" \ --with-sysroot=$_sysroot \ --prefix=/usr \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --disable-multilib \ --disable-gprofng \ --enable-ld=default \ $_gold_configure \ --enable-64-bit-bfd \ $_plugin_configure \ --enable-relro \ --enable-deterministic-archives \ --enable-default-execstack=no \ $_cross_configure \ $_arch_configure \ --enable-default-hash-style=gnu \ $_hash_style_configure \ $no_textrels \ --with-pic \ --disable-werror \ --disable-nls \ --with-mmap \ --with-system-zlib make } package() { make install DESTDIR="$pkgdir" if [ -d "$pkgdir"/usr/lib64 ]; then mv "$pkgdir"/usr/lib64/* "$pkgdir"/usr/lib/ rmdir "$pkgdir"/usr/lib64 fi if [ "$CHOST" != "$CTARGET" ]; then # creating cross tools: remove any files that would conflict # with the native tools, or other cross tools rm -r "${pkgdir:?}"/usr/share rm -f "$pkgdir"/usr/lib/libiberty.a rm -r "${pkgdir:?}"/usr/lib/bfd-plugins fi } libs() { pkgdesc="Runtime libraries from binutils - libbfd and libopcodes" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/lib*.so "$subpkgdir"/usr/lib/ } gold() { pkgdesc="GNU binutils - gold linker" if [ -e "$pkgdir"/usr/bin/ld.gold ]; then mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/ld.gold "$subpkgdir"/usr/bin fi mkdir -p "$subpkgdir"/usr/$CTARGET/bin mv "$pkgdir"/usr/$CTARGET/bin/ld.gold "$subpkgdir"/usr/$CTARGET/bin/ld.gold } sha512sums=" 30256362945184329c994730f60d8493292547e0e5de5f49d57490d8d9b1a0a18393bf7f70934ba5061ee2001ec4cbf5f206d310df9512a7fb3625a362e358f9 binutils-2.40.tar.bz2 ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch 70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch "