Skip to content

Commit a10899f

Browse files
committed
debug
1 parent 2f0ccb2 commit a10899f

File tree

3 files changed

+36
-35
lines changed

3 files changed

+36
-35
lines changed

ci/run.sh

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -47,40 +47,7 @@ else
4747
fi
4848
fi
4949

50-
PREFIX=${target//unknown-/}-
51-
case "$target" in
52-
armv7-*)
53-
PREFIX=arm-linux-gnueabihf-
54-
;;
55-
thumb*)
56-
PREFIX=arm-none-eabi-
57-
;;
58-
*86*-*)
59-
PREFIX=
60-
;;
61-
esac
62-
63-
cat << "EOF" > run-rust-nm
64-
#!/bin/bash
65-
66-
set -x
67-
68-
NM=$(find "$(rustc --print sysroot)" \( -name llvm-nm -o -name llvm-nm.exe \) )
69-
if [ "$NM" = "" ]; then
70-
NM="${PREFIX}nm"
71-
fi
72-
73-
# i686-pc-windows-gnu tools have a dependency on some DLLs, so run it with
74-
# rustup run to ensure that those are in PATH.
75-
TOOLCHAIN="$(rustup show active-toolchain | sed 's/ (default)//')"
76-
if [[ "$TOOLCHAIN" == *i686-pc-windows-gnu ]]; then
77-
NM="rustup run $TOOLCHAIN $NM"
78-
fi
79-
80-
$NM "$@""
81-
EOF
82-
83-
chmod +x run-rust-nm
50+
export TARGET="$target"
8451

8552
symcheck=(cargo run -p symbol-check)
8653
[[ "$target" = "wasm"* ]] && symcheck+=(--features wasm)

crates/symbol-check/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ fn verify_no_duplicates(path: impl AsRef<Path>) {
169169
if !dups.is_empty() {
170170
dups.sort_unstable_by(|a, b| a.name.cmp(&b.name));
171171

172-
Command::new("run-rust-nm")
172+
Command::new("./run-rust-nm")
173+
.arg(std::env::var("TARGET").unwrap())
173174
.arg(path.as_ref())
174175
.status()
175176
.unwrap();

run-rust-nm

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
set -x
4+
5+
target="$1"
6+
shift
7+
8+
PREFIX=${target//unknown-/}-
9+
case "$target" in
10+
armv7-*)
11+
PREFIX=arm-linux-gnueabihf-
12+
;;
13+
thumb*)
14+
PREFIX=arm-none-eabi-
15+
;;
16+
*86*-*)
17+
PREFIX=
18+
;;
19+
esac
20+
21+
NM=$(find "$(rustc --print sysroot)" \( -name llvm-nm -o -name llvm-nm.exe \) )
22+
if [ "$NM" = "" ]; then
23+
NM="${PREFIX}nm"
24+
fi
25+
26+
# i686-pc-windows-gnu tools have a dependency on some DLLs, so run it with
27+
# rustup run to ensure that those are in PATH.
28+
TOOLCHAIN="$(rustup show active-toolchain | sed 's/ (default)//')"
29+
if [[ "$TOOLCHAIN" == *i686-pc-windows-gnu ]]; then
30+
NM="rustup run $TOOLCHAIN $NM"
31+
fi
32+
33+
$NM "$@"

0 commit comments

Comments
 (0)