From 2b10a9677817377618e33d2b07ab7caefe316633 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Mon, 18 Aug 2014 17:05:22 +0000 Subject: Re-organise definitions with scripts/organise-morphologies.py --- .../armv7lhf-cross-binutils.morph | 23 ++++++++++++++ .../armv7lhf-cross-eglibc.morph | 33 ++++++++++++++++++++ .../armv7lhf-cross-gcc-nolibc.morph | 35 ++++++++++++++++++++++ .../armv7lhf-cross-gcc.morph | 35 ++++++++++++++++++++++ .../armv7lhf-cross-linux-api-headers.morph | 11 +++++++ 5 files changed, 137 insertions(+) create mode 100644 strata/armv7lhf-cross-toolchain/armv7lhf-cross-binutils.morph create mode 100644 strata/armv7lhf-cross-toolchain/armv7lhf-cross-eglibc.morph create mode 100644 strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph create mode 100644 strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph create mode 100644 strata/armv7lhf-cross-toolchain/armv7lhf-cross-linux-api-headers.morph (limited to 'strata/armv7lhf-cross-toolchain') diff --git a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-binutils.morph b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-binutils.morph new file mode 100644 index 00000000..d92150a5 --- /dev/null +++ b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-binutils.morph @@ -0,0 +1,23 @@ +name: armv7lhf-cross-binutils +kind: chunk +build-system: autotools +configure-commands: +- | + # The TARGET used is the final triplet we expect, rather than that + # of the libc-less GCC we build, since the binutils only needs to + # be built once. + # This requires extra effort to get the stage 1 GCC to use these + # tools, but saves having an extra binutils build. + export TARGET=armv7lhf-baserock-linux-gnueabi + + # 1. Binutils gets installed in the default sysroot path of + # $PREFIX/$TARGET/{bin,lib}, with the actual sysroot at + # $PREFIX/$TARGET/sys-root and its tools also available as + # $PREFIX/bin/$TARGET-$tool + # 2. The '=' makes the path we give relative to the sysroot. + ./configure --prefix="$PREFIX" --disable-nls --disable-werror \ + --build=$(sh config.guess) \ + --host=$(sh config.guess) \ + --target="$TARGET" \ + `# [1]` --with-sysroot \ + `# [2]` --with-lib-path="=$PREFIX/lib" diff --git a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-eglibc.morph b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-eglibc.morph new file mode 100644 index 00000000..afbfa939 --- /dev/null +++ b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-eglibc.morph @@ -0,0 +1,33 @@ +name: armv7lhf-cross-eglibc +kind: chunk +configure-commands: +- mkdir o +- cd libc && ln -s ../ports ports +- | + export MORPH_ARCH=armv7lhf + export TARGET=armv7lhf-baserock-linux-gnueabi + export TARGET_STAGE1=armv7lhf-none-linux-gnueabi + export CFLAGS="-O2 $CFLAGS" + # eglibc looks for $TARGET-gcc, but not $TARGET_STAGE1-gcc even + # though --build is specified, so we have to override what gcc to + # use here. + export CC="$TARGET_STAGE1-gcc" + cd o && ../libc/configure \ + $(../morph-arch-config) \ + --build=$TARGET_STAGE1 --host=$TARGET \ + --prefix="$PREFIX" \ + `# [1]` --with-headers="$PREFIX/$TARGET/sys-root/$PREFIX/include" \ + `# [2]` --with-binutils="$PREFIX/$TARGET/bin" \ + `# [3]` --disable-profile --enable-kernel=2.6.25 \ + --enable-add-ons=nptl,ports --without-cvs --without-selinux \ + `# [4]` libc_cv_c_cleanup=yes libc_cv_ctors_header=yes \ + libc_cv_forced_unwind=yes libc_cv_ssp=no +build-commands: +- cd o && make localtime=UTC +install-commands: +- | + # eglibc doesn't help with sysroots, so we need to spell out the + # full path ourselves. + export TARGET=armv7lhf-baserock-linux-gnueabi + cd o && make install_root="$DESTDIR/$PREFIX/$TARGET/sys-root/" \ + localtime=UTC install diff --git a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph new file mode 100644 index 00000000..9f993bc0 --- /dev/null +++ b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph @@ -0,0 +1,35 @@ +name: armv7lhf-cross-gcc-nolibc +kind: chunk +configure-commands: +- mkdir o +- | + 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]` --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 +- | + 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/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph new file mode 100644 index 00000000..a5c6eac1 --- /dev/null +++ b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph @@ -0,0 +1,35 @@ +name: armv7lhf-cross-gcc +kind: chunk +configure-commands: +- mkdir o +- | + 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 diff --git a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-linux-api-headers.morph b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-linux-api-headers.morph new file mode 100644 index 00000000..351134b7 --- /dev/null +++ b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-linux-api-headers.morph @@ -0,0 +1,11 @@ +name: armv7lhf-cross-linux-api-headers +kind: chunk +install-commands: +- make mrproper +- ARCH=arm make INSTALL_HDR_PATH=dest headers_install +- | + # Copy headers to the sysroot where the eglibc build will find them, + # and install its own headers and libraries. + export TARGET=armv7lhf-baserock-linux-gnueabi + install -d "$DESTDIR$PREFIX/$TARGET/sys-root/$PREFIX/include" + cp -r dest/include/* "$DESTDIR/$PREFIX/$TARGET/sys-root/$PREFIX/include" -- cgit v1.2.1