This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] EmscriptenEHSjLj: Make __invoke_ functions as imported
ClosedPublic

Authored by sbc100 on Mar 31 2020, 9:48 PM.

Details

Summary

This means the linker will be expecting them be undefined at link
time an will generate imports from the env module rather than
reporting undefined externals.

Diff Detail

Event Timeline

sbc100 created this revision.Mar 31 2020, 9:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 31 2020, 9:48 PM
aheejin added a comment.EditedApr 1 2020, 8:59 AM
  • Is this for static linking or dynamic linking? How were things linked before this?
  • Is there any tests?
aheejin accepted this revision.Apr 1 2020, 9:45 AM

(Virtually) talked in person and I have better context for this change now. It'd be better we can add a test for this.

This revision is now accepted and ready to land.Apr 1 2020, 9:45 AM
sbc100 added a comment.Apr 1 2020, 9:45 AM

In emscripten we traditionally link with --allow-undefined which assumes that any/all undefined symbols get imported from the environment.

The motivation for this change is to allow us to remove that flag and have the linker report undefined symbols that are not explicitly marked in this way.

There will be plenty of tests for this on the emscripten side, but I can add one here if you prefer too?

Yeah then it should be fine to add them in Emscripten side.

sbc100 updated this revision to Diff 254248.Apr 1 2020, 10:28 AM

Add test

aheejin accepted this revision.Apr 1 2020, 11:12 AM

Thanks!

This revision was automatically updated to reflect the committed changes.