summaryrefslogtreecommitdiff
path: root/elements/gnu-toolchain/stage2-gcc-fixed-headers.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-gcc-fixed-headers.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-gcc-fixed-headers.bst')
-rw-r--r--elements/gnu-toolchain/stage2-gcc-fixed-headers.bst37
1 files changed, 37 insertions, 0 deletions
diff --git a/elements/gnu-toolchain/stage2-gcc-fixed-headers.bst b/elements/gnu-toolchain/stage2-gcc-fixed-headers.bst
new file mode 100644
index 00000000..80c9bf32
--- /dev/null
+++ b/elements/gnu-toolchain/stage2-gcc-fixed-headers.bst
@@ -0,0 +1,37 @@
+kind: manual
+
+sources:
+- kind: git
+ url: upstream:gcc-tarball
+ track: baserock/gcc-7.1.0
+ ref: 3b0dbcfa2e5d12bd80cab1b35f08653d61fe7838
+
+depends:
+- filename: gnu-toolchain/stage1.bst
+ type: build
+- 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:
+ install-commands:
+ # Stage 1 GCC's fixincludes process created a limits.h before there was
+ # a real limits.h available for the target. This step (taken from Linux
+ # Linux From Scratch) creates a better one so that stage 2 GCC can compile.
+ #
+ # THIS IS A FRAGILE HACK! We need to replace the headers. The only way to
+ # overwrite files in a staging area is to install a new chunk.
+ # This is undesired behaviour in the long term, as we want to never
+ # have overlaps, so this functionality may go away.
+ - |
+ libgcc_dir=$(dirname $(%{target-stage1}-gcc -print-libgcc-file-name))
+ sysroot="$(dirname $(dirname $(pwd)))"
+ target_libgcc_dir="${libgcc_dir#$sysroot}"
+ mkdir -p "%{install-root}/$target_libgcc_dir/include-fixed"
+ cat "gcc/limitx.h" "gcc/glimits.h" "gcc/limity.h" \
+ >"%{install-root}/$target_libgcc_dir/include-fixed/limits.h"