Skip to content

Commit 237749b

Browse files
committed
update nm
1 parent 6a8706f commit 237749b

File tree

1 file changed

+26
-27
lines changed

1 file changed

+26
-27
lines changed

ci/run.sh

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,31 @@ fi
4545

4646

4747
## REMOVE
48+
PREFIX=${target//unknown-/}-
49+
case "$target" in
50+
armv7-*)
51+
PREFIX=arm-linux-gnueabihf-
52+
;;
53+
thumb*)
54+
PREFIX=arm-none-eabi-
55+
;;
56+
*86*-*)
57+
PREFIX=
58+
;;
59+
esac
60+
61+
NM=$(find "$(rustc --print sysroot)" \( -name llvm-nm -o -name llvm-nm.exe \) )
62+
if [ "$NM" = "" ]; then
63+
NM="${PREFIX}nm"
64+
fi
65+
66+
# i686-pc-windows-gnu tools have a dependency on some DLLs, so run it with
67+
# rustup run to ensure that those are in PATH.
68+
TOOLCHAIN="$(rustup show active-toolchain | sed 's/ (default)//')"
69+
if [[ "$TOOLCHAIN" == *i686-pc-windows-gnu ]]; then
70+
NM="rustup run $TOOLCHAIN $NM"
71+
fi
72+
4873
build_intrinsics_test() {
4974
cargo build --target "$target" -v --package builtins-test-intrinsics "$@"
5075
}
@@ -125,32 +150,6 @@ for_each_rlib() {
125150
"$@" "${rlib_paths[@]}"
126151
}
127152

128-
129-
PREFIX=${target//unknown-/}-
130-
case "$target" in
131-
armv7-*)
132-
PREFIX=arm-linux-gnueabihf-
133-
;;
134-
thumb*)
135-
PREFIX=arm-none-eabi-
136-
;;
137-
*86*-*)
138-
PREFIX=
139-
;;
140-
esac
141-
142-
NM=$(find "$(rustc --print sysroot)" \( -name llvm-nm -o -name llvm-nm.exe \) )
143-
if [ "$NM" = "" ]; then
144-
NM="${PREFIX}nm"
145-
fi
146-
147-
# i686-pc-windows-gnu tools have a dependency on some DLLs, so run it with
148-
# rustup run to ensure that those are in PATH.
149-
TOOLCHAIN="$(rustup show active-toolchain | sed 's/ (default)//')"
150-
if [[ "$TOOLCHAIN" == *i686-pc-windows-gnu ]]; then
151-
NM="rustup run $TOOLCHAIN $NM"
152-
fi
153-
154153
# Remove any existing artifacts from previous tests that don't set #![compiler_builtins]
155154
for_each_rlib rm -f
156155

@@ -188,7 +187,7 @@ CARGO_PROFILE_DEV_LTO=true \
188187
CARGO_PROFILE_RELEASE_LTO=true \
189188
cargo build --target "$target" --package builtins-test-intrinsics --release
190189

191-
for_each_rlib nm -A
190+
for_each_rlib $NM -A
192191

193192
# Ensure no references to any symbols from core
194193
for_each_rlib "${symcheck[@]}" -- check-core-syms

0 commit comments

Comments
 (0)