This is an archive of the discontinued LLVM Phabricator instance.

Use different export file when linking with dylib
ClosedPublic

Authored by serge-sans-paille on Dec 13 2022, 6:09 AM.

Details

Summary

This fixes compilation of clang with lld, as reported in
https://reviews.llvm.org/D135402.

Basically some symbols are not available when not linking statically.

Diff Detail

Event Timeline

serge-sans-paille requested review of this revision.Dec 13 2022, 6:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2022, 6:09 AM
jhuber6 added inline comments.Dec 13 2022, 6:22 AM
llvm/tools/remarks-shlib/CMakeLists.txt
16

Aren't these the same? Why the else.

serge-sans-paille marked an inline comment as done.
jhuber6 accepted this revision.Dec 13 2022, 7:24 AM

I don't see any change, but I'll go ahead and accept it assuming the Remarks.exports will be fixed before landing.

This revision is now accepted and ready to land.Dec 13 2022, 7:24 AM

Patch updated, thanks to @jhuber6 for the fix.

For the record, I considered passing a flag to the linker to *not* warn about symbols mentioned in the version script but not present in the actual library, or trying to derive the .dylib.export from the .export file, but this explicit solution looks better to me, with the slight disadventage of introducing some redunduncy, which is probably better than adding entries that don't exist (e.g. through a typo).

This revision was landed with ongoing or failed builds.Dec 13 2022, 12:34 PM
This revision was automatically updated to reflect the committed changes.