2018-04-24 12:11:31 +00:00
|
|
|
# Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
|
|
|
|
# Contributor: Allan McRae <allan@archlinux.org>
|
2011-02-05 01:42:15 +00:00
|
|
|
|
|
|
|
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
|
|
|
|
|
2011-12-09 20:46:15 +00:00
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
2018-06-06 12:50:18 +00:00
|
|
|
# - Added a CONFIGFLAG for ARM, defining our build hosts
|
|
|
|
# - --disable-sim, files provided by gdb
|
2011-01-06 00:43:53 +00:00
|
|
|
|
2011-02-05 01:42:15 +00:00
|
|
|
noautobuild=1
|
2011-01-05 07:28:13 +00:00
|
|
|
|
|
|
|
pkgname=binutils
|
2018-08-06 18:06:36 +00:00
|
|
|
pkgver=2.31.1
|
2018-12-29 01:25:22 +00:00
|
|
|
pkgrel=4
|
2017-09-09 16:46:10 +00:00
|
|
|
pkgdesc='A set of programs to assemble and manipulate binary and object files'
|
2018-01-06 20:20:15 +00:00
|
|
|
arch=(x86_64)
|
2017-09-09 16:46:10 +00:00
|
|
|
url='http://www.gnu.org/software/binutils/'
|
|
|
|
license=(GPL)
|
2018-04-24 12:11:31 +00:00
|
|
|
groups=(base-devel)
|
|
|
|
depends=(glibc zlib)
|
2017-09-09 16:46:10 +00:00
|
|
|
checkdepends=(dejagnu bc)
|
|
|
|
options=(staticlibs !distcc !ccache)
|
2018-08-12 18:45:37 +00:00
|
|
|
source=(https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz{,.sig}
|
|
|
|
0001-PR23428-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch
|
|
|
|
0002-PR23460-Close-resource-leaks-in-the-BFD-library-s-plugin-han.patch
|
|
|
|
0003-PR23460-Add-a-testcase-for-PR-binutils-23460.patch
|
|
|
|
0004-PR23486-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED-x86_64.patch
|
|
|
|
0005-PR23486-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
|
2018-12-29 01:25:22 +00:00
|
|
|
0006-PR23428-x86-Properly-add-X86_ISA_1_NEEDED-property.patch
|
|
|
|
0007-PR23919-Handle-ELF-compressed-header-alignment.patch
|
|
|
|
0008-PR23919-gold-Get-alignment-of-uncompressed-section.patch
|
|
|
|
)
|
2017-10-21 19:52:04 +00:00
|
|
|
validpgpkeys=(3A24BC1E8FB409FA9F14371813FCEF89DD9E3C4F)
|
2018-08-06 18:06:36 +00:00
|
|
|
md5sums=('5b7c9d4ce96f507d95c1b9a255e52418'
|
2018-08-12 18:45:37 +00:00
|
|
|
'SKIP'
|
|
|
|
'f2d4f2aee9ec2e25210eb132acdcf1d9'
|
|
|
|
'496e7e2d71fe558b3b85cdc27fb4638e'
|
|
|
|
'dd2284134542efe8e38137f5c829a371'
|
|
|
|
'5e4aecddbea729fd045d001e8e8db14e'
|
|
|
|
'02247a5f1c06f8a9ade689b7e68629ce'
|
2018-12-29 01:25:22 +00:00
|
|
|
'2764b8760bdc8d5c20698202d22b7fcf'
|
|
|
|
'5db54b24fb9de56d66111f63aea3b809'
|
|
|
|
'201036d5806b7b037eb53bf796219525')
|
2012-11-05 18:34:52 +00:00
|
|
|
|
2013-04-12 00:57:49 +00:00
|
|
|
prepare() {
|
2017-09-09 16:46:10 +00:00
|
|
|
mkdir -p binutils-build
|
|
|
|
|
2017-10-21 19:52:04 +00:00
|
|
|
#cd binutils-gdb
|
|
|
|
cd binutils-$pkgver
|
2015-02-09 04:07:41 +00:00
|
|
|
|
2018-08-12 18:45:37 +00:00
|
|
|
# https://sourceware.org/bugzilla/show_bug.cgi?id=23428
|
|
|
|
# https://sourceware.org/bugzilla/show_bug.cgi?id=23486
|
|
|
|
patch -Np1 -i ../0001-PR23428-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch
|
|
|
|
patch -Np1 -i ../0004-PR23486-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED-x86_64.patch
|
|
|
|
patch -Np1 -i ../0005-PR23486-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
|
|
|
|
patch -Np1 -i ../0006-PR23428-x86-Properly-add-X86_ISA_1_NEEDED-property.patch
|
|
|
|
|
|
|
|
# https://sourceware.org/bugzilla/show_bug.cgi?id=23460
|
|
|
|
patch -Np1 -i ../0002-PR23460-Close-resource-leaks-in-the-BFD-library-s-plugin-han.patch
|
|
|
|
patch -Np1 -i ../0003-PR23460-Add-a-testcase-for-PR-binutils-23460.patch
|
|
|
|
|
2018-12-29 01:25:22 +00:00
|
|
|
# FS#61151
|
|
|
|
# https://sourceware.org/bugzilla/show_bug.cgi?id=23919
|
|
|
|
patch -Np1 -i ../0007-PR23919-Handle-ELF-compressed-header-alignment.patch
|
|
|
|
patch -Np1 -i ../0008-PR23919-gold-Get-alignment-of-uncompressed-section.patch
|
|
|
|
|
2013-04-12 00:57:49 +00:00
|
|
|
# hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
|
|
|
|
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2016-02-22 13:29:51 +00:00
|
|
|
cd binutils-build
|
2011-01-05 07:28:13 +00:00
|
|
|
|
2011-05-17 03:19:40 +00:00
|
|
|
# ALARM: Specify build host types
|
2012-11-05 17:39:36 +00:00
|
|
|
[[ $CARCH == "arm" ]] && CONFIGFLAG="--host=armv5tel-unknown-linux-gnueabi --build=armv5tel-unknown-linux-gnueabi"
|
2012-11-05 16:25:15 +00:00
|
|
|
[[ $CARCH == "armv6h" ]] && CONFIGFLAG="--host=armv6l-unknown-linux-gnueabihf --build=armv6l-unknown-linux-gnueabihf"
|
|
|
|
[[ $CARCH == "armv7h" ]] && CONFIGFLAG="--host=armv7l-unknown-linux-gnueabihf --build=armv7l-unknown-linux-gnueabihf"
|
2015-07-05 01:45:02 +00:00
|
|
|
[[ $CARCH == "aarch64" ]] && CONFIGFLAG="--host=aarch64-unknown-linux-gnu --build=aarch64-unknown-linux-gnu"
|
2011-03-06 19:08:16 +00:00
|
|
|
|
2017-10-21 19:52:04 +00:00
|
|
|
"$srcdir/binutils-$pkgver/configure" \
|
2017-03-11 03:36:13 +00:00
|
|
|
--prefix=/usr \
|
2012-09-14 01:01:20 +00:00
|
|
|
--with-lib-path=/usr/lib:/usr/local/lib \
|
2013-01-05 17:40:18 +00:00
|
|
|
--with-bugurl=https://github.com/archlinuxarm/PKGBUILDs/issues \
|
2018-04-24 12:11:31 +00:00
|
|
|
--enable-deterministic-archives \
|
2017-03-11 03:36:13 +00:00
|
|
|
--enable-gold \
|
2018-04-24 12:11:31 +00:00
|
|
|
--enable-ld=default \
|
|
|
|
--enable-lto \
|
2017-03-11 03:36:13 +00:00
|
|
|
--enable-plugins \
|
2017-07-14 00:36:39 +00:00
|
|
|
--enable-relro \
|
2018-04-24 12:11:31 +00:00
|
|
|
--enable-shared \
|
|
|
|
--enable-threads \
|
2017-03-11 03:36:13 +00:00
|
|
|
--disable-gdb \
|
2018-04-24 12:11:31 +00:00
|
|
|
--disable-werror \
|
|
|
|
--with-pic \
|
2017-09-09 16:46:10 +00:00
|
|
|
--with-system-zlib \
|
2017-03-11 03:36:13 +00:00
|
|
|
--disable-sim \
|
|
|
|
$CONFIGFLAG
|
2011-01-05 07:28:13 +00:00
|
|
|
|
2011-02-05 01:42:15 +00:00
|
|
|
make configure-host
|
2013-04-04 15:28:33 +00:00
|
|
|
make tooldir=/usr
|
2011-05-17 03:19:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
2016-02-22 13:29:51 +00:00
|
|
|
cd binutils-build
|
2018-08-12 18:45:37 +00:00
|
|
|
|
2014-09-16 01:46:39 +00:00
|
|
|
# unset LDFLAGS as testsuite makes assumptions about which ones are active
|
|
|
|
# ignore failures in gold testsuite...
|
2014-10-04 00:37:12 +00:00
|
|
|
make -k LDFLAGS="" check || true
|
2011-02-05 01:42:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2016-02-22 13:29:51 +00:00
|
|
|
cd binutils-build
|
2017-09-09 16:46:10 +00:00
|
|
|
make prefix="$pkgdir/usr" tooldir="$pkgdir/usr" install
|
2016-02-22 13:29:51 +00:00
|
|
|
|
2013-01-05 17:40:18 +00:00
|
|
|
# Remove unwanted files
|
2017-09-09 16:46:10 +00:00
|
|
|
rm -f "$pkgdir"/usr/share/man/man1/{dlltool,nlmconv,windres,windmc}*
|
2012-11-25 06:26:40 +00:00
|
|
|
|
2013-01-05 17:40:18 +00:00
|
|
|
# No shared linking to these files outside binutils
|
2017-09-09 16:46:10 +00:00
|
|
|
rm -f "$pkgdir"/usr/lib/lib{bfd,opcodes}.so
|
2018-04-24 12:11:31 +00:00
|
|
|
echo 'INPUT( /usr/lib/libbfd.a -liberty -lz -ldl )' > "$pkgdir/usr/lib/libbfd.so"
|
|
|
|
echo 'INPUT( /usr/lib/libopcodes.a -lbfd )' > "$pkgdir/usr/lib/libopcodes.so"
|
2011-01-05 07:28:13 +00:00
|
|
|
}
|