summaryrefslogtreecommitdiff
path: root/lib/asan/asan_mac.cc
diff options
context:
space:
mode:
authorKuba Brecka <kuba.brecka@gmail.com>2014-11-19 01:31:59 +0000
committerKuba Brecka <kuba.brecka@gmail.com>2014-11-19 01:31:59 +0000
commit25f696a8268439d55ef9ce9f41d54b5aec5a80b8 (patch)
tree6712d5192a6bcbaba4f017586a03d331526ca2df /lib/asan/asan_mac.cc
parent2f47b9dc1b11a9ede29dc35fabd21463adbbfdc6 (diff)
Make the ASan OS X DYLD_INSERT_LIBRARIES detection path-independent
Reviewed at http://reviews.llvm.org/D6238 ASan on Darwin during launch reads DYLD_INSERT_LIBRARIES env. variable and if it's not set or if the ASan dylib is not present in there, it relaunches the process. The check whether the dylib is present in the variable is now trying to find a full path in there. This fails in the scenarios where we want to copy the dylib to the executable's directory or somewhere else and set the DYLD_INSERT_LIBRARIES manually, see http://reviews.llvm.org/D6018. Let's change the search in DYLD_INSERT_LIBRARIES to only look for the filename of the dylib and not the full path. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_mac.cc')
-rw-r--r--lib/asan/asan_mac.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/asan/asan_mac.cc b/lib/asan/asan_mac.cc
index a353d27ac..40143578e 100644
--- a/lib/asan/asan_mac.cc
+++ b/lib/asan/asan_mac.cc
@@ -114,7 +114,7 @@ void MaybeReexec() {
internal_strlen(dyld_insert_libraries) : 0;
uptr fname_len = internal_strlen(info.dli_fname);
if (!dyld_insert_libraries ||
- !REAL(strstr)(dyld_insert_libraries, info.dli_fname)) {
+ !REAL(strstr)(dyld_insert_libraries, StripModuleName(info.dli_fname))) {
// DYLD_INSERT_LIBRARIES is not set or does not contain the runtime
// library.
char program_name[1024];