From 61d11f34886e1102631681a462aae4e77e56dc28 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 18 Sep 2014 20:25:47 -0700 Subject: Update for cross-compilation --- tools/nightly | 113 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 91 insertions(+), 22 deletions(-) (limited to 'tools/nightly') diff --git a/tools/nightly b/tools/nightly index e20cdd5..c5b96ac 100755 --- a/tools/nightly +++ b/tools/nightly @@ -1,60 +1,129 @@ #!/bin/bash -e +# +# The buildbot script is only intended to run on Debian amd64 +# WWW=${HOME}/www/ -ALL_CONFIGS=( - config64 - config32 +# the cross-toolchain repo doesn't have gcc-defaults, so we have +# to specify the suffix. +CROSS_VERSION_SUFFIX=-4.9 +BUILD=x86_64-linux-gnu + +ALL_HOSTS=( + x86_64-linux-gnu + i586-linux-gnu +# x32 requires a recent kernel with appropriate flags. +# On Debian, boot with 'syscall.x32=y' on the kernel command line +# (see GRUB_CMDLINE_LINUX in /etc/default/grub) + #x86_64-linux-gnux32 +# Cross arches can be built by enabling multiarch, then installing from the +# toolchain repo at http://toolchains.secretsauce.net/ +# Executables can be run via qemu-user, but tests that require gdb fail +# (NYI: implement configure with GDB=/bin/true) +# Bug 762073 notes impossible coinstallation of mips, mipsel, and powerpc. +# dpkg-divert can only fix *one* of them. + #aarch64-linux-gnu + #arm-linux-gnueabi + #arm-linux-gnueabihf + #mips-linux-gnu + #mipsel-linux-gnu + #powerpc-linux-gnu ) -# need a special kernel for configx32 +config---help() { + set +x + echo 'Usage: tools/nightly ' + echo 'Arches are:' + echo x86_64-linux-gnu + echo i586-linux-gnu + echo x86_64-linux-gnux32 + echo aarch64-linux-gnu + echo arm-linux-gnueabi + echo arm-linux-gnueabihf + echo mips-linux-gnu + echo mipsel-linux-gnu + echo powerpc-linux-gnu + exit +} + +common-config() { + # HOST is set by the calling function + CXX=$HOST-g++$CROSS_VERSION_SUFFIX + EXTRA_LIBS=( + /lib/$HOST/libc.so.6 + /lib/$HOST/libm.so.6 + /lib/$HOST/libgcc_s.so.1 + /usr/lib/$HOST/libstdc++.so.6 + ) + GDB=/bin/true +} -config32() { + +config-x86_64-linux-gnu () { + CROSS_VERSION_SUFFIX='' common-config + GDB=gdb +} + +config-i586-linux-gnu () { # No one knows what number this is supposed to be: # - the lib directory is called i386-linux-gnu # - the 32-bit files are called i486-linux-gnu # - the cross-32 configury says i586 - HOST=i586-linux-gnu - CXX='g++ -m32' + CXX=$BUILD-'g++ -m32' EXTRA_LIBS=( /lib32/libc.so.6 /lib32/libm.so.6 /usr/lib32/libgcc_s.so.1 /usr/lib32/libstdc++.so.6 ) + GDB=gdb } -configx32() { - HOST=x86_64-linux-gnux32 - CXX='g++ -mx32' +config-x86_64-linux-gnux32 () { + CXX=$BUILD-'g++ -mx32' EXTRA_LIBS=( /libx32/libc.so.6 /libx32/libm.so.6 /usr/libx32/libgcc_s.so.1 /usr/libx32/libstdc++.so.6 ) + GDB=gdb } -config64() { - HOST=x86_64-linux-gnu - CXX='g++ -m64' - EXTRA_LIBS=( - /lib/x86_64-linux-gnu/libc.so.6 - /lib/x86_64-linux-gnu/libm.so.6 - /lib/x86_64-linux-gnu/libgcc_s.so.1 - /usr/lib/x86_64-linux-gnu/libstdc++.so.6 - ) +config-aarch64-linux-gnu () { + common-config +} + +config-arm-linux-gnueabi () { + common-config +} + +config-arm-linux-gnueabihf () { + common-config +} + +config-mips-linux-gnu () { + common-config +} + +config-mipsel-linux-gnu () { + common-config +} + +config-powerpc-linux-gnu () { + common-config } first=true set -x -for config in ${ALL_CONFIGS[@]} +for HOST in ${@:-${ALL_HOSTS[@]}} do - $config + config-$HOST mkdir -p build-$HOST cd build-$HOST - ../configure --host=$HOST CXX="$CXX -Wno-deprecated-declarations" --prefix=/. --enable-rpath=relative + ../configure --build=$BUILD --host=$HOST CXX="$CXX -Wno-deprecated-declarations -DQUIET" --prefix=/. --enable-rpath=relative GDB=$GDB rm -rf bin lib make -j3 all make -j3 test -- cgit v1.2.3-60-g2f50