summaryrefslogtreecommitdiff
path: root/strata/build-essential/stage2-gcc-fixed-headers.def
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2014-11-19 16:09:07 +0000
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2014-11-19 16:09:07 +0000
commit53c7140bfe3317abeeaa85fc2f72cc8d9b052355 (patch)
tree7f02dd4c306b5619988b87b9a2a5cf28a5fcd02b /strata/build-essential/stage2-gcc-fixed-headers.def
parente3e0baf91a5f0e1bcd1fad06345bbe4ec88fad1d (diff)
downloaddefinitions-baserock/ps/simple-defs.tar.gz
After morph-converter.shbaserock/ps/simple-defs
Diffstat (limited to 'strata/build-essential/stage2-gcc-fixed-headers.def')
-rw-r--r--strata/build-essential/stage2-gcc-fixed-headers.def18
1 files changed, 18 insertions, 0 deletions
diff --git a/strata/build-essential/stage2-gcc-fixed-headers.def b/strata/build-essential/stage2-gcc-fixed-headers.def
new file mode 100644
index 00000000..1c9e70e1
--- /dev/null
+++ b/strata/build-essential/stage2-gcc-fixed-headers.def
@@ -0,0 +1,18 @@
+name: stage2-gcc-fixed-headers
+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"
+