[patch] Centralize the handling of install_name and rpath
Argyrios Kyrtzidis
akyrtzi at gmail.com
Thu Feb 27 19:59:00 PST 2014
LGTM!
On Feb 27, 2014, at 7:32 PM, Rafael EspĂndola <rafael.espindola at gmail.com> wrote:
> Currently this is spread over multiple locations and is out of sync
> between Makefile and CMake. For example
>
> * libclang uses an @rpath install name.
> * libLTO uses @executable_path with Makefile.
> * everything else uses @executable_path when building with cmake.
>
> For some reason it looks like @rpath is needed by libclang. It seems
> to work for the others too, so what these patches do is centralize the
> logic for using "-install_name @rpath" for shared libraries and
> "-rpath @executable_path/../lib" for binaries.
>
> Having the logic in one place is cleaner and introduces a single point
> to patch for supporting old OS X versions.
>
> I now get in a configure build:
>
> $ otool -l Debug+Asserts/lib/libLTO.dylib | grep LC_ID_DYLIB -A2
> cmd LC_ID_DYLIB
> cmdsize 48
> name @rpath/libLTO.dylib (offset 24)
>
> $ otool -l Debug+Asserts/lib/libclang.dylib | grep LC_ID_DYLIB -A2
> cmd LC_ID_DYLIB
> cmdsize 48
> name @rpath/libclang.dylib (offset 24)
>
> $ otool -l Debug+Asserts/bin/llvm-as | grep LC_RPATH -A2
> cmd LC_RPATH
> cmdsize 40
> path @executable_path/../lib (offset 12)
>
> and in a cmake build
>
> $ otool -l lib/libLTO.dylib | grep LC_ID_DYLIB -A2
> cmd LC_ID_DYLIB
> cmdsize 48
> name @rpath/libLTO.dylib (offset 24)
>
> $ otool -l lib/libclang.3.5.dylib | grep LC_ID_DYLIB -A2
> cmd LC_ID_DYLIB
> cmdsize 56
> name @rpath/libclang.3.5.dylib (offset 24)
>
> $ otool -l bin/llvm-as | grep LC_RPATH -A2
> cmd LC_RPATH
> cmdsize 40
> path @executable_path/../lib (offset 12)
>
> Cheers,
> Rafael
> <llvm.patch><clang.patch>
More information about the llvm-commits
mailing list