diff options
Diffstat (limited to 'baserock/strata/armv7lhf-cross-toolchain')
6 files changed, 239 insertions, 0 deletions
diff --git a/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-binutils.morph b/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-binutils.morph new file mode 100644 index 00000000..8e842e41 --- /dev/null +++ b/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-binutils.morph @@ -0,0 +1,24 @@ +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/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph b/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph new file mode 100644 index 00000000..b5a8c338 --- /dev/null +++ b/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph @@ -0,0 +1,74 @@ +name: armv7lhf-cross-gcc-nolibc +kind: chunk + +configure-commands: +- mkdir o + +# Configure flag notes: +# 1. Standard flags. See gcc.morph. +# 2. See stage1-gcc.morph. +# 3. 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. +# 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 + + 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 + + cd o && ../configure \ + $ARCH_FLAGS \ + --build=$(sh ../config.guess) \ + --host=$(sh ../config.guess) \ + --target="$TARGET_STAGE1" \ + --prefix="$PREFIX" \ + `# [1]` --libdir="$PREFIX/lib" \ + `# [2]` --with-sysroot=/nonexistentdir \ + --with-newlib \ + `# [2]` --with-local-prefix="$PREFIX" \ + `# [2]` --with-native-system-header-dir="$PREFIX/include" \ + `# [3]` --with-build-time-tools="$PREFIX/$TARGET/bin" \ + `# [3]` --with-as="$PREFIX/$TARGET/bin/as" \ + `# [3]` --with-ld="$PREFIX/$TARGET/bin/ld" \ + --without-headers \ + --disable-nls \ + --disable-shared \ + `# [4]` --disable-multilib \ + `# [4]` --disable-decimal-float \ + `# [4]` --disable-threads \ + `# [4]` --disable-libatomic \ + `# [4]` --disable-libgomp \ + `# [4]` --disable-libitm \ + `# [4]` --disable-libquadmath \ + `# [4]` --disable-libsanitizer \ + `# [4]` --disable-libssp \ + `# [4]` --disable-libvtv \ + `# [4]` --disable-libcilkrts \ + `# [4]` --disable-libstdc++-v3 \ + --enable-languages=c,c++ + +build-commands: +- | + # See stage1-gcc.morph. + case "$MORPH_ARCH" in + armv7*) sed -i "s/--host=none/--host=armv7a/" o/Makefile + sed -i "s/--target=none/--target=armv7a/" o/Makefile ;; + esac + cd o && make + +install-commands: +- cd o && make DESTDIR="$DESTDIR" install diff --git a/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph b/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph new file mode 100644 index 00000000..140a29b1 --- /dev/null +++ b/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph @@ -0,0 +1,48 @@ +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. Avoid having more than one copy of ZLib in use on the system +# 3. Standard flags. See gcc.morph. +- | + export MORPH_ARCH=armv7lhf + export TARGET=armv7lhf-baserock-linux-gnueabi + + 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 + + cd o && ../configure \ + $ARCH_FLAGS \ + --build=$(sh ../config.guess) \ + --host=$(sh ../config.guess) \ + --target="$TARGET" \ + --prefix="$PREFIX" \ + `# [1]` --with-sysroot \ + --disable-bootstrap \ + `# [2]` --with-system-zlib \ + `# [3]` --libdir="$PREFIX/lib" \ + `# [3]` --disable-multilib \ + `# [3]` --enable-languages=c,c++,fortran + +build-commands: +- cd o && make + +install-commands: +- cd o && make DESTDIR="$DESTDIR" install +- ln -s gcc "$DESTDIR/$PREFIX/bin/cc" +- | + 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/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-glibc.morph b/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-glibc.morph new file mode 100644 index 00000000..2a692c38 --- /dev/null +++ b/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-glibc.morph @@ -0,0 +1,51 @@ +name: armv7lhf-cross-glibc +kind: chunk + +configure-commands: +- mkdir o + +# Configure flag notes: +# 1. Location of linux-api-headers, needed since glibc doesn't +# support being given a sysroot. +# 2. Location of binutils, since we build binutils for the final +# target triplet, but our gcc of our stage 1 target triplet. +# 3. Normal flags. See strata/build-essential/glibc.morph. +# 4. Force configuration values of certain things that can't be detected +# in a cross-compile. +- | + export MORPH_ARCH=armv7lhf + export TARGET=armv7lhf-baserock-linux-gnueabi + export TARGET_STAGE1=armv7lhf-none-linux-gnueabi + + export CFLAGS="-O2 $CFLAGS" + + # glibc 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" + + case "$MORPH_ARCH" in + armv7*) + ARCH_FLAGS="--without-fp" ;; + esac + + cd o && ../configure \ + $ARCH_FLAGS \ + --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 \ + `# [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: +- | + # glibc 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/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-libstdc++.morph b/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-libstdc++.morph new file mode 100644 index 00000000..7743bb5b --- /dev/null +++ b/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-libstdc++.morph @@ -0,0 +1,32 @@ +name: armv7lhf-cross-libstdc++ +kind: chunk +configure-commands: +- mkdir o + +# Configure flag notes: +# 1. Use the default sysroot path to install to and locate headers +# 2. From LFS: the header location of C++ needs to be explicitly given +# as we are running the configure script from the top-level +# directory. +- | + export MORPH_ARCH=armv7lhf + export TARGET=armv7lhf-baserock-linux-gnueabi + + # -fPIC must be given, otherwise it will not be possible to create + # shared libraries linked to libstdc++ + export CPPFLAGS="-fPIC" + cd o && ../libstdc++-v3/configure \ + --build=$(sh ../config.guess) \ + --host=$(sh ../config.guess) \ + --target="$TARGET" \ + --prefix="$PREFIX" \ + --disable-nls \ + --disable-shared \ + --disable-multilib \ + `# [1]` --with-sysroot + +build-commands: +- cd o && make + +install-commands: +- cd o && make DESTDIR="$DESTDIR" install diff --git a/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-linux-api-headers.morph b/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-linux-api-headers.morph new file mode 100644 index 00000000..c2654419 --- /dev/null +++ b/baserock/strata/armv7lhf-cross-toolchain/armv7lhf-cross-linux-api-headers.morph @@ -0,0 +1,10 @@ +name: armv7lhf-cross-linux-api-headers +kind: chunk +install-commands: +- 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" |