summaryrefslogtreecommitdiff
path: root/repo/system/binutils/binutils.xibuild
blob: f7172ea4210b44d990b4bd0ebf8d49247de49b27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/sh

MAKEDEPS="make dejagnu bzip2 xz zlib zstd patch"
DEPS="musl zlib libelf"

PKG_VER=2.38
SOURCE=https://ftp.gnu.org/gnu/binutils/binutils-$PKG_VER.tar.xz

ADDITIONAL="
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
binutils-ld-fix-static-linking.patch
defang-no-split.patch
"

DESC="Tools for handling object files"

prepare () {
    apply_patches

    find . -name '[a-z]*\.[0-9]*' -empty -exec rm -f {} \; 
}

build () {
    mkdir    build
    cd       build

    ../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-install-libiberty \
		--enable-deterministic-archives \
        --enable-targets=x86_64-pep \
        --enable-default-hash-style=gnu \
		--with-pic \
		--disable-werror \
		--disable-nls \
        --with-system-zlib \
		--with-mmap

    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
}