[PATCH] D42652: [WebAssembly] Make function signature checks into warning

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 14:34:49 PST 2018


sbc100 added a comment.

The biggest culprit I've seen so far is the declaration of `main()` itself.  We are talking about special casing this in the frontend since the standard allows it to have two different signatures.

Outside of that, we need to see just how widespread the signature mismatch issue is.  If it only effects a few existing projects they it might be feasible the enable this error by default and to fix those projects.  If such violations are common we may need to do some more cleverness/mitigations in the linker.

Often times the resulting modules can actually be runable, if the function is called via call_indirect().  In this case the resulting program will fail at run time rather than validation time, and only if that particular function is called.  One can imagine a project that includes such code, but in practice never execute it.  Indeed this is the case for musl, which calls main, but indirectly in its _start function.  As long as we don't actually call its start (i.e if we call main() directly instead) that module is still usable.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42652





More information about the llvm-commits mailing list