Getting ld64 to use a non system libLTO.dylib

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


Since ld64 uses a library instead of a plugin, the clang driver cannot
simply pass a -plugin option to point it to the correct one. This
leads to bugs like llvm.org/pr18641 where ld64 loads the system
libLTO.dylib and that is then surprised to find IR constructs that
didn't exist when it was built.

Once understood, the bug is easy to work around, just set DYLD_LIBRARY_PATH.

Should clang patch DYLD_LIBRARY_PATH when running ld64? Is there a
better way for it to inform ld64 of the correct library to use?

Thanks,
Rafael



More information about the llvm-commits mailing list