enabling clients to use rpath to find LLVM shared libraries on OS X

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Nov 4 18:37:07 PST 2013


On 4 November 2013 18:27, Benjamin Scarlet <flld0 at greynode.net> wrote:
> I would have thought that the proper solution would be to link the linker with an appropriate rpath. After my change, responsibility for specifying the path to the library moves from the library to the executable - thus enabling it to be different for different executables. If the linker is to be rebuilt, it needs to have "-rpath @executable_path/../lib" or such passed to the linker when linking the new linker. (If the linker to link the new linker is invoked by a compiler driver like clang or gcc, then that probably means you need to put a "-Wl," before each of those flags to get them passed through to the linker, so "-Wl,-rpath -Wl, at executable_path/../lib".). There's an example of this on line 622 of the Makefile.rules in the root directory of the llvm source.
>
> To answer your direct question, I'm not using libLTO.dylib at all, so reverting my change there wouldn't directly cause me any trouble. I do think it'd be a step backward in general, though.
>
> Is the code for the linker that's using libLTO.dylib in the llvm tree somewhere I missed in in my patch, or is it outside the llvm tree?

I think it is this one:

http://www.opensource.apple.com/source/ld64/

Cheers,
Rafael




More information about the llvm-commits mailing list