Browse Source

When checking undefined symbol list, ignore certain llvm buildins

These can vary between llvm version.  For example a recent upstream
change recently added __multi3 to the list:
https://reviews.llvm.org/D65143

Fixes #98
pull/101/head
Sam Clegg 5 years ago
committed by Dan Gohman
parent
commit
c35f0f5dd6
  1. 4
      Makefile
  2. 5
      expected/wasm32-wasi/undefined-symbols.txt

4
Makefile

@ -451,12 +451,14 @@ finish: startup_files libc
# Collect symbol information.
# TODO: Use llvm-nm --extern-only instead of grep. This is blocked on
# LLVM PR40497, which is fixed in 9.0, but not in 8.0.
# Ignore certain llvm builtin symbols such as those starting with __mul
# since these dependencies can vary between llvm versions.
"$(WASM_NM)" --defined-only "$(SYSROOT_LIB)"/libc.a "$(SYSROOT_LIB)"/*.o \
|grep ' [[:upper:]] ' |sed 's/.* [[:upper:]] //' |LC_ALL=C sort > "$(SYSROOT_SHARE)/defined-symbols.txt"
for undef_sym in $$("$(WASM_NM)" --undefined-only "$(SYSROOT_LIB)"/*.a "$(SYSROOT_LIB)"/*.o \
|grep ' U ' |sed 's/.* U //' |LC_ALL=C sort |uniq); do \
grep -q '\<'$$undef_sym'\>' "$(SYSROOT_SHARE)/defined-symbols.txt" || echo $$undef_sym; \
done > "$(SYSROOT_SHARE)/undefined-symbols.txt"
done | grep -v "^__mul" > "$(SYSROOT_SHARE)/undefined-symbols.txt"
grep '^_*wasi_' "$(SYSROOT_SHARE)/undefined-symbols.txt" \
> "$(SYSROOT_LIB)/libc.imports"

5
expected/wasm32-wasi/undefined-symbols.txt

@ -12,11 +12,6 @@ __getf2
__gttf2
__letf2
__lttf2
__muldc3
__muloti4
__mulsc3
__multc3
__multf3
__netf2
__stack_pointer
__subtf3

Loading…
Cancel
Save