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

Michał Górny via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 31 17:12:57 PDT 2016


mgorny created this revision.
mgorny added reviewers: rafael, beanz, chandlerc.
mgorny added a subscriber: cfe-commits.
Herald added subscribers: mehdi_amini, srhines, danalbert, tberghammer.

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
https://reviews.llvm.org/D23754. Unlike the original proposal, it does not introduce additional
options that could confuse users and does not affect anything in common
installations.


https://reviews.llvm.org/D26175

Files:
  lib/Driver/Tools.cpp
  test/Driver/gold-lto.c
  test/Driver/lto.c
  test/Driver/thinlto.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26175.76507.patch
Type: text/x-patch
Size: 5156 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161101/31fd8436/attachment-0001.bin>


More information about the cfe-commits mailing list