diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2014-02-24 11:01:34 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2014-02-27 15:42:49 +0000 |
commit | cb626ffe7ee1c81329ea2d1d8b104e100251222f (patch) | |
tree | e3dff58b35824abb777eeb0fb172241fd3b73ba8 | |
parent | 86eee3c35c3f43b3769a5bd810a45228dcc54343 (diff) | |
download | gcc-tarball-baserock/richardmaw/S10442/cross-toolchain.tar.gz |
Add morphologies for building a cross compilerbaserock/richardmaw/S10442/cross-toolchain
-rw-r--r-- | armv7lhf-cross-gcc-nolibc.morph | 59 | ||||
-rw-r--r-- | armv7lhf-cross-gcc.morph | 45 |
2 files changed, 104 insertions, 0 deletions
diff --git a/armv7lhf-cross-gcc-nolibc.morph b/armv7lhf-cross-gcc-nolibc.morph new file mode 100644 index 0000000000..10b4a3b1e3 --- /dev/null +++ b/armv7lhf-cross-gcc-nolibc.morph @@ -0,0 +1,59 @@ +name: armv7lhf-cross-gcc-nolibc +kind: chunk + +configure-commands: + - mkdir o + + # Configure flag notes: + # 1. Standard flags. See gcc.morph. + # 2. Our binutils is for the final $TARGET, rather than the intermediate + # target our GCC is being built for, so we need to set + # with-build-time-tools to get it to find our binutils at + # build-time and with-as and with-ld so our temporary GCC uses + # the appropriate tools when it compiles our libc, rather than + # trying to use $TARGET_STAGE1-as when producing binaries. + # 3. Look for headers in $sysroot/$PREFIX/include when compiling. + # It's neater to do this than have to specify the full header path. + # FIXME: Probably not needed here since we configure without headers, + # remove and try a rebuild. + # 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. + - | + export MORPH_ARCH=armv7lhf + export TARGET=armv7lhf-baserock-linux-gnueabi + export TARGET_STAGE1=armv7lhf-none-linux-gnueabi + 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-build-time-tools="$PREFIX/$TARGET/bin" \ + --with-as="$PREFIX/$TARGET/bin/as" \ + --with-ld="$PREFIX/$TARGET/bin/ld" \ + `# [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 + +build-commands: + - cd o && make + +install-commands: + - cd o && make DESTDIR="$DESTDIR" install + + # The file libgcc_eh is required during eglibc's build, but is not created + # because we built GCC with --disable-shared. This is a workaround for + # eglibc's build system being slightly broken. + - | + export TARGET_STAGE1=armv7lhf-none-linux-gnueabi + libgcc_filename="$("$DESTDIR$PREFIX/bin/$TARGET_STAGE1-gcc" -print-libgcc-file-name)" + ln -sv libgcc.a "$(echo "$libgcc_filename" | sed 's/libgcc/&_eh/')" diff --git a/armv7lhf-cross-gcc.morph b/armv7lhf-cross-gcc.morph new file mode 100644 index 0000000000..c5600dfc4e --- /dev/null +++ b/armv7lhf-cross-gcc.morph @@ -0,0 +1,45 @@ +name: armv7lhf-cross-gcc +kind: chunk + +configure-commands: + - mkdir o + + # Configure flag notes: + # 1. Use the default sysroot path to install to and locate headers + # 2. Recommended by Linux From Scratch; required for C++ ABI + # compatibility with other Linux distributions. + # 3. Standard flags. See gcc.morph. + # 4. Avoid having more than one copy of ZLib in use on the system + - | + export MORPH_ARCH=armv7lhf + export TARGET=armv7lhf-baserock-linux-gnueabi + export TARGET_STAGE1=armv7lhf-none-linux-gnueabi + cd o && ../configure \ + $(../morph-arch-config) \ + --build=$(sh ../config.guess) \ + --host=$(sh ../config.guess) \ + --target="$TARGET" \ + `# [1]` --with-sysroot \ + --prefix="$PREFIX" \ + --disable-bootstrap \ + --enable-shared --enable-threads=posix \ + `# [2]` --enable-__cxa_atexit \ + --enable-languages=c,c++,fortran \ + `# [3]` --libdir="$PREFIX/lib" \ + --disable-libgomp --disable-multilib \ + --without-cloog --without-ppl \ + --with-mpfr-include="$(pwd)/../mpfr/src" \ + --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \ + `# [4]` --with-system-zlib + +build-commands: + - cd o && make + +install-commands: + - cd o && make DESTDIR="$DESTDIR" install + - | + export TARGET=armv7lhf-baserock-linux-gnueabi + for fortran_alias in f77 f90 f95; do + ln -s "$TARGET-gfortran" \ + "$DESTDIR/$PREFIX/bin/$TARGET-$fortran_alias" + done |