[WebAssembly] Use hardcoded list expected undefined symbols (#21)

Rather than generate wasm.syms from wasm.js (which includes
a huge superset of the number of symbols actaully expected
to be undefined at link time) simply hardcode that list as
a test file, which lld can read.
This commit is contained in:
Sam Clegg 2017-11-07 15:17:25 -08:00 committed by GitHub
parent 8116ebcd0c
commit c185c68dd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 110 additions and 81 deletions

View File

@ -951,10 +951,6 @@ var ffi = (function() {
if (arguments.length < 1)
throw new Error('Expected at least one wasm module to load.');
if (arguments[0] == '--dump-ffi-symbols') {
for (var name in ffi["env"])
print(name)
} else {
function load_wasm(file_path) {
// TODO this should be split up in load, check dependencies, and then resolve
// dependencies. That would make it easier to do lazy loading. We could do
@ -1035,4 +1031,3 @@ if (arguments[0] == '--dump-ffi-symbols') {
throw e;
}
}
}

34
arch/wasm32/wasm.syms Normal file
View File

@ -0,0 +1,34 @@
# Symbols we want wasm.js to define at runtime
_Exit
abort
puts
# Musl syscall interface, provided by wasm.js
__syscall
__syscall0
__syscall1
__syscall2
__syscall3
__syscall4
__syscall5
__syscall6
__syscall_cp
# Symbols not supported by clang but currently expected to work on the
# wasm waterfall
# TODO(sbc): remove these
__builtin_isinff
__builtin_isinfl
__builtin_clrsb
__builtin_clrsbl
__builtin_clrsbll
__builtin_apply
__builtin_apply_args
__builtin_malloc
# Part of musl we still don't compile for wasm
__lock
__unlock
__set_thread_area
setjmp
longjmp