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

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 11 09:59:26 PDT 2018


delcypher 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)
----------------
kubamracek wrote:
> 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.
Okay. Presumably, TSan will still initialise properly (i.e. the fact that TSan links `libobjc` won't break initialisation order)?


https://reviews.llvm.org/D45487





More information about the llvm-commits mailing list