summaryrefslogtreecommitdiff
path: root/baserock/strata/build-essential/stage2-reset-specs.morph
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2015-09-25 08:47:49 +0000
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2015-09-26 08:27:41 +0100
commit3a2f641e4e70e76ffa77629c6208970c1a7af667 (patch)
treee6635788976c616017c05b5ea93432f9b2dc769e /baserock/strata/build-essential/stage2-reset-specs.morph
parentc844667a718e8640d9ae2b7640a3b0dc0fb53b0e (diff)
downloaddefinitions-baserock/ps/reorganise-definitions.tar.gz
Proposed re-org of definitions repobaserock/ps/reorganise-definitions
Diffstat (limited to 'baserock/strata/build-essential/stage2-reset-specs.morph')
-rw-r--r--baserock/strata/build-essential/stage2-reset-specs.morph21
1 files changed, 21 insertions, 0 deletions
diff --git a/baserock/strata/build-essential/stage2-reset-specs.morph b/baserock/strata/build-essential/stage2-reset-specs.morph
new file mode 100644
index 00000000..8892f67c
--- /dev/null
+++ b/baserock/strata/build-essential/stage2-reset-specs.morph
@@ -0,0 +1,21 @@
+name: stage2-reset-specs
+kind: chunk
+
+# 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 "$(pwd)")"
+ specs_dir="$(dirname $($TARGET_STAGE1-gcc -print-libgcc-file-name))"
+ target_specs_dir="$DESTDIR/${specs_dir#$STAGE2_SYSROOT}"
+ mkdir -p "$target_specs_dir"
+ ln -s "temporary specs removed by baserock bootstrap" "$target_specs_dir/specs"