diff --git a/rts/RtsMessages.c b/rts/RtsMessages.c index d796bcff59a1..3d1f8eff98a4 100644 --- a/rts/RtsMessages.c +++ b/rts/RtsMessages.c @@ -50,8 +50,15 @@ barf(const char*s, ...) } // This wrapper is added to call barf from cmm code without varargs. -// This is a workaround to make clang generate correct calls in wasm target. - +// This is a workaround to make clang generate correct calls in wasm +// target. Wasm does not directly support varargs, so Clang uses a +// different ABI for varargs calls than normal calls, which no other +// target does. +// +// https://bugs.llvm.org/show_bug.cgi?id=35385 +// +// TODO: Replace this by allowing Cmm code to indicate where varargs +// begin and calling `barf` correctly. void barf_cmm_wrapper(const char*s) GNUC3_ATTRIBUTE(__noreturn__); diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c index ee3135bbc786..f90fdedbae16 100644 --- a/rts/RtsSymbols.c +++ b/rts/RtsSymbols.c @@ -1020,7 +1020,7 @@ RTS_LIBFFI_SYMBOLS RtsSymbolVal rtsSyms[] = { // Wasm doesn't support dynamic linking, and it complains if there is a type mismatch // So a simple workaround is not to declare the symbol table. -#if !defined (wasm32_HOST_ARCH) +#if !defined (__wasm__) RTS_SYMBOLS RTS_RET_SYMBOLS RTS_POSIX_ONLY_SYMBOLS @@ -1038,6 +1038,6 @@ RtsSymbolVal rtsSyms[] = { // lazy pointers as nonlazy. { "dyld_stub_binding_helper", (void*)0xDEADBEEF, false }, #endif -#endif /* wasm32_HOST_ARCH */ +#endif /* __wasm__ */ { 0, 0, false } /* sentinel */ };