#!/bin/sh MAKEDEPS="make dejagnu bzip2 xz zlib zstd patch" DEPS="musl zlib libelf" PKG_VER=2.37 SOURCE=https://ftp.gnu.org/gnu/binutils/binutils-$PKG_VER.tar.xz PATCH_SOURCE="https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/patches/binutils-alpine" ADDITIONAL=" $PATCH_SOURCE/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch $PATCH_SOURCE/bfd-close-file-desriptor-if-there-is-no-archive-fd.patch $PATCH_SOURCE/binutils-ld-fix-static-linking.patch $PATCH_SOURCE/defang-no-split.patch " DESC="Tools for handling object files" prepare () { for p in *.patch; do patch -Np1 -i $p || true done find . -name '[a-z]*\.[0-9]*' -empty -exec rm -f {} \; } build () { mkdir build cd build case $(uname -m) in x86_64) export EXTRA_CONFIG=" --enable-targets=x86_64-pep " ;; i686) export EXTRA_CONFIG=" --disable-separate-code --enable-targets=x86_64-linux-gnu,x86_64-pep" ;; esac ../configure \ --prefix=/usr \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --disable-multilib \ --enable-ld=default \ --enable-gold \ --enable-64-bit-bfd \ --enable-plugins \ --enable-relro \ --enable-deterministic-archives \ --enable-targets=x86_64-pep \ --enable-default-hash-style=gnu \ --with-pic \ --disable-werror \ --disable-nls \ --with-mmap \ --with-system-zlib make tooldir=/usr } #check () { #make -k check || true #} package() { make -j1 tooldir=/usr DESTDIR=$PKG_DEST install cd .. # how about we use binutils ld? rm -f $PKG_DEST/usr/bin/ld ln -sf /usr/bin/ld.bfd $PKG_DEST/usr/bin/ld install -m 644 include/libiberty.h $PKG_DEST/usr/include install -m 644 include/demangle.h $PKG_DEST/usr/include for f in dlltool nlmconv windres windmc; do rm -f $PKG_DEST/usr/share/man/man1/${f}.1 done }