summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2015-01-09 15:18:30 +0000
committerTiago Gomes <tiago.gomes@codethink.co.uk>2015-01-22 16:55:13 +0000
commite5ba32eda38f158169cc2d389184a2c6e2241f5c (patch)
tree51699767bae7f48cfc8a06d5e93704a11203dc0a
parent9a51513af252ac3b828958d3d251928d5a5743cc (diff)
downloaddefinitions-e5ba32eda38f158169cc2d389184a2c6e2241f5c.tar.gz
Improve the readability and docs of gcc morphologies
No functional changes here. It will ease the review of the following commmits.
-rw-r--r--strata/build-essential/gcc.morph40
-rw-r--r--strata/build-essential/stage1-gcc.morph55
-rw-r--r--strata/build-essential/stage2-gcc.morph65
3 files changed, 89 insertions, 71 deletions
diff --git a/strata/build-essential/gcc.morph b/strata/build-essential/gcc.morph
index 50e2918c..63d4ad4c 100644
--- a/strata/build-essential/gcc.morph
+++ b/strata/build-essential/gcc.morph
@@ -8,27 +8,29 @@ configure-commands:
# 1. An attempt to stop anything going in $PREFIX/lib64 (which doesn't
# fully work; we will need to hobble the multilib configuration in
# config/i386/t-linux64 if we really want to kill /lib64).
-# 2. Multilib does not make sense in Baserock.
-# 3. Optimisation libraries which for now we do without.
-# 4. Recommended by Linux From Scratch; required for C++ ABI
+# 2. MPFR is built in the GCC tree, we need to locate it.
+# 3. Avoid having more than one copy of ZLib in use on the system
+# 4. Optimisation libraries which for now we do without.
+# 5. Multilib does not make sense in Baserock.
+# 6. Recommended by Linux From Scratch; required for C++ ABI
# compatibility with other Linux distributions.
-# 5. MPFR is built in the GCC tree, we need to locate it.
-# 6. Avoid having more than one copy of ZLib in use on the system
- |
- cd o && \
- ../configure \
- $(../morph-arch-config) \
- --prefix="$PREFIX" \
- `# [1]` --libdir=$PREFIX/lib \
- --disable-nls \
- --enable-languages=c,c++,fortran \
- --enable-shared --enable-threads=posix \
- `# [2]` --disable-multilib \
- `# [3]` --disable-libgomp --without-cloog --without-ppl \
- `# [4]` --enable-__cxa_atexit \
- `# [5]` --with-mpfr-include="$(pwd)/../mpfr/src" \
- --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \
- `# [6]` --with-system-zlib
+ cd o && ../configure \
+ $(../morph-arch-config) \
+ --prefix="$PREFIX" \
+ `# [1]` --libdir=$PREFIX/lib \
+ `# [2]` --with-mpfr-include="$(pwd)/../mpfr/src" \
+ `# [2]` --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \
+ `# [3]` --with-system-zlib \
+ `# [4]` --without-cloog \
+ `# [4]` --without-ppl \
+ --disable-nls \
+ `# [5]` --disable-multilib \
+ --disable-libgomp \
+ `# [6]` --enable-__cxa_atexit \
+ --enable-shared \
+ --enable-threads=posix \
+ --enable-languages=c,c++,fortran
build-commands:
- cd o && make
diff --git a/strata/build-essential/stage1-gcc.morph b/strata/build-essential/stage1-gcc.morph
index 0cb03568..0574749b 100644
--- a/strata/build-essential/stage1-gcc.morph
+++ b/strata/build-essential/stage1-gcc.morph
@@ -5,34 +5,45 @@ configure-commands:
- mkdir o
# Configure flag notes:
-# 1. Standard flags. See gcc.morph.
+# 1. See gcc.morph.
# 2. Disable searching /usr/local/include for headers
-# 3. The pass 1 compiler needs to find the libraries we build in pass 2.
-# Include path must be set explicility, because it defaults to
-# $SYSROOT/usr/include rather than $SYSROOT/include.
-# FIXME: this flag is not present until GCC 4.6.3!
+# 3. The pass 1 compiler needs to find the libraries we build in pass
+# 2. Include path must be set explicility, because it defaults to
+# $SYSROOT/usr/include rather than $SYSROOT/include. FIXME: this
+# flag is not present until GCC 4.6.3!
# 4. Disable stuff that doesn't work when building a cross compiler
# without an existing libc, and generally try to keep this build as
# simple as possible.
- |
- cd o &&
- ../configure \
- $(../morph-arch-config) \
- --build=$(sh ../config.guess) --host=$(sh ../config.guess) \
- --target=$TARGET_STAGE1 \
- --prefix="$PREFIX" \
- --disable-bootstrap --disable-nls \
- `# [1]` --libdir="$PREFIX/lib" --disable-multilib --disable-libgomp \
- --without-cloog --without-ppl \
- --with-mpfr-include="$(pwd)/../mpfr/src" \
- --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \
- `# [2]` --with-local-prefix="$PREFIX" \
+ cd o && ../configure \
+ $(../morph-arch-config) \
+ --build=$(sh ../config.guess) \
+ --host=$(sh ../config.guess) \
+ --target=$TARGET_STAGE1 \
+ --prefix="$PREFIX" \
+ `# [1]` --libdir="$PREFIX/lib" \
+ --with-newlib \
+ `# [2]` --with-local-prefix="$PREFIX" \
`# [3]` --with-native-system-header-dir="$PREFIX/include" \
- `# [4]` --enable-languages=c --disable-decimal-float \
- --disable-libmudflap --disable-libquadmath --disable-libssp \
- --disable-shared --disable-threads --disable-target-libiberty \
- --disable-target-zlib --without-headers --with-newlib \
- --with-system-zlib
+ --with-mpfr-include="$(pwd)/../mpfr/src" \
+ --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \
+ --with-system-zlib \
+ --without-headers \
+ --without-cloog \
+ --without-ppl \
+ --disable-bootstrap \
+ --disable-nls \
+ --disable-shared \
+ --disable-multilib \
+ `# [4]` --disable-decimal-float \
+ `# [4]` --disable-threads \
+ `# [4]` --disable-libgomp \
+ `# [4]` --disable-libmudflap \
+ `# [4]` --disable-libquadmath \
+ `# [4]` --disable-libssp \
+ `# [4]` --disable-target-libiberty \
+ `# [4]` --disable-target-zlib \
+ --enable-languages=c
build-commands:
- cd o && make
diff --git a/strata/build-essential/stage2-gcc.morph b/strata/build-essential/stage2-gcc.morph
index bf6378c1..21666c72 100644
--- a/strata/build-essential/stage2-gcc.morph
+++ b/strata/build-essential/stage2-gcc.morph
@@ -4,42 +4,47 @@ kind: chunk
configure-commands:
- mkdir o
-# In other projects we specify the sysroot location using CPPFLAGS. Here,
-# that breaks because GCC compiles stuff for the *build* machine, too ...
-# and this requires using the host's compiler, which cannot use the same
-# set of CPPFLAGS as the target. If we specify the sysroot using CC instead
-# then we don't interfere, because we are only specifying the *host* C
-# compiler.
+# In other projects we specify the sysroot location using CPPFLAGS.
+# Here, that breaks because GCC compiles stuff for the *build* machine,
+# too ... and this requires using the host's compiler, which cannot use
+# the same set of CPPFLAGS as the target. If we specify the sysroot
+# using CC instead then we don't interfere, because we are only
+# specifying the *host* C compiler.
#
# Configure flag notes:
-# 1. It's vital that this compiler targets the bootstrap machine
-# (TARGET_STAGE1) so that the stage 1 GCC is used instead of the
-# compiler of the build machine.
-# 2. Disable searching /usr/local/include for headers
-# 3. This flag causes the correct --sysroot flag to be passed when calling
-# stage 1 GCC.
-# 4. C++ is built in stage 3.
-# 5. Standard flags. See gcc.morph.
+# 1. It's vital that this compiler runs in the bootstrap machine, and
+# targets the same machine (TARGET_STAGE1) so that the stage 1 GCC
+# is used instead of the compiler of the build machine.
+# 2. See gcc.morph.
+# 3. Disable searching /usr/local/include for headers
+# 4. This flag causes the correct --sysroot flag to be passed when
+# calling stage 1 GCC.
+# 5. C++ is built in stage 3.
- |
export STAGE2_SYSROOT="$(dirname $(pwd))"
export CC="$TARGET_STAGE1-gcc --sysroot=$STAGE2_SYSROOT"
export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT"
- cd o && ../configure \
- $(../morph-arch-config) \
- `# [1]` --build=$(sh ../config.guess) \
- --host=$TARGET_STAGE1 \
- --target=$TARGET_STAGE1 \
- --prefix="$PREFIX" \
- `# [2]` --with-local-prefix=$PREFIX \
- `# [3]` --with-build-sysroot="$STAGE2_SYSROOT" \
- --disable-bootstrap \
- --enable-clocale=gnu --enable-shared --enable-threads=posix \
- `# [4]` --enable-languages=c \
- `# [5]` --libdir=$PREFIX/lib \
- --disable-libgomp --disable-multilib --disable-nls \
- --without-cloog --without-ppl \
- --with-mpfr-include="$(pwd)/../mpfr/src" \
- --with-mpfr-lib="$(pwd)/mpfr/src/.libs"
+ cd o && ../configure \
+ $(../morph-arch-config) \
+ --build=$(sh ../config.guess) \
+ `# [1]` --host=$TARGET_STAGE1 \
+ `# [1]` --target=$TARGET_STAGE1 \
+ --prefix="$PREFIX" \
+ `# [2]` --libdir=$PREFIX/lib \
+ `# [3]` --with-local-prefix=$PREFIX \
+ `# [4]` --with-build-sysroot="$STAGE2_SYSROOT" \
+ --with-mpfr-include="$(pwd)/../mpfr/src" \
+ --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \
+ --without-cloog \
+ --without-ppl \
+ --disable-bootstrap \
+ --disable-nls \
+ --disable-multilib \
+ --disable-libgomp \
+ --enable-clocale=gnu \
+ --enable-shared \
+ --enable-threads=posix \
+ `# [5]` --enable-languages=c
build-commands:
- |