summaryrefslogtreecommitdiff
path: root/elements/gnu-toolchain/stage2-reset-specs.bst
blob: 5910903e879606bac22abebbaf7b08c2b3bfcb72 (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
kind: manual

depends:
- filename: gnu-toolchain/stage1.bst
  type: build
- filename: gnu-toolchain/stage2-fhs-dirs.bst
  type: runtime
- gnu-toolchain/stage2-linux-api-headers.bst
- gnu-toolchain/stage2-glibc.bst

variables:
  prefix: /tools

environment:
  PATH: /tools/bin:/usr/bin:/bin:/usr/sbin:/sbin

config:
  # Nasty hack to get around being unable to reliably add configuration to gcc,
  # hence the gcc specs are modified, combined with Baserock's rootfs protection
  # preventing specs being modified before builds.
  # The limitation is overcome by installing files as part of a chunk, which
  # overwrites previous files.
  # New specs were added for the bootstrap builds, but after stage2 we start
  # having chrooted builds, so the old specs need to be replaced.
  # Unfortunately we can't just replace the specs with the ones gcc produces,
  # since gcc behaves differently without specs to with specs it produces!
  # So we use a **NASTY HACK** to replace the specs symlink with one that
  # points to a file that doesn't exist.
  install-commands:
  - |
    STAGE2_SYSROOT="$(dirname $(dirname $(pwd)))"
    specs_dir="$(dirname $(%{target-stage1}-gcc -print-libgcc-file-name))"
    target_specs_dir="%{install-root}/${specs_dir#$STAGE2_SYSROOT}"
    mkdir -p "$target_specs_dir"
    ln -s "temporary specs removed by baserock bootstrap" "$target_specs_dir/specs"