Page MenuHomePhabricator

[LLD] [COFF] Fix the mingw --export-all-symbols behaviour with comdat symbols
ClosedPublic

Authored by mstorsjo on Apr 29 2021, 5:03 AM.

Details

Summary

When looking for the "all" symbols that are supposed to be exported,
we can't look at the live flag - the symbols we mark as to be
exported will become GC roots even if they aren't yet marked as live.

With this in place, building an LLVM library with BUILD_SHARED_LIBS
produces the same set of symbols exported regardless of whether the
--gc-symbols flag is specified, both with and without being built
with -ffunction-sections.

Diff Detail

Event Timeline

mstorsjo requested review of this revision.Apr 29 2021, 5:03 AM
mstorsjo created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 29 2021, 5:03 AM
rnk accepted this revision.Apr 29 2021, 11:55 AM

lgtm

Yeah, this would be an issue for explicit / extern template instantiations.

This revision is now accepted and ready to land.Apr 29 2021, 11:55 AM