Skip to content

Commit b5797dc

Browse files
author
Jorge Aparicio
committed
adapt to new testing infrastructure
1 parent f77ca91 commit b5797dc

File tree

8 files changed

+105
-20
lines changed

8 files changed

+105
-20
lines changed

.travis.yml

+6-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ language: rust
33
services: docker
44
sudo: required
55
rust: nightly
6-
cache: cargo
76

87
matrix:
98
include:
@@ -25,18 +24,11 @@ matrix:
2524
- env: TARGET=mipsel-unknown-linux-gnu
2625
- env: TARGET=powerpc-unknown-linux-gnu
2726
- env: TARGET=powerpc64-unknown-linux-gnu
28-
# QEMU crashes even when executing the simplest cross compiled C program:
29-
# `int main() { return 0; }`
30-
- env: TARGET=powerpc64le-unknown-linux-gnu NO_RUN=1
27+
- env: TARGET=powerpc64le-unknown-linux-gnu
3128
- env: TARGET=thumbv6m-none-eabi
32-
install: cargo install xargo --debug -f
33-
script: $HOME/.cargo/bin/xargo build --target $TARGET
3429
- env: TARGET=thumbv7em-none-eabi
35-
install: cargo install xargo --debug -f
36-
script: $HOME/.cargo/bin/xargo build --target $TARGET
3730
- env: TARGET=thumbv7em-none-eabihf
38-
install: cargo install xargo --debug -f
39-
script: $HOME/.cargo/bin/xargo build --target $TARGET
31+
- env: TARGET=thumbv7m-none-eabi
4032
- env: TARGET=x86_64-apple-darwin
4133
os: osx
4234
env: TARGET=x86_64-unknown-linux-gnu
@@ -45,8 +37,10 @@ before_install:
4537
- test "$TRAVIS_OS_NAME" = "osx" || docker run --rm --privileged multiarch/qemu-user-static:register
4638

4739
install:
48-
- curl https://static.rust-lang.org/rustup.sh |
49-
sh -s -- --add-target=$TARGET --disable-sudo -y --prefix=`rustc --print sysroot`
40+
- if case $TARGET in thumb*) false;; *) true;; esac; then
41+
curl https://static.rust-lang.org/rustup.sh |
42+
sh -s -- --add-target=$TARGET --disable-sudo -y --prefix=`rustc --print sysroot`;
43+
fi
5044

5145
script:
5246
- cargo generate-lockfile

build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ fn main() {
406406
}
407407

408408
for src in sources.map.values() {
409-
cfg.file(Path::new("compiler-rt/lib/builtins").join(src));
409+
cfg.file(Path::new("compiler-rt/compiler-rt-cdylib/compiler-rt/lib/builtins").join(src));
410410
}
411411

412412
cfg.compile("libcompiler-rt.a");
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM ubuntu:16.04
2+
RUN apt-get update
3+
RUN apt-get install -y --no-install-recommends \
4+
ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev
5+
ENV AR_thumbv6m_none_eabi=arm-none-eabi-ar \
6+
CARGO_TARGET_THUMBV6M_NONE_EABI_LINKER=arm-none-eabi-gcc \
7+
CC_thumbv6m_none_eabi=arm-none-eabi-gcc \
8+
PATH=$PATH:/rust/bin
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM ubuntu:16.04
2+
RUN apt-get update
3+
RUN apt-get install -y --no-install-recommends \
4+
ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev
5+
ENV AR_thumbv7em_none_eabi=arm-none-eabi-ar \
6+
CARGO_TARGET_THUMBV7EM_NONE_EABI_LINKER=arm-none-eabi-gcc \
7+
CC_thumbv7em_none_eabi=arm-none-eabi-gcc \
8+
PATH=$PATH:/rust/bin
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM ubuntu:16.04
2+
RUN apt-get update
3+
RUN apt-get install -y --no-install-recommends \
4+
ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev
5+
ENV AR_thumbv7em_none_eabihf=arm-none-eabi-ar \
6+
CARGO_TARGET_THUMBV7EM_NONE_EABIHF_LINKER=arm-none-eabi-gcc \
7+
CC_thumbv7em_none_eabihf=arm-none-eabi-gcc \
8+
PATH=$PATH:/rust/bin
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM ubuntu:16.04
2+
RUN apt-get update
3+
RUN apt-get install -y --no-install-recommends \
4+
ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev
5+
ENV AR_thumbv7m_none_eabi=arm-none-eabi-ar \
6+
CARGO_TARGET_THUMBV7M_NONE_EABI_LINKER=arm-none-eabi-gcc \
7+
CC_thumbv7m_none_eabi=arm-none-eabi-gcc \
8+
PATH=$PATH:/rust/bin

ci/run-docker.sh

+3-7
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,15 @@ set -ex
55

66
run() {
77
echo $1
8-
CMD="cargo test --target $1"
9-
if [ "$NO_RUN" = "1" ]; then
10-
CMD="$CMD --no-run"
11-
fi
12-
docker build -t libc ci/docker/$1
8+
docker build -t $1 ci/docker/$1
139
docker run \
1410
-v `rustc --print sysroot`:/rust:ro \
1511
-v `pwd`:/checkout:ro \
1612
-e CARGO_TARGET_DIR=/tmp/target \
1713
-w /checkout \
1814
--privileged \
19-
-it libc \
20-
bash -c "$CMD && $CMD --release"
15+
-it $1 \
16+
sh ci/run.sh $1
2117
}
2218

2319
if [ -z "$1" ]; then

ci/run.sh

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Test our implementation
2+
case $1 in
3+
thumb*)
4+
curl -sf "https://raw.githubusercontent.com/japaric/rust-everywhere/master/install.sh" | \
5+
bash -s -- --at /usr/bin --from japaric/xargo --tag v0.1.10
6+
xargo build --target $1
7+
xargo build --target $1 --release
8+
;;
9+
# QEMU crashes even when executing the simplest cross compiled C program:
10+
# `int main() { return 0; }`
11+
powerpc64le-unknown-linux-gnu)
12+
cargo test --target $1 --no-run
13+
cargo test --target $1 --no-run --release
14+
;;
15+
*)
16+
cargo test --target $1
17+
cargo test --target $1 --release
18+
;;
19+
esac
20+
21+
# Verify that we haven't drop any intrinsic/symbol
22+
case $1 in
23+
thumb*)
24+
xargo build --features c --target $1 --bin intrinsics
25+
;;
26+
*)
27+
cargo build --features c --target $1 --bin intrinsics
28+
;;
29+
esac
30+
31+
# Look out for duplicated symbols when we include the compiler-rt (C) implementation
32+
PREFIX=$(echo $1 | sed -e 's/unknown-//')
33+
case $1 in
34+
armv7-*)
35+
PREFIX=arm-linux-gnueabihf-
36+
;;
37+
thumb*)
38+
PREFIX=arm-none-eabi-
39+
;;
40+
*-unknown-linux-gnu | *-apple-darwin)
41+
PREFIX=
42+
;;
43+
esac
44+
45+
case $TRAVIS_OS_NAME in
46+
osx)
47+
NM=gnm
48+
49+
# NOTE OSx's nm doesn't accept the `--defined-only` or provide an equivalent.
50+
# Use GNU nm instead
51+
brew install binutils
52+
;;
53+
*)
54+
NM=nm
55+
;;
56+
esac
57+
58+
$PREFIX$NM -g --defined-only /tmp/target/${1}/debug/librustc_builtins.rlib | \
59+
sort | uniq -d | grep 'T __'
60+
61+
if test $? = 0; then
62+
exit 1
63+
fi

0 commit comments

Comments
 (0)