Skip to content

Commit 9d89d57

Browse files
authored
Update run.sh
1 parent d083dbb commit 9d89d57

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

ci/run.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ target="${1:-}"
66

77
export RUST_BACKTRACE="${RUST_BACKTRACE:-full}"
88

9-
# Make all linker warnings an error
10-
export RUSTFLAGS="${RUSTFLAGS:-} -Clink-arg=-Wl,--fatal-warnings"
11-
129
if [ -z "$target" ]; then
1310
host_target=$(rustc -vV | awk '/^host/ { print $2 }')
1411
echo "Defaulted to host target $host_target"
@@ -22,6 +19,17 @@ if [ "${USING_CONTAINER_RUSTC:-}" = 1 ]; then
2219
rustup target add "$target"
2320
fi
2421

22+
# Make all linker warnings errors
23+
if [[ "$target" == *"-apple-"* ]]; then
24+
extra_rustflags=" -Clink-arg=-Wl,--fatal_warnings"
25+
elif [[ "$target" == "thumb"* ]]; then
26+
extra_rustflags=""
27+
else
28+
extra_rustflags=" -Clink-arg=--fatal-warnings"
29+
fi
30+
31+
export RUSTFLAGS="${RUSTFLAGS:-}$extra_rustflags"
32+
2533
# Test our implementation
2634
if [ "${NO_STD:-}" = "1" ]; then
2735
echo "nothing to do for no_std"

0 commit comments

Comments
 (0)