diff --git a/Makefile b/Makefile index 83c8632..02f3e7f 100644 --- a/Makefile +++ b/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" diff --git a/expected/wasm32-wasi/undefined-symbols.txt b/expected/wasm32-wasi/undefined-symbols.txt index 75bee03..8715e54 100644 --- a/expected/wasm32-wasi/undefined-symbols.txt +++ b/expected/wasm32-wasi/undefined-symbols.txt @@ -12,11 +12,6 @@ __getf2 __gttf2 __letf2 __lttf2 -__muldc3 -__muloti4 -__mulsc3 -__multc3 -__multf3 __netf2 __stack_pointer __subtf3