This is an archive of the discontinued LLVM Phabricator instance.

[lld][WebAssembly] Honor --allow-undefined for data symbols too
ClosedPublic

Authored by sbc100 on May 1 2020, 10:12 AM.

Details

Summary

This was originally the way this worked before before
https://reviews.llvm.org/D60882.

In retrospect it seems inconsistent that --allow-undefined doesn't
work for all symbols. See:
https://groups.google.com/g/emscripten-discuss/c/HSRgQiIq1gI/m/Kt9oFWHiAwAJ

I'm also planning a followup change which implement the full
--unresolved-symbols=.. flags supported by ELF linkers (both ld and
ld.lld) since it seems more standard.

Diff Detail

Event Timeline

sbc100 created this revision.May 1 2020, 10:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 1 2020, 10:12 AM

So the plan is to support unresolved-symbols and then eventually deprecate and remove this?

sbc100 added a comment.May 5 2020, 6:30 PM

So the plan is to support unresolved-symbols and then eventually deprecate and remove this?

Eventually yes that would great. However I think it will take several llvm version before we are ready to do that. Today the --allow-undefined flag has many users including emscripten, and they rely on the current behviour of this flag which is to turn undefined function symbols into function imports. We maybe or may not want to keep the behaviour somehow (either via this flag, or one with a better name such as --import-undefined-functions), even though we now have clang/llvm/symbol attributes to mark functions for import.

dschuff accepted this revision.May 6 2020, 10:43 AM
This revision is now accepted and ready to land.May 6 2020, 10:43 AM
This revision was automatically updated to reflect the committed changes.