summaryrefslogtreecommitdiff
path: root/elements/gnu-toolchain/stage2-reset-specs.bst
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2017-08-24 12:56:15 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2017-08-24 12:56:15 +0000
commit6632adf452a9f514545a1f8be8adcd922a0ccbc5 (patch)
treedd0f4774ed3d9f67950d51a95da409597db48610 /elements/gnu-toolchain/stage2-reset-specs.bst
parent54e447a9f1a9e94d68e6f5f616617ce49682192a (diff)
parent879a306c8c6285e9ef8dcbbba96bb84e62a9654c (diff)
downloaddefinitions-6632adf452a9f514545a1f8be8adcd922a0ccbc5.tar.gz
Merge remote-tracking branch 'buildstream-tests/gnu-toolchain' into sam/buildstream-autoconvert
This branch contains a manual conversion of the Baserock bootstrap process to BuildStream. The original branch can be found here: https://gitlab.com/BuildStream/buildstream-tests/tree/gnu-toolchain It's not possible to automatically convert the existing Baserock bootstrap due to differences in how BuildStream works.
Diffstat (limited to 'elements/gnu-toolchain/stage2-reset-specs.bst')
-rw-r--r--elements/gnu-toolchain/stage2-reset-specs.bst35
1 files changed, 35 insertions, 0 deletions
diff --git a/elements/gnu-toolchain/stage2-reset-specs.bst b/elements/gnu-toolchain/stage2-reset-specs.bst
new file mode 100644
index 00000000..5910903e
--- /dev/null
+++ b/elements/gnu-toolchain/stage2-reset-specs.bst
@@ -0,0 +1,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"