Skip to content

Commit fcb8542

Browse files
committed
update
1 parent 42c2598 commit fcb8542

File tree

2 files changed

+5
-93
lines changed

2 files changed

+5
-93
lines changed

ci/run.sh

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

50-
# Remove any existing artifacts from previous tests that don't set #![compiler_builtins]
5150
symcheck=(cargo run -p symbol-check)
5251
[[ "$target" = "wasm"* ]] && symcheck+=(--features wasm)
5352
symcheck+=(-- build-and-check)
@@ -61,61 +60,7 @@ symcheck+=(-- build-and-check)
6160
"${symcheck[@]}" -p compiler_builtins --target "$target" --features no-f16-f128
6261
"${symcheck[@]}" -p compiler_builtins --target "$target" --features no-f16-f128 --release
6362

64-
# # Look out for duplicated symbols when we include the compiler-rt (C) implementation
65-
# for_each_rlib "${symcheck[@]}" -- check-duplicates
66-
# for_each_rlib rm -f
67-
68-
# PREFIX=${target//unknown-/}-
69-
# case "$target" in
70-
# armv7-*)
71-
# PREFIX=arm-linux-gnueabihf-
72-
# ;;
73-
# thumb*)
74-
# PREFIX=arm-none-eabi-
75-
# ;;
76-
# *86*-*)
77-
# PREFIX=
78-
# ;;
79-
# esac
80-
81-
# NM=$(find "$(rustc --print sysroot)" \( -name llvm-nm -o -name llvm-nm.exe \) )
82-
# if [ "$NM" = "" ]; then
83-
# NM="${PREFIX}nm"
84-
# fi
85-
86-
# # i686-pc-windows-gnu tools have a dependency on some DLLs, so run it with
87-
# # rustup run to ensure that those are in PATH.
88-
# TOOLCHAIN="$(rustup show active-toolchain | sed 's/ (default)//')"
89-
# if [[ "$TOOLCHAIN" == *i686-pc-windows-gnu ]]; then
90-
# NM="rustup run $TOOLCHAIN $NM"
91-
# fi
92-
93-
# # Look out for duplicated symbols when we include the compiler-rt (C) implementation
94-
# update_rlib_paths
95-
# for rlib in "${rlib_paths[@]}"; do
96-
# set +x
97-
# echo "================================================================"
98-
# echo "checking $rlib for duplicate symbols"
99-
# echo "================================================================"
100-
# set -x
101-
102-
# duplicates_found=0
103-
104-
# # NOTE On i586, It's normal that the get_pc_thunk symbol appears several
105-
# # times so ignore it
106-
# $NM -g --defined-only "$rlib" 2>&1 |
107-
# sort |
108-
# uniq -d |
109-
# grep -v __x86.get_pc_thunk --quiet |
110-
# grep 'T __' && duplicates_found=1
111-
112-
# if [ "$duplicates_found" != 0 ]; then
113-
# echo "error: found duplicate symbols"
114-
# exit 1
115-
# else
116-
# echo "success; no duplicate symbols found"
117-
# fi
118-
# done
63+
# Look out for duplicated symbols when we include the compiler-rt (C) implementation
11964

12065
build_intrinsics_test() {
12166
"${symcheck[@]}" \
@@ -134,39 +79,6 @@ build_intrinsics_test --features c --release
13479
CARGO_PROFILE_DEV_LTO=true build_intrinsics_test
13580
CARGO_PROFILE_RELEASE_LTO=true build_intrinsics_test --release
13681

137-
# for_each_rlib "${symcheck[@]}" -- check-core-syms
138-
139-
# # Ensure no references to any symbols from core
140-
# update_rlib_paths
141-
# for rlib in "${rlib_paths[@]}"; do
142-
# set +x
143-
# echo "================================================================"
144-
# echo "checking $rlib for references to core"
145-
# echo "================================================================"
146-
# set -x
147-
148-
# tmpdir="${CARGO_TARGET_DIR:-target}/tmp"
149-
# test -d "$tmpdir" || mkdir "$tmpdir"
150-
# defined="$tmpdir/defined_symbols.txt"
151-
# undefined="$tmpdir/defined_symbols.txt"
152-
153-
# $NM --quiet -U "$rlib" | grep 'T _ZN4core' | awk '{print $3}' | sort | uniq > "$defined"
154-
# $NM --quiet -u "$rlib" | grep 'U _ZN4core' | awk '{print $2}' | sort | uniq > "$undefined"
155-
# grep_has_results=0
156-
# grep -v -F -x -f "$defined" "$undefined" && grep_has_results=1
157-
158-
# if [ "$target" = "powerpc64-unknown-linux-gnu" ]; then
159-
# echo "FIXME: powerpc64 fails these tests"
160-
# elif [ "$grep_has_results" != 0 ]; then
161-
# echo "error: found unexpected references to core"
162-
# exit 1
163-
# else
164-
# echo "success; no references to core found"
165-
# fi
166-
# done
167-
168-
169-
17082
# Test libm
17183

17284
# Make sure a simple build works

crates/symbol-check/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,11 @@ fn verify_no_duplicates(path: impl AsRef<Path>) {
169169
fn verify_core_symbols(path: impl AsRef<Path>) {
170170
let mut defined = BTreeSet::new();
171171
let mut undefined = Vec::new();
172-
let mut found_any = false;
172+
let mut has_symbols = false;
173173

174174
for_each_symbol(path, |sym, member| {
175+
has_symbols = true;
176+
175177
// Find only symbols from `core`
176178
if !sym.name().unwrap().contains("_ZN4core") {
177179
return;
@@ -183,11 +185,9 @@ fn verify_core_symbols(path: impl AsRef<Path>) {
183185
} else {
184186
defined.insert(info.name);
185187
}
186-
187-
found_any = true;
188188
});
189189

190-
assert!(found_any, "no symbols found");
190+
assert!(has_symbols, "no symbols found");
191191

192192
// Discard any symbols that are defined somewhere in the archive
193193
undefined.retain(|sym| !defined.contains(&sym.name));

0 commit comments

Comments
 (0)