summaryrefslogtreecommitdiff
path: root/repo/core/gcc.xibuild
blob: 49eab1f0780def2c30b2495038511b1bfd79a254 (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
#!/bin/bash

DEPS=(glibc)

SOURCE=https://mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-11.2.0/gcc-11.2.0.tar.xz

DESC="The GNU Compiler Collection - C and C++ frontends"


build () {
    #fix an issue breaking libasan.a

    sed -e '/static.*SIGSTKSZ/d' \
    -e 's/return kAltStackSize/return SIGSTKSZ * 4/' \
    -i libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp

    case $(uname -m) in
      x86_64)
        sed -e '/m64=/s/lib64/lib/' \
            -i.orig gcc/config/i386/t-linux64
      ;;
    esac


    mkdir -v build
    cd build

    ../configure --prefix=/usr            \
             LD=ld                    \
             --enable-languages=c,c++ \
             --disable-multilib       \
             --disable-bootstrap      \
             --with-system-zlib

    make
    # TODO put tests here, quite important
    make DESTDIR=$PKG_DEST install
}


package () {
    ln -svr /usr/bin/cpp $PKG_DEST/usr/lib
}