From 50c52d2b0f2c1a3f355ff7d281127faa47bb3856 Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Thu, 23 Jun 2016 23:32:31 -0400 Subject: [PATCH 1/5] Use Travis build matrix to test different platforms Create a clean, minimal, cross-platform Travis script with a build matrix for testing different operating systems and architectures. --- .travis.sh | 26 -------------------------- .travis.yml | 21 ++++++++++++--------- 2 files changed, 12 insertions(+), 35 deletions(-) delete mode 100755 .travis.sh diff --git a/.travis.sh b/.travis.sh deleted file mode 100755 index 12296d9..0000000 --- a/.travis.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -set -eux - -case "$TARGET" in -host) - uname -a - export LOADER= - make ;; -arm32) - sudo bash -c 'echo >> /etc/apt/sources.list "deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe"' - sudo apt-get update - sudo apt-get -y install gcc-4.7-arm-linux-gnueabihf qemu binfmt-support - make CC="arm-linux-gnueabihf-gcc-4.7" - export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib - #export LOADER=/usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 - export LOADER="echo TESTS DISABLED ON ARM" - ;; -*) - echo 'Unknown TARGET!' - exit 1 - ;; -esac - -$LOADER make check - -make clean && git status --ignored --porcelain && test -z "$(git status --ignored --porcelain)" diff --git a/.travis.yml b/.travis.yml index d047e73..1ebd486 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,16 @@ +sudo: required +dist: trusty language: c -script: ./.travis.sh -os: - - linux -env: - - TARGET=host - - TARGET=arm32 + +script: + - make $FLAGS + - make check $FLAGS + - make clean && git status --ignored --porcelain && test -z "$(git status --ignored --porcelain)" + matrix: - exclude: - - os: osx - env: TARGET=arm32 + include: + - os: linux + env: FLAGS="CC=gcc" + notifications: email: false From 57ed3553613dc671cf2845d7f2a0ee81fcb340ac Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Thu, 23 Jun 2016 23:32:31 -0400 Subject: [PATCH 2/5] Fix broken compilation with ARCH=i686 `override CFLAGS_add` caused make to discard any further assignments. This regression stems from commit ebe1db3ce4ff566ec857a7951abdd0305cd40413. --- Make.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.inc b/Make.inc index a51001a..b64703e 100644 --- a/Make.inc +++ b/Make.inc @@ -111,7 +111,7 @@ endif ifeq ($(OS), WINNT) SHLIB_EXT = dll SONAME_FLAG = -soname - override CFLAGS_add += -nodefaultlibs + CFLAGS_add += -nodefaultlibs shlibdir = $(bindir) else ifeq ($(OS), Darwin) @@ -121,7 +121,7 @@ else SHLIB_EXT = so SONAME_FLAG = -soname endif - override CFLAGS_add += -fPIC + CFLAGS_add += -fPIC shlibdir = $(libdir) endif From 29bf900ede3861b4f19f2312ad555aa7629d3a28 Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Thu, 23 Jun 2016 23:32:31 -0400 Subject: [PATCH 3/5] Test Linux i686 This build fails due to #137, which is resolved by the next commit. --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1ebd486..c3c719d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,5 +12,12 @@ matrix: - os: linux env: FLAGS="CC=gcc" + - os: linux + env: FLAGS="CC=gcc ARCH=i686" # implies -m32 -march=i686 + addons: + apt: + packages: + - gcc-multilib + notifications: email: false From aeaf9cefa74dd6fbc9bbf730e0ddcaf01b1f2d3c Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Thu, 23 Jun 2016 23:32:31 -0400 Subject: [PATCH 4/5] Fix undefined reference to __fpgetprec on i386 Closes #137 This reverts commit ebcd40f1b0378522b299bfec63e288df000b43d2. The tests were failing to load the library on i386 due to an undefined reference to __fpgetprec, which resulted from __fpgetprec not being inlined due to the missing definition of __GNUCLIKE_ASM and __CC_SUPPORTS___INLINE__. --- amd64/bsd_asm.h | 2 +- ld80/s_exp2l.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/amd64/bsd_asm.h b/amd64/bsd_asm.h index c29bbab..b9c815b 100644 --- a/amd64/bsd_asm.h +++ b/amd64/bsd_asm.h @@ -40,7 +40,7 @@ #include "../i387/osx_asm.h" #define CNAME(x) EXT(x) #else -#include "cdefs-compat.h" +#include "bsd_cdefs.h" #ifdef PIC #define PIC_PLT(x) x@PLT diff --git a/ld80/s_exp2l.c b/ld80/s_exp2l.c index afa6cff..0cf5259 100644 --- a/ld80/s_exp2l.c +++ b/ld80/s_exp2l.c @@ -30,7 +30,7 @@ #include #include -#include "cdefs-compat.h" +#include "bsd_cdefs.h" #include "amd64/bsd_ieeefp.h" #include From 806c725ef67e03afb906ef5b05beac8548aa95eb Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Thu, 23 Jun 2016 23:32:31 -0400 Subject: [PATCH 5/5] Test Linux arm64 using qemu user emulation --- .travis.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c3c719d..2613ba5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,13 @@ +# We require a full (virtual) machine to load the kernel module for +# binfmt support, which is needed to test other architectures besides +# x86 using qemu user emulation. (This will not work in a container.) sudo: required dist: trusty language: c script: - make $FLAGS - - make check $FLAGS + - make check $FLAGS $TEST_FLAGS - make clean && git status --ignored --porcelain && test -z "$(git status --ignored --porcelain)" matrix: @@ -19,5 +22,15 @@ matrix: packages: - gcc-multilib + - os: linux + env: FLAGS="CC=aarch64-linux-gnu-gcc" TEST_FLAGS="LDFLAGS=-static" + addons: + apt: + packages: + - gcc-aarch64-linux-gnu + - libc6-dev-arm64-cross + - qemu-user-static + - binfmt-support + notifications: email: false