diff options
author | Anthony Green <green@moxielogic.com> | 2019-10-16 16:05:46 -0400 |
---|---|---|
committer | Anthony Green <green@moxielogic.com> | 2019-10-16 16:05:46 -0400 |
commit | 825b2a359468af8bf3570a5a0695e8b805c5446f (patch) | |
tree | a8b937d796986659d0f5422f382d8aa4b037b7e9 /.travis | |
parent | d2a4095af68f4530571bc3fa613dd7f5e5b815a3 (diff) | |
download | libffi-825b2a359468af8bf3570a5a0695e8b805c5446f.tar.gz |
Test on arm32v7-linux-gnu, ppc64le-linux-gnu and aarch64-linux-gnu.
Use docker images and qemu to test libffi for non-x86 architectures on
travis-ci.
Use the LIBFFI_TEST_OPTIMIZATION environment variable to
force specific optimization levels at test time.
Diffstat (limited to '.travis')
-rwxr-xr-x | .travis/build-in-container.sh | 20 | ||||
-rwxr-xr-x | .travis/build.sh | 31 | ||||
-rwxr-xr-x | .travis/install.sh | 43 |
3 files changed, 74 insertions, 20 deletions
diff --git a/.travis/build-in-container.sh b/.travis/build-in-container.sh new file mode 100755 index 0000000..dc412c2 --- /dev/null +++ b/.travis/build-in-container.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +cd /opt + +./configure +make +make dist +make check RUNTESTFLAGS="-a $RUNTESTFLAGS" +EXITCODE=$? +gzip -c -9 */testsuite/libffi.log > libffi.log.gz +echo ================================================================ +echo The logs are too long for travis to handle, so we compress and +echo uuencode them. Download, decode and uncompress if you need to +echo read them. +echo ================================================================ +uuencode libffi.log.gz - +echo ================================================================ +echo ================================================================ +exit $EXITCODE + diff --git a/.travis/build.sh b/.travis/build.sh index 61e69c6..8e0cf42 100755 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -1,8 +1,5 @@ #!/bin/bash -# exit this script if any commmand fails -# set -e - function build_linux() { ./autogen.sh @@ -10,16 +7,26 @@ function build_linux() make make dist make check RUNTESTFLAGS="-a $RUNTESTFLAGS" + EXITCODE=$? gzip -c -9 */testsuite/libffi.log > libffi.log.gz echo ================================================================ echo The logs are too long for travis to handle, so we compress and echo uuencode them. Download, decode and uncompress if you need to - echo read them. + echo read them. For example, if you select and save this text + echo as libffi.uu, run: 'cat libffi.uu | uudecode | gzip -d | less'. echo ================================================================ uuencode libffi.log.gz - echo ================================================================ echo ================================================================ + + exit $EXITCODE +} + +function build_foreign_linux() +{ + docker run --rm -t -i -v `pwd`:/opt --rm -ti -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" $2 bash -c /opt/.travis/build-in-container.sh + exit $? } function build_ios() @@ -28,8 +35,8 @@ function build_ios() # export PYTHON_BIN=/usr/local/bin/python ./generate-darwin-source-and-headers.py xcodebuild -showsdks - xcodebuild -project libffi.xcodeproj -target "libffi-iOS" -configuration Release -sdk iphoneos10.3 - find ./ + xcodebuild -project libffi.xcodeproj -target "libffi-iOS" -configuration Release -sdk iphoneos11.4 + exit $? } ./autogen.sh @@ -37,6 +44,18 @@ case "$HOST" in arm-apple-darwin*) build_ios ;; + arm32v7-linux-gnu) + build_foreign_linux arm moxielogic/arm32v7-ci-build-container:latest + ;; + aarch64-linux-gnu) + build_foreign_linux aarch64 moxielogic/aarch64-ci-build-container:latest + ;; + ppc64le-linux-gnu) + build_foreign_linux ppc64le moxielogic/ppc64le-ci-build-container:latest + ;; + s390x-linux-gnu) + build_foreign_linux s390x s390x/ubuntu + ;; *) build_linux ;; diff --git a/.travis/install.sh b/.travis/install.sh index 76e2554..45a188a 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -2,24 +2,39 @@ set -x if [[ $TRAVIS_OS_NAME != 'linux' ]]; then - brew update + brew update > brew-update.log 2>&1 # fix an issue with libtool on travis by reinstalling it brew uninstall libtool; brew install libtool dejagnu; else + sudo apt-get clean # clear the cache sudo apt-get update - sudo apt-get install dejagnu texinfo sharutils - case "$HOST" in - i386-pc-linux-gnu) - sudo apt-get install gcc-multilib g++-multilib - ;; - moxie-elf) - echo 'deb https://repos.moxielogic.org:7114/MoxieLogic moxiedev main' | sudo tee -a /etc/apt/sources.list - sudo apt-get clean # clear the cache - sudo apt-get update ## -qq - # debug... - curl https://repos.moxielogic.org:7114/MoxieLogic/dists/moxiedev/main/binary-amd64/Packages - sudo apt-get install -y --allow-unauthenticated moxielogic-moxie-elf-gcc moxielogic-moxie-elf-gcc-c++ moxielogic-moxie-elf-gcc-libstdc++ moxielogic-moxie-elf-gdb-sim - ;; + case $HOST in + arm32v7-linux-gnu | aarch64-linux-gnu | ppc64le-linux-gnu | s390x-linux-gnu) + sudo apt-get install qemu-user-static + ;; + i386-pc-linux-gnu) + sudo apt-get install gcc-multilib g++-multilib; + ;; + moxie-elf) + echo 'deb https://repos.moxielogic.org:7114/MoxieLogic moxiedev main' | sudo tee -a /etc/apt/sources.list + sudo apt-get clean # clear the cache + sudo apt-get update ## -qq + # debug... + curl https://repos.moxielogic.org:7114/MoxieLogic/dists/moxiedev/main/binary-amd64/Packages + sudo apt-get update + sudo apt-get install -y --allow-unauthenticated moxielogic-moxie-elf-gcc moxielogic-moxie-elf-gcc-c++ moxielogic-moxie-elf-gcc-libstdc++ moxielogic-moxie-elf-gdb-sim + ;; + i686-w64-mingw32) + sudo apt-get install gcc-mingw-w64-i686 binutils-mingw-w64-i686 wine; + ;; + esac + case $HOST in + arm32v7-linux-gnu | aarch64-linux-gnu | ppc64le-linux-gnu | s390x-linux-gnu) + # don't install host tools + ;; + *) + sudo apt-get install dejagnu texinfo sharutils + ;; esac fi |