diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-02-20 15:32:48 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-02-20 15:32:48 +0000 |
commit | ef71b54fd294613f230697a2f74d39e507d03b23 (patch) | |
tree | 507d6cc2298f1860f3998c5674526291f6b4d6cf | |
parent | 35d4a972537728c56d6d3763cede5560c3a09405 (diff) | |
parent | efe5807433bb576bbba4312d2e3d150ed6f7e1a4 (diff) | |
download | definitions-ef71b54fd294613f230697a2f74d39e507d03b23.tar.gz |
Merge branch 'sam/sdk-update-v2'
Reviewed-By: Pedro Alvarez <pedro.alvarez@codethink.co.uk>
Reviewed-By: Richard Maw <richard.maw@codethink.co.uk>
-rw-r--r-- | clusters/sdk-example-cluster.morph | 4 | ||||
-rwxr-xr-x | sdk.write | 4 | ||||
-rw-r--r-- | strata/armv7lhf-cross-toolchain.morph | 34 | ||||
-rw-r--r-- | strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph | 80 | ||||
-rw-r--r-- | strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph | 45 | ||||
-rw-r--r-- | strata/armv7lhf-cross-toolchain/armv7lhf-cross-glibc.morph (renamed from strata/armv7lhf-cross-toolchain/armv7lhf-cross-eglibc.morph) | 26 | ||||
-rw-r--r-- | strata/armv7lhf-cross-toolchain/armv7lhf-cross-libstdc++.morph | 32 | ||||
-rw-r--r-- | strata/build-essential.morph | 3 | ||||
-rw-r--r-- | systems/armv7lhf-cross-toolchain-system-x86_32-generic.morph | 18 | ||||
-rw-r--r-- | systems/armv7lhf-cross-toolchain-system-x86_64-generic.morph | 18 |
10 files changed, 152 insertions, 112 deletions
diff --git a/clusters/sdk-example-cluster.morph b/clusters/sdk-example-cluster.morph index f71d093d..92e4a413 100644 --- a/clusters/sdk-example-cluster.morph +++ b/clusters/sdk-example-cluster.morph @@ -31,11 +31,11 @@ description: | See the documentation of the sdk.write extension for more information. systems: -- morph: systems/armv7lhf-cross-toolchain-system-x86_32-generic.morph +- morph: systems/armv7lhf-cross-toolchain-system-x86_64.morph deploy: sdk: type: sdk - location: armv7lhf-cross-toolchain-system-x86_32-generic.sh + location: armv7lhf-cross-toolchain-system-x86_64.sh PREFIX: /usr TARGET: armv7lhf-baserock-linux-gnueabi subsystems: @@ -148,7 +148,7 @@ if [ "$#" != 1 ]; then exit 1 fi -TOOLCHAIN_PATH="$1" +TOOLCHAIN_PATH="$(readlink -f \"$1\")" sedescape(){ # Escape the passed in string so it can be safely interpolated into @@ -227,7 +227,7 @@ patch_elves(){ local linker="$4" local lib_path="$5" find "$root" \( -path "$inner_sysroot" -prune \) -o -type f \ - -type f -perm +111 \ + -type f -perm +u=x \ -exec sh -c 'file "$1" | grep -q "ELF"' - {} \; \ -exec "$linker" --library-path "$lib_path" \ "$patchelf" --set-interpreter "$linker" \ diff --git a/strata/armv7lhf-cross-toolchain.morph b/strata/armv7lhf-cross-toolchain.morph index c76ae537..a3539d65 100644 --- a/strata/armv7lhf-cross-toolchain.morph +++ b/strata/armv7lhf-cross-toolchain.morph @@ -7,36 +7,50 @@ chunks: - name: armv7lhf-cross-binutils morph: strata/armv7lhf-cross-toolchain/armv7lhf-cross-binutils.morph repo: upstream:binutils-redhat - ref: 987eb543a034cddc4eeb103f08f566f24a5f964a + ref: b1d3b01332ae49a60ff5d6bf53d3a5b1805769c8 unpetrify-ref: baserock/build-essential build-depends: [] + - name: armv7lhf-cross-linux-api-headers morph: strata/armv7lhf-cross-toolchain/armv7lhf-cross-linux-api-headers.morph repo: upstream:linux ref: df2e1b9168a7ab5dd8149e38b5ac70cdef86d1fa unpetrify-ref: baserock/v3.8 build-depends: [] + - name: armv7lhf-cross-gcc-nolibc morph: strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph repo: upstream:gcc-tarball - ref: 0a1a077d3466cd99a4ed5590db2146b3fec6fff1 + ref: b3c9b176c1f10ebeff5700eb3760e9511f23fa06 unpetrify-ref: baserock/build-essential build-depends: - armv7lhf-cross-binutils -- name: armv7lhf-cross-eglibc - morph: strata/armv7lhf-cross-toolchain/armv7lhf-cross-eglibc.morph - repo: upstream:eglibc2 - ref: 43ee5d250ad47d2bee8ec17954efb7f22d2b804c - unpetrify-ref: baserock/2.15-build-essential + +- name: armv7lhf-cross-glibc + morph: strata/armv7lhf-cross-toolchain/armv7lhf-cross-glibc.morph + repo: upstream:glibc + ref: 52cf9a0153c14df4f6ae3bd0e1e6cc5d171e586c + unpetrify-ref: baserock/glibc-2.20 build-depends: - armv7lhf-cross-binutils - armv7lhf-cross-gcc-nolibc - armv7lhf-cross-linux-api-headers + - name: armv7lhf-cross-gcc morph: strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph repo: upstream:gcc-tarball - ref: b0254026149b13782eae26d38435a4c62a002cf0 - unpetrify-ref: baserock/build-essential-4.7 + ref: b3c9b176c1f10ebeff5700eb3760e9511f23fa06 + unpetrify-ref: baserock/build-essential + build-depends: + - armv7lhf-cross-binutils + - armv7lhf-cross-glibc + +- name: armv7lhf-cross-libstdc++ + morph: strata/armv7lhf-cross-toolchain/armv7lhf-cross-libstdc++.morph + repo: upstream:gcc-tarball + ref: b3c9b176c1f10ebeff5700eb3760e9511f23fa06 + unpetrify-ref: baserock/build-essential build-depends: - armv7lhf-cross-binutils - - armv7lhf-cross-eglibc + - armv7lhf-cross-gcc + - armv7lhf-cross-glibc diff --git a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph index d164a60b..b5a8c338 100644 --- a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph +++ b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc-nolibc.morph @@ -6,49 +6,69 @@ configure-commands: # Configure flag notes: # 1. Standard flags. See gcc.morph. -# 2. Our binutils is for the final $TARGET, rather than the intermediate +# 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. -# 3. Disable stuff that doesn't work when building a cross compiler +# 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]` --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 + + 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: -- cd o && make +- | + # 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 - -# 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/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph index 50c338e5..140a29b1 100644 --- a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph +++ b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-gcc.morph @@ -6,37 +6,40 @@ configure-commands: # 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. +# 2. Avoid having more than one copy of ZLib in use on the system # 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 + + 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 diff --git a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-eglibc.morph b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-glibc.morph index ee28c9dd..2a692c38 100644 --- a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-eglibc.morph +++ b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-glibc.morph @@ -1,37 +1,41 @@ -name: armv7lhf-cross-eglibc +name: armv7lhf-cross-glibc kind: chunk configure-commands: - mkdir o -# Necessary for ARM port -- cd libc && ln -s ../ports ports - # Configure flag notes: -# 1. Location of linux-api-headers, needed since eglibc doesn't +# 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 eglibc.morph. +# 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" - # eglibc looks for $TARGET-gcc, but not $TARGET_STAGE1-gcc even + + # 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" - cd o && ../libc/configure \ - $(../morph-arch-config) \ + + 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 \ - --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 @@ -40,7 +44,7 @@ build-commands: install-commands: - | - # eglibc doesn't help with sysroots, so we need to spell out the + # 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/" \ diff --git a/strata/armv7lhf-cross-toolchain/armv7lhf-cross-libstdc++.morph b/strata/armv7lhf-cross-toolchain/armv7lhf-cross-libstdc++.morph new file mode 100644 index 00000000..7743bb5b --- /dev/null +++ b/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/strata/build-essential.morph b/strata/build-essential.morph index 9884d29d..832d6118 100644 --- a/strata/build-essential.morph +++ b/strata/build-essential.morph @@ -31,6 +31,9 @@ description: | stage2-fhs-dirs.morph for details. Basically, /bin is a symlink to /tools/bin during stage 2 but in stage 3 it becomes a real directory again. + + PLEASE KEEP THE REFS IN 'armv7lhf-cross-toolchain' STRATUM UP TO DATE WITH + THIS ONE! products: - artifact: build-essential-minimal include: diff --git a/systems/armv7lhf-cross-toolchain-system-x86_32-generic.morph b/systems/armv7lhf-cross-toolchain-system-x86_32-generic.morph deleted file mode 100644 index e983ba7a..00000000 --- a/systems/armv7lhf-cross-toolchain-system-x86_32-generic.morph +++ /dev/null @@ -1,18 +0,0 @@ -name: armv7lhf-cross-toolchain-system-x86_32-generic -kind: system -description: A system that contains an ARM cross compiler, intended to be used as - a sysroot. -arch: x86_32 -strata: -- name: build-essential - morph: strata/build-essential.morph -- name: armv7lhf-cross-toolchain - morph: strata/armv7lhf-cross-toolchain.morph -- name: cross-tools - morph: strata/cross-tools.morph -configuration-extensions: -- set-hostname -- add-config-files -- simple-network -- nfsboot -- install-files diff --git a/systems/armv7lhf-cross-toolchain-system-x86_64-generic.morph b/systems/armv7lhf-cross-toolchain-system-x86_64-generic.morph deleted file mode 100644 index 1a8c20bb..00000000 --- a/systems/armv7lhf-cross-toolchain-system-x86_64-generic.morph +++ /dev/null @@ -1,18 +0,0 @@ -name: armv7lhf-cross-toolchain-system-x86_64-generic -kind: system -description: A system that contains an ARM cross compiler, intended to be used as - a sysroot. -arch: x86_64 -strata: -- name: build-essential - morph: strata/build-essential.morph -- name: armv7lhf-cross-toolchain - morph: strata/armv7lhf-cross-toolchain.morph -- name: cross-tools - morph: strata/cross-tools.morph -configuration-extensions: -- set-hostname -- add-config-files -- simple-network -- nfsboot -- install-files |