Use @rpath as LC_ID_DYLIB for ASan dylib on OS X
authorKuba Brecka <kuba.brecka@gmail.com>
Tue, 4 Nov 2014 17:35:17 +0000 (17:35 +0000)
committerKuba Brecka <kuba.brecka@gmail.com>
Tue, 4 Nov 2014 17:35:17 +0000 (17:35 +0000)
commit9ff912db225f846d49da4a866033ec609324a005
tree04b9ba216fefec907f2d33542201fe6938c860ab
parent6c22aec23c5340448d6d64f4fc3b6791569c5255
Use @rpath as LC_ID_DYLIB for ASan dylib on OS X

Change the LC_ID_DYLIB of ASan's dynamic libraries on OS X to be set to "@rpath/libclang_rt.asan_osx_dynamic.dylib" and similarly for iossim. Clang driver then sets the "-rpath" to be the real path to where clang currently has the dylib (because clang uses the relative path to its current executable). This means if you move the compiler or install the binary release, -fsanitize=address will link to the proper library.

Reviewed at http://reviews.llvm.org/D6018

llvm-svn: 221279
clang/lib/Driver/ToolChains.cpp
clang/lib/Driver/ToolChains.h
clang/test/Driver/darwin-sanitizer-ld.c