[lld] r262910 - ELF: Add /lib and /usr/lib as default search paths.

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 8 10:56:31 PST 2016


On Tue, Mar 08, 2016 at 12:56:10PM -0500, Ed Maste via llvm-commits wrote:
> On 8 March 2016 at 12:20, Rafael EspĂ­ndola <llvm-commits at lists.llvm.org> wrote:
> > Sorry, I reverted this.
> >
> > The problem is that it broke linking on Fedora 64 bits. There the
> > default search path should be /lib64 /usr/lib64.
> >
> > It is probably better to try to stay out of the business of knowing
> > the defaults of multiple systems. The vast majority or links are
> > started by the driver and it passes all the necessary -L options.
> 
> Does the compiler driver pass both -L/lib and -L/usr/lib (or lib64,
> etc.) on most systems? On FreeBSD Clang passes only -L/usr/lib and
> system relies on the /lib default provided by the linker.

I'm surprised it even passes -L/usr/lib and would call that a bug.
That said, this is really an area where targets differ significantly.
For NetBSD, the defaults depend on the target and active "emulation",
so for 32bit x86 ELF, /usr/lib is used for i386 and /usr/lib/i386 for
amd64. Similar logic exists for all the other multi-ABI platforms.

Joerg


More information about the llvm-commits mailing list