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

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 5 13:16:57 PST 2017


mpividori added a comment.

Hi Mike,

In https://reviews.llvm.org/D28359#637308, @aizatsky wrote:

> Marcos,
>
> I worry that our set of static and shared runtimes will be different. If we do this split, we should do it for dynamic libraries too. I don't know if we have static initializers, but we might end up running them twice.


What do you mean by running them twice? Inside each shared library? For shared libraries, nothing changes, so it will be the same than before.
For static libraries, this is also the same. But I change how the code is included.
Instead of including the code from sanitizer common inside each static library, and then including that static library (which fails if we include more than once).
I remove the san_common code from the static libraries, and move that code into a separate static library.
The list of object files included at the end is the same.

> I suggest you do the same separation for dynamic runtimes as will.

If you think it is clearer, I can remove `RTSanitizerCommon` `RTSanitizerCommonLibc` from shared libraries too, and add a dependency on `clang_rt.san_common.a`
(At the end is the same, the code of `RTSanitizerCommon` `RTSanitizerCommonLibc` will be included in that shared library).

Let me know if I should explain this better.
Thanks


Repository:
  rL LLVM

https://reviews.llvm.org/D28359





More information about the llvm-commits mailing list