summaryrefslogtreecommitdiff
path: root/baserock/strata/build-essential/stage2-gcc-fixed-headers.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-gcc-fixed-headers.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-gcc-fixed-headers.morph')
-rw-r--r--baserock/strata/build-essential/stage2-gcc-fixed-headers.morph19
1 files changed, 19 insertions, 0 deletions
diff --git a/baserock/strata/build-essential/stage2-gcc-fixed-headers.morph b/baserock/strata/build-essential/stage2-gcc-fixed-headers.morph
new file mode 100644
index 00000000..10794872
--- /dev/null
+++ b/baserock/strata/build-essential/stage2-gcc-fixed-headers.morph
@@ -0,0 +1,19 @@
+name: stage2-gcc-fixed-headers
+kind: chunk
+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 "$(pwd)")"
+ target_libgcc_dir="${libgcc_dir#$sysroot}"
+ mkdir -p "$DESTDIR/$target_libgcc_dir/include-fixed"
+ cat "gcc/limitx.h" "gcc/glimits.h" "gcc/limity.h" \
+ >"$DESTDIR/$target_libgcc_dir/include-fixed/limits.h"
+