summaryrefslogtreecommitdiffstats
path: root/examples/gcc.yml
blob: 7a215a926f401734e189bf17b7270d9990aab37c (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
tasks:
  unpack:
    fetch:
      - name: 'gcc-11.2.0.tar.xz'
        sha256: 'd08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b'
    run: |
      tar xf "${DLDIR}/gcc-11.2.0.tar.xz"

      sed -i -e 's@^MULTILIB_OSDIRNAMES@# &@' gcc-11.2.0/gcc/config/*/t-*

  header-stubs:
    output:
      default: {}
    run: |
      mkdir -p "${DESTDIR}${PREFIX}/include"
      touch "${DESTDIR}${PREFIX}/include/limits.h"

  configure:
    inherit:
      task: 'gcc:unpack'
    build_depends:
      - task: 'binutils:install'
    target_depends:
      - task: 'gcc:header-stubs'
    run: |
      BUILD=x86_64-linux-gnu
      HOST=x86_64-linux-gnu
      TARGET=aarch64-linux-gnu

      mkdir gcc-build
      cd gcc-build
      ../gcc-11.2.0/configure \
        --build="${BUILD}" \
        --host="${HOST}" \
        --target=${TARGET} \
        --prefix="${BUILD_PREFIX}" \
        --libdir=${BUILD_PREFIX}/lib \
        --libexecdir=${BUILD_PREFIX}/lib \
        --with-sysroot="${SYSROOT}" \
        --with-native-system-header-dir=${PREFIX}/include \
        --with-build-time-tools="${BUILD_PREFIX}/${TARGET}/bin" \
        --with-gnu-ld \
        --enable-shared \
        --enable-languages=c,c++ \
        --enable-threads=posix \
        --disable-multilib \
        --enable-c99 \
        --enable-long-long \
        --enable-symvers=gnu \
        --enable-libstdcxx-pch \
        --without-local-prefix \
        --disable-install-libiberty \
        --disable-libssp \
        --enable-libitm \
        --enable-lto \
        --disable-bootstrap \
        --with-system-zlib \
        --with-linker-hash-style=gnu \
        --enable-linker-build-id \
        --with-ppl=no \
        --with-cloog=no \
        --enable-checking=release \
        --enable-cheaders=c_global \
        --without-isl \
        --with-system-zlib \
        --enable-standard-branch-protection \
        --with-glibc-version=2.28 \
        --enable-initfini-array \
        --enable-__cxa_atexit

  compile:
    inherit:
      task: 'gcc:configure'
    build_depends:
      - task: 'binutils:install'
    target_depends:
      - task: 'gcc:header-stubs'
    run: |
      cd gcc-build
      make -j8 all-host

  install:
    inherit:
      task: 'gcc:compile'
    output:
      default: {}
    run: |
      cd gcc-build
      make DESTDIR="$DESTDIR" install-host