summaryrefslogtreecommitdiffstats
path: root/examples/recipes/gcc.yml
blob: 2911734d8736f830af8c32f4e6440bb8fb8eadaf (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
meta:
  version: '11.2.0'
tasks:
  unpack:
    fetch:
      - name: '{{pn}}-{{pv}}.tar.xz'
        sha256: 'd08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b'
    run: |
      tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz

      sed -i -e 's@^MULTILIB_OSDIRNAMES@# &@' {{pn}}-{{pv}}/gcc/config/*/t-*

  header-stubs:
    args:
      host: 'platform'
      target: 'platform'
    output:
      default: {}
    run: |
      if {{not host_to_target.is_same}}; then
        mkdir -p {{destdir}}{{target.prefix}}/include
        touch {{destdir}}{{target.prefix}}/include/limits.h
      fi

  configure:
    args:
      host: 'platform'
      target: 'platform'
    inherit:
      task: 'unpack'
    build_depends:
      - recipe: 'toolchain'
        task: 'build_depends'
      - recipe: 'binutils'
        task: 'install'
        args:
          target: 'target'
    depends:
      - recipe: 'toolchain'
        task: 'depends'
      - recipe: 'mpc'
        task: 'install'
      - recipe: 'zlib'
        task: 'install'
      - task: 'header-stubs'
        noinherit: true
    run: |
      export CXX_FOR_TARGET="$CXX_FOR_TARGET -nostdinc++"

      mkdir {{pn}}-build
      cd {{pn}}-build
      ../{{pn}}-{{pv}}/configure \
        --build={{build.gnu_triplet}} \
        --host={{host.gnu_triplet}} \
        --target={{target.gnu_triplet}} \
        --prefix={{host.prefix}} \
        --libdir={{host.prefix}}/lib \
        --libexecdir={{host.prefix}}/lib \
        --with-sysroot={{host_to_target.sysroot}} \
        --with-build-sysroot={{sysroot}} \
        --with-native-system-header-dir={{target.prefix}}/include \
        --with-toolexeclibdir={{host_to_target.sysroot}}{{target.prefix}}/lib \
        --with-gxx-include-dir={{host_to_target.sysroot}}{{target.prefix}}/include/c++/"$(cat ../{{pn}}-{{pv}}/gcc/BASE-VER)" \
        --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
      find -name config.log -delete

  compile:
    args:
      host: 'platform'
      target: 'platform'
    inherit:
      task: 'configure'
    depends:
      - task: 'header-stubs'
        noinherit: true
    run: |
      cd {{pn}}-build
      make all-host
      find -name config.log -delete

  install:
    args:
      host: 'platform'
      target: 'platform'
    inherit:
      task: 'compile'
    output:
      default:
        runtime_depends:
          - recipe: 'binutils'
            task: 'install'
          - recipe: 'mpc'
            task: 'install'
          - recipe: 'zlib'
            task: 'install'
    run: |
      cd {{pn}}-build
      make DESTDIR={{destdir}} install-host