summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2013-08-14 12:10:53 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2013-08-16 14:27:19 +0000
commit142590607bba66ea4111c217d9895706efeac1d5 (patch)
tree3204177a9c01d611d3a352ffd02c8cef2fca8c0b
parentcacfffaed987a877570ee8551c2fc669916fe8ec (diff)
downloadgcc-tarball-baserock/richardmaw/S8564/ro-staging-area.tar.gz
Don't write to the staging area any morebaserock/richardmaw/S8564/ro-staging-area
The command to fix steps is no longer possible, or necessary, since eglibc installs some fixed headers. However, gcc needs to fix the previous gcc's headers now. During our first build of gcc we did not have all the system headers available. This was sufficient to build the earlier chunks and some parts of gcc. However, now we have a more difficult gcc build, so the headers need to be able to fall back to system headers, which the headers made earlier don't. This is an artifact that has eglibc as a build-dependency and needs the gcc source tree to do it, which technically means it has to be a separate chunk built from gcc's source. This is unfortunate, due to gcc's size, but adding the new chunk is the only way to replace files in our current architecture for building. To this end, building stage2's gcc involves first building the fixed headers, then building gcc itself.
-rw-r--r--stage2-gcc-fixed-headers.morph19
-rw-r--r--stage2-gcc.morph16
2 files changed, 19 insertions, 16 deletions
diff --git a/stage2-gcc-fixed-headers.morph b/stage2-gcc-fixed-headers.morph
new file mode 100644
index 0000000000..034a6b79e9
--- /dev/null
+++ b/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"
+
diff --git a/stage2-gcc.morph b/stage2-gcc.morph
index b747cf9182..691911a434 100644
--- a/stage2-gcc.morph
+++ b/stage2-gcc.morph
@@ -2,22 +2,6 @@ name: stage2-gcc
kind: chunk
configure-commands:
- - stage2-eglibc-fix-specs
-
- # 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 have a staging area built from hardlinked
- # chunk artifacts at this point and we sidestep that by moving a file
- # over the hardlink, so as not to alter the original file. Maybe we could
- # fix things by altering the include path instead, but this might be even
- # more fragile.
- - |
- cat "gcc/limitx.h" "gcc/glimits.h" "gcc/limity.h" > limits.h.tmp
- libgcc_dir=$(dirname $($TARGET_STAGE1-gcc -print-libgcc-file-name))
- cp limits.h.tmp "$libgcc_dir/include-fixed/limits.h"
-
- mkdir o
# In other projects we specify the sysroot location using CPPFLAGS. Here,