[PATCH] D28359: [compiler-rt] Use common static library for sanitizer_common.

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 5 14:52:47 PST 2017


kubabrecka added a comment.

In https://reviews.llvm.org/D28359#637463, @mpividori wrote:

> I see we only use shared libraries for APPLE, I was wondering why can't we use static libraries there?
>  let suppose we compile `main.cc` with address and undefined behaviour sanitizers in APPLE.
>  Then, clang will pass to the linker:  `main.o` ,  `asan.so` and `ubsan.so`.


(On Darwin) When using both -fsanitize=address and -fsanitize=ubsan, the driver will only link in the ASan dylib.  It already __also__ contains the UBSan runtime.  This solution currently works and I don't see many problems with that because the number of sanitizer combinations is very limited (you can't use e.g. ASan with TSan together).

We really want to keep using dynamic libraries (at least on Darwin), because 1) we're relying on features only available in dylibs (dyld interposition) and 2) you can easily link multiple instrumented modules (libraries) together without worrying which one should carry the static archive.


Repository:
  rL LLVM

https://reviews.llvm.org/D28359





More information about the llvm-commits mailing list