diff options
Diffstat (limited to 'strata/build-essential/stage2-gcc.morph')
-rw-r--r-- | strata/build-essential/stage2-gcc.morph | 74 |
1 files changed, 43 insertions, 31 deletions
diff --git a/strata/build-essential/stage2-gcc.morph b/strata/build-essential/stage2-gcc.morph index bf6378c1..98f9cfe7 100644 --- a/strata/build-essential/stage2-gcc.morph +++ b/strata/build-essential/stage2-gcc.morph @@ -4,45 +4,57 @@ 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. - | + case "$MORPH_ARCH" in + armv7lhf) ARCH_FLAGS="--with-arch=armv7-a \ + --with-cpu=cortex-a9 \ + --with-tune=cortex-a9 \ + --with-fpu=vfpv3-d16 \ + --with-float=hard" ;; + armv7*) ARCH_FLAGS="--with-arch=armv7-a" ;; + esac 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" + export CXX="$TARGET_STAGE1-g++ --sysroot=$STAGE2_SYSROOT" + export AR="$TARGET_STAGE1-ar" + export RANLIB="$TARGET_STAGE1-ranlib" + cd o && ../configure \ + $ARCH_FLAGS \ + --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" \ + --disable-bootstrap \ + --disable-nls \ + --disable-multilib \ + --disable-libgomp \ + --disable-libstdcxx-pch \ + --enable-languages=c,c++ build-commands: - | + case "$MORPH_ARCH" in + armv7*) sed -i "s/--host=none/--host=armv7a/" o/Makefile + sed -i "s/--target=none/--target=armv7a/" o/Makefile ;; + esac export STAGE2_SYSROOT="$(dirname $(pwd))" cd o && make |