[PATCH] D45487: [tsan] Add interceptors for objc_sync_enter and objc_sync_exit

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 10 11:04:59 PDT 2018


kubamracek added inline comments.


================
Comment at: lib/tsan/CMakeLists.txt:121
     LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS} ${WEAK_SYMBOL_LINK_FLAGS}
-    LINK_LIBS ${TSAN_LINK_LIBS}
+    LINK_LIBS ${TSAN_LINK_LIBS} objc
     PARENT_TARGET tsan)
----------------
delcypher wrote:
> Does this mean that `clang_rt.tsan` will now **always** link against `libobjc`? Is that really necessary. Won't that mean it gets linked in for sanitized C programs that have absolutely no business doing anything with the ObjectiveC runtime?
You're right, this always links libobjc, even into program that are not using Objective-C. I don't know how to avoid this dependency, because the dyld interposition requires us to link against the symbols that we intercept.

On the bright side, libobjc gets loaded into every process on macOS anyway. So I believe this is actually safe and shouldn't break anything.


https://reviews.llvm.org/D45487





More information about the llvm-commits mailing list