This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Define the signature for __stack_chk_fail
ClosedPublic

Authored by sunfish on Mar 18 2019, 4:42 PM.

Details

Summary

The WebAssembly backend needs to know the signatures of all runtime libcall functions. This adds the signature for __stack_chk_fail which was previously missing.

Diff Detail

Repository
rL LLVM

Event Timeline

sunfish created this revision.Mar 18 2019, 4:42 PM
sbc100 accepted this revision.Apr 8 2019, 10:33 AM

I think I may have seen a crash recently related to this.

Can we add a test?

Also, IIRC the crash the is reported doesn't include the symbol name, which would be useful in the future perhaps?

This revision is now accepted and ready to land.Apr 8 2019, 10:33 AM

I made the error message include the name of the function, and added a test.

This revision was automatically updated to reflect the committed changes.
sbc100 added inline comments.Apr 29 2019, 3:08 PM
llvm/trunk/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
846

Wouldn't it be nicer to do something like: llvm_unreachable("unexpected runtime library name: " + Name);

sunfish marked an inline comment as done.Apr 29 2019, 3:40 PM
sunfish added inline comments.
llvm/trunk/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
846

It's a little more involved in that because all the types are char* and the argument is char*, but it's doable. Done, in r359509.