OCaml 4.14.0 rebuild
[arch-packages.git] / binutils / repos / core-x86_64 / PKGBUILD
blobecb0fa9e983d5cf34506bc9a78c9c865d17e573c
1 # Maintainer: Giancarlo Razzolini <grazzolini@archlinux.org>
2 # Maintainer: Frederik Schwan <freswa at archlinux dot org>
3 # Contributor:  BartÅ‚omiej Piotrowski <bpiotrowski@archlinux.org>
4 # Contributor: Allan McRae <allan@archlinux.org>
6 # toolchain build order: linux-api-headers->glibc->binutils->gcc->glibc->binutils->gcc
8 pkgname=binutils
9 pkgver=2.39
10 _commit=b51c2fec1da205ea3e7354cbb3e253018d64873c
11 pkgrel=2
12 pkgdesc='A set of programs to assemble and manipulate binary and object files'
13 arch=(x86_64)
14 url='https://www.gnu.org/software/binutils/'
15 license=('GPL3' 'GPL' 'FDL1.3' 'custom:FSFAP')
16 groups=(base-devel)
17 depends=(glibc zlib libelf jansson)
18 makedepends=(git)
19 checkdepends=(dejagnu debuginfod bc)
20 optdepends=('debuginfod: for debuginfod server/client functionality')
21 conflicts=(binutils-multilib)
22 replaces=(binutils-multilib)
23 options=(staticlibs !distcc !ccache debug)
24 source=(git+https://sourceware.org/git/binutils-gdb.git#commit=${_commit}
25         gold-warn-unsupported.patch)
26 sha256sums=('SKIP'
27             '2d430b66f84a19c154725ec535280c493be1d34f1a90f95208dce02fecd0e4e4')
28 validpgpkeys=(3A24BC1E8FB409FA9F14371813FCEF89DD9E3C4F)
30 prepare() {
31   [[ ! -d binutils-gdb ]] && ln -s binutils-$pkgver binutils-gdb
32   mkdir -p binutils-build
34   cd binutils-gdb
36   # Turn off development mode (-Werror, gas run-time checks, date in sonames)
37   sed -i '/^development=/s/true/false/' bfd/development.sh
39   # Creds @Fedora
40   # Change the gold configuration script to only warn about
41   # unsupported targets.  This allows the binutils to be built with
42   # BPF support enabled.
43   patch -Np1 -i "${srcdir}"/gold-warn-unsupported.patch
46 build() {
47   cd binutils-build
49   "$srcdir/binutils-gdb/configure" \
50     --prefix=/usr \
51     --with-lib-path=/usr/lib:/usr/local/lib \
52     --with-bugurl=https://bugs.archlinux.org/ \
53     --enable-cet \
54     --enable-deterministic-archives \
55     --enable-gold \
56     --enable-install-libiberty \
57     --enable-jansson \
58     --enable-ld=default \
59     --enable-pgo-build=lto \
60     --enable-plugins \
61     --enable-relro \
62     --enable-shared \
63     --enable-targets=x86_64-pep,bpf-unknown-none \
64     --enable-threads \
65     --disable-gdb \
66     --disable-gdbserver \
67     --disable-libdecnumber \
68     --disable-readline \
69     --disable-sim \
70     --disable-werror \
71     --with-debuginfod \
72     --with-pic \
73     --with-system-zlib
75   make -O tooldir=/usr
77   # Extract the FSF All Permissive License
78   # <https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html>
79   # used for some linker scripts.
80   tail -n 5 "${srcdir}"/binutils-gdb/ld/scripttempl/README > FSFAP
83 check() {
84   cd binutils-build
86   # Use minimal flags for testsuite
87   # ld testsuite uses CFLAGS_FOR_TARGET and requires -g
88   # gold testsuite requires CXXFLAGS/CFLAGS with default PIE/PIC disabled
89   make -O CFLAGS_FOR_TARGET="-O2 -g" \
90           CXXFLAGS="-O2 -no-pie -fno-PIC" \
91           CFLAGS="-O2 -no-pie" \
92           LDFLAGS="" \
93           check || true
96 package() {
97   cd binutils-build
98   make prefix="$pkgdir/usr" tooldir="$pkgdir/usr" install
100   # install PIC version of libiberty
101   install -m644 libiberty/pic/libiberty.a "$pkgdir/usr/lib"
103   # Remove unwanted files
104   rm -f "$pkgdir"/usr/share/man/man1/{dlltool,windres,windmc}*
106   # No shared linking to these files outside binutils
107   rm -f "$pkgdir"/usr/lib/lib{bfd,opcodes}.so
108   echo 'INPUT( /usr/lib/libbfd.a -liberty -lz -ldl )' > "$pkgdir/usr/lib/libbfd.so"
109   echo 'INPUT( /usr/lib/libopcodes.a -lbfd )' > "$pkgdir/usr/lib/libopcodes.so"
111   # install FSF All Permissive License
112   install -Dm644 -t "${pkgdir}"/usr/share/licenses/${pkgname}/ FSFAP