From 02bb8381c617b6db7f7b65044473d2c2ef988495 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Tue, 18 Apr 2017 09:27:11 -0700 Subject: [PATCH] Support all cross-supported targets. Adds Android, iOS, Linux/ARM, Linux/ARM/musl, and Windows. Bare-metal thumb targets are listed, because they are supported by cross, but they aren't enabled by default as they don't support std and will likely not but used by most projects. Because of a bug in musl on the `*-musleabi*` targets, the hello.c test case has been reduced to use unistd and write() instead of printf(). --- .travis.yml | 31 +++++++++++++++++++++++++++++++ hello.c | 4 ++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 680947e..ee6fcea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,30 @@ matrix: # TODO These are all the build jobs. Adjust as necessary. Comment out what you # don't need include: + # Android + - env: TARGET=aarch64-linux-android DISABLE_TESTS=1 + - env: TARGET=arm-linux-androideabi DISABLE_TESTS=1 + - env: TARGET=armv7-linux-androideabi DISABLE_TESTS=1 + - env: TARGET=i686-linux-android DISABLE_TESTS=1 + + # iOS + - env: TARGET=aarch64-apple-ios DISABLE_TESTS=1 + os: osx + - env: TARGET=armv7-apple-ios DISABLE_TESTS=1 + os: osx + - env: TARGET=armv7s-apple-ios DISABLE_TESTS=1 + os: osx + - env: TARGET=i386-apple-ios DISABLE_TESTS=1 + os: osx + - env: TARGET=x86_64-apple-ios DISABLE_TESTS=1 + os: osx + # Linux - env: TARGET=aarch64-unknown-linux-gnu + - env: TARGET=arm-unknown-linux-gnueabi + - env: TARGET=arm-unknown-linux-musleabi - env: TARGET=armv7-unknown-linux-gnueabihf + - env: TARGET=armv7-unknown-linux-musleabihf - env: TARGET=i686-unknown-linux-gnu - env: TARGET=i686-unknown-linux-musl - env: TARGET=mips-unknown-linux-gnu @@ -45,6 +66,16 @@ matrix: - env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1 - env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1 + # Windows + - env: TARGET=x86_64-pc-windows-gnu + + # Bare metal + # These targets don't support std and as such are likely not suitable for + # most crates. + # - env: TARGET=thumbv6m-none-eabi + # - env: TARGET=thumbv7em-none-eabi + # - env: TARGET=thumbv7em-none-eabihf + # - env: TARGET=thumbv7m-none-eabi # Testing other channels - env: TARGET=x86_64-unknown-linux-gnu diff --git a/hello.c b/hello.c index 2ee623f..7c5ed10 100644 --- a/hello.c +++ b/hello.c @@ -1,5 +1,5 @@ -#include +#include void hello() { - printf("Hello, world!\n"); + write(0, "Hello, world!\n", 14); }