Skip to content

Commit

Permalink
Merge branch 'cmm-externs-8.5' of https://github.com/WebGHC/ghc into …
Browse files Browse the repository at this point in the history
…cmm-externs-8.5
  • Loading branch information
dfordivam committed Jul 17, 2018
2 parents 3b8080d + 895006c commit bb7ffb4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions rts/RtsMessages.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__);
Expand Down
4 changes: 2 additions & 2 deletions rts/RtsSymbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 */
};

0 comments on commit bb7ffb4

Please sign in to comment.