This is an archive of the discontinued LLVM Phabricator instance.

Specify unwind lib before other system libraries.
ClosedPublic

Authored by ychen on Jan 30 2019, 8:17 PM.

Details

Summary

This matters on OSX because static linking orders is also the order dyld uses to search for libs(the default - Two-level namespace).
If system libs (including unwind lib) are specified before local unwind lib, local unwind lib would never be picked up by dyld.

Before
$ otool -L lib/libc++abi.dylib
lib/libc++abi.dylib:

@rpath/libc++abi.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
@rpath/libunwind.1.dylib (compatibility version 1.0.0, current version 1.0.0)

After
$ otool -L lib/libc++abi.dylib
lib/libc++abi.dylib:

@rpath/libc++abi.1.dylib (compatibility version 1.0.0, current version 1.0.0)
@rpath/libunwind.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)

Diff Detail

Repository
rL LLVM

Event Timeline

ychen created this revision.Jan 30 2019, 8:17 PM
ychen edited the summary of this revision. (Show Details)Jan 30 2019, 8:42 PM
phosek added inline comments.Feb 1 2019, 9:31 PM
src/CMakeLists.txt
229 ↗(On Diff #184445)

Can you also update this line for (visual) consistency?

ychen updated this revision to Diff 184892.Feb 1 2019, 9:39 PM
ychen edited the summary of this revision. (Show Details)
  • also change static lib linking order for consistency
ychen marked an inline comment as done.Feb 1 2019, 9:39 PM

address comment

phosek accepted this revision.Feb 2 2019, 12:50 PM

LGTM

This revision is now accepted and ready to land.Feb 2 2019, 12:50 PM
ychen added a comment.Feb 2 2019, 6:18 PM

Could you please commit this for me? Thank you!

ldionne accepted this revision.Feb 4 2019, 7:12 AM
ldionne requested changes to this revision.Feb 28 2019, 6:00 PM

Sorry for the delay. Can you please rebase this on top of the current master? I am unable to apply the patch for some reason.

This revision now requires changes to proceed.Feb 28 2019, 6:00 PM
ychen updated this revision to Diff 188836.Feb 28 2019, 6:37 PM
  • rebase
ldionne accepted this revision.Mar 1 2019, 2:52 PM
This revision is now accepted and ready to land.Mar 1 2019, 2:52 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 1 2019, 2:57 PM