Getting ld64 to use a non system libLTO.dylib

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Apr 29 16:57:08 PDT 2014


> I do have a bug to add a command line option to the linker to specify the path to the libLTO.dylib that the linker should use.

That would be perfect :-)

> If someone is building TOT clang, where is libLTO.dylib built and how would the
> clang driver know to use it?    How does the just built clang find ld64 (it is buried in Xcode these days).

For the plugin in ELF it just assuming a relative path (../lib) to the
clang binary itself. I am not sure what exactly is the logic for
finding ld64 in the driver these days.

> Assuming the clang build system figures that all out, yes setting DYLD_LIBRARY_PATH before invoking ld64 could work.  Or the clang build system could set up a symlink to the linker relative to the built libLTO.dylb, such that when the linker tries to find libLTO.dylib relative to itself, it finds the just build libLTO.dylib.

The problem is that a single clang driver can use different linkers in
different invocations.

Cheers,
Rafael




More information about the llvm-commits mailing list