Page MenuHomePhabricator

[Driver] Darwin: Link in the profile runtime archive first
ClosedPublic

Authored by vsk on Jul 13 2017, 2:29 PM.

Details

Summary

While building a project with code coverage enabled, we can link in
dependencies which export a weak definition of __llvm_profile_filename.

After r306710, linking in the profiling runtime could pull in a weak
definition of this symbol from a dependency, instead of from within the
runtime's archive.

This inconsistency causes issues during API verification, and is also a
practical problem (the symbol would go missing were the dependent dylib
to be switched out). Introduce a LinkFirst runtime link option to make
sure we always search the profiling runtime for this symbol first.

rdar://problem/33271080

Diff Detail

Repository
rL LLVM

Event Timeline

vsk created this revision.Jul 13 2017, 2:29 PM
ributzka accepted this revision.Aug 22 2017, 11:52 AM

Nice cleanup with the RuntimeLinkOptions enum. LGTM

This revision is now accepted and ready to land.Aug 22 2017, 11:52 AM
This revision was automatically updated to reflect the committed changes.