This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Fall back to plain '-plugin LLVMgold.so' if no lib at std path
AbandonedPublic

Authored by mgorny on Oct 31 2016, 5:12 PM.

Details

Summary

Add a fallback to using plain '-plugin LLVMgold.so' when the plugin does
not exist at the standard path. This e.g. happens on Gentoo when clang
is compiled for a different ABI than binutils.

Since full path is used to reference LLVMgold.so, it is safe to use
the same path to check whether the plugin exists. If it does not, this
lets gold perform library search instead of passing known-wrong path.
As a result, the plugin is either found somewhere in search path, or
gold fails the same.

This is an alternate solution to the problem originally addressed by
D23754. Unlike the original proposal, it does not introduce additional
options that could confuse users and does not affect anything in common
installations.

Diff Detail

Event Timeline

mgorny updated this revision to Diff 76507.Oct 31 2016, 5:12 PM
mgorny retitled this revision from to [Driver] Fall back to plain '-plugin LLVMgold.so' if no lib at std path.
mgorny updated this object.
mgorny added reviewers: rafael, beanz, chandlerc.
mgorny added a subscriber: cfe-commits.
espindola edited reviewers, added: espindola; removed: rafael.Mar 15 2018, 10:09 AM
mgorny abandoned this revision.Mar 15 2018, 10:27 AM