[PATCH] D57323: [WebAssembly] Enable main-function signature rewriting for WASI

Dan Gohman via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 29 11:28:05 PST 2019


The fix is probably this, though I haven't tested it yet:

diff --git a/tests/test_core.py b/tests/test_core.py
index a74efd137..34025ee5a 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1124,10 +1125,12 @@ int main(int argc, char **argv)
     self.set_setting('DISABLE_EXCEPTION_CATCHING', 2)
     # Wasm does not add an underscore to function names. For wasm, the
     # mismatches are fixed in fixImports() function in JS glue code.
+    # Also, the wasm backend translates "main(void)" to a
+    # "main(int, char *[])" wrapper around "__original_main(void)".
     if not self.is_wasm_backend():
       self.set_setting('EXCEPTION_CATCHING_WHITELIST', ["_main"])
     else:
-      self.set_setting('EXCEPTION_CATCHING_WHITELIST', ["main"])
+      self.set_setting('EXCEPTION_CATCHING_WHITELIST', ["main",
"__original_main"])
     # otherwise it is inlined and not identified
     self.set_setting('INLINING_LIMIT', 1)

If anyone has a chance to test this before me, feel free to apply this.
Otherwise I'll submit a PR when I get a chance.

Dan

On Tue, Jan 29, 2019 at 10:23 AM Alon Zakai via Phabricator <
reviews at reviews.llvm.org> wrote:

> kripken added a comment.
>
> This broke binaryen2.test_exceptions_white_list_2
>
> e.g.
> https://logs.chromium.org/logs/wasm/buildbucket/cr-buildbucket.appspot.com/8922985927078952624/+/steps/Execute_emscripten_testsuite__emwasm_/0/stdout
>
>
> Repository:
>   rL LLVM
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D57323/new/
>
> https://reviews.llvm.org/D57323
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190129/656542d3/attachment.html>


More information about the llvm-commits mailing list