This is an archive of the discontinued LLVM Phabricator instance.

[LLD] [COFF] Allow exporting all symbols from system libraries specfied with -wholearchive:
ClosedPublic

Authored by mstorsjo on Aug 31 2018, 1:30 AM.

Details

Summary

When building a shared libc++.dll, it pulls in libc++abi.a statically with the --wholearchive flag. If such a build is done with --export-all-symbols, I think it's reasonable to assume that everything from that library also should be exported with the same rules as normal local object files, even though we normally avoid autoexporting things from libc++abi.a in other cases when linking a DLL (user code).

Alternatively, as most setups with a static C++ lib would have included all of libc++abi.a in libc++.a, and end user code would never link against libc++abi.a, we could also just remove libc++abi.a from the exclude list?

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Aug 31 2018, 1:30 AM
rnk accepted this revision.Sep 4 2018, 1:49 PM

Auto-exporting stuff from whole archives makes sense to me. Whole archive libraries are usually implementation details of shared libraries, and not system libraries.

This revision is now accepted and ready to land.Sep 4 2018, 1:49 PM
This revision was automatically updated to reflect the committed changes.