-
Notifications
You must be signed in to change notification settings - Fork 222
/
Copy pathrun.sh
executable file
·65 lines (58 loc) · 1.51 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
set -e
# Test our implementation
case $1 in
thumb*)
xargo build --target $1
xargo build --target $1 --release
;;
# QEMU crashes even when executing the simplest cross compiled C program:
# `int main() { return 0; }`
powerpc64le-unknown-linux-gnu)
cargo test --target $1 --no-run
cargo test --target $1 --no-run --release
;;
*)
cargo test --target $1
cargo test --target $1 --release
;;
esac
# Verify that we haven't drop any intrinsic/symbol
case $1 in
thumb*)
xargo build --features c --target $1 --bin intrinsics
;;
*)
cargo build --features c --target $1 --bin intrinsics
;;
esac
# Look out for duplicated symbols when we include the compiler-rt (C) implementation
PREFIX=$(echo $1 | sed -e 's/unknown-//')-
case $1 in
armv7-*)
PREFIX=arm-linux-gnueabihf-
;;
thumb*)
PREFIX=arm-none-eabi-
;;
*86*-*)
PREFIX=
;;
esac
case $TRAVIS_OS_NAME in
osx)
# NOTE OSx's nm doesn't accept the `--defined-only` or provide an equivalent.
# Use GNU nm instead
NM=gnm
brew install binutils
;;
*)
NM=nm
;;
esac
# NOTE On i586, It's normal that the get_pc_thunk symbol appears several times so ignore it
stdout=$($PREFIX$NM -g --defined-only /target/${1}/debug/librustc_builtins.rlib)
set +e
echo $stdout | sort | uniq -d | grep -v __x86.get_pc_thunk | grep 'T __'
if test $? = 0; then
exit 1
fi