2021-09-14 17:17:10 -07:00
|
|
|
_target=mips
|
|
|
|
_triplet="$_target-ultra64-elf"
|
|
|
|
_prefix="/opt/$_triplet"
|
|
|
|
_sysroot="$_prefix/sysroot"
|
|
|
|
|
|
|
|
pkgname="$_triplet-binutils"
|
|
|
|
pkgver=2.37
|
2021-09-15 22:39:30 -07:00
|
|
|
pkgrel=3
|
2017-05-16 17:00:05 +00:00
|
|
|
_binutils="binutils-$pkgver"
|
2021-09-14 17:17:10 -07:00
|
|
|
pkgdesc="A set of programs to assemble and manipulate binary and object files ($_triplet)"
|
2017-05-16 17:00:05 +00:00
|
|
|
arch=('any')
|
|
|
|
license=('GPL')
|
2018-03-25 05:45:52 +02:00
|
|
|
url='http://www.gnu.org/software/binutils/'
|
2017-05-16 17:00:05 +00:00
|
|
|
depends=('zlib')
|
2021-09-15 22:39:30 -07:00
|
|
|
source=("ftp://gcc.gnu.org/pub/binutils/releases/$_binutils.tar.xz")
|
|
|
|
sha256sums=('820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c')
|
2017-05-16 17:00:05 +00:00
|
|
|
options=('!emptydirs' '!strip')
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd "$srcdir/$_binutils"
|
|
|
|
# Hack - see native package for details
|
|
|
|
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
|
2021-09-14 17:17:10 -07:00
|
|
|
# annoying oversight:
|
|
|
|
sed -i 's/\<uint\>/unsigned int/g' libiberty/rust-demangle.c
|
2017-05-16 17:00:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
# the programs we're compiling are really picky about flags.
|
|
|
|
# it's best to keep it simple.
|
|
|
|
export CFLAGS="-O2"
|
|
|
|
export CXXFLAGS="-O2"
|
|
|
|
export CPPFLAGS=""
|
|
|
|
export LDFLAGS=""
|
|
|
|
|
2021-09-14 17:17:10 -07:00
|
|
|
export CFLAGS_FOR_TARGET="-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables"
|
2017-05-16 17:00:05 +00:00
|
|
|
export CXXFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -fno-rtti"
|
|
|
|
|
|
|
|
cd "$srcdir"
|
|
|
|
[ -d "build-binutils" ] || mkdir "build-binutils"
|
|
|
|
cd "build-binutils"
|
|
|
|
|
|
|
|
local _build=
|
|
|
|
if [ -n "$MINGW_CHOST" ]; then
|
|
|
|
_build="--build=$MINGW_CHOST --host=$MINGW_CHOST"
|
|
|
|
fi
|
|
|
|
|
2021-09-14 17:17:10 -07:00
|
|
|
"../$_binutils/configure" $_build \
|
|
|
|
--target=$_target \
|
|
|
|
--prefix="$_prefix" \
|
|
|
|
\
|
2017-05-16 17:00:05 +00:00
|
|
|
--disable-gold \
|
2021-09-14 17:17:10 -07:00
|
|
|
--disable-libquadmath \
|
|
|
|
--disable-libquadmath-support \
|
2017-05-16 17:00:05 +00:00
|
|
|
--disable-multilib \
|
|
|
|
--disable-nls \
|
|
|
|
--disable-shared \
|
|
|
|
--disable-werror \
|
2021-09-14 17:17:10 -07:00
|
|
|
--enable-deterministic-archives \
|
|
|
|
--enable-lto \
|
|
|
|
--enable-static \
|
|
|
|
--with-gcc \
|
|
|
|
--with-gnu-as \
|
|
|
|
--with-gnu-ld \
|
|
|
|
--with-sysroot="$_sysroot" \
|
|
|
|
--without-included-gettext \
|
2017-05-16 17:00:05 +00:00
|
|
|
|
|
|
|
make all
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
local PREFIX="$pkgdir$_prefix"
|
|
|
|
|
|
|
|
cd "$srcdir/build-binutils"
|
|
|
|
make DESTDIR="$pkgdir" install -j1
|
|
|
|
|
|
|
|
# strip host binaries
|
2021-09-14 22:49:36 -07:00
|
|
|
find "$PREFIX" -type f -and \( -executable \) -exec strip '{}' \;
|
|
|
|
|
|
|
|
rm -r "$PREFIX/share"
|
2017-05-16 17:00:05 +00:00
|
|
|
}
|