]> granicus.if.org Git - clang/commit
[windows] [asan] Add wholearchive flag when including static lib asan.
authorMarcos Pividori <mpividori@google.com>
Tue, 31 Jan 2017 18:31:38 +0000 (18:31 +0000)
committerMarcos Pividori <mpividori@google.com>
Tue, 31 Jan 2017 18:31:38 +0000 (18:31 +0000)
commit4ed260881c4a80a2da88daa3daeb427e28d8c457
tree21c76946fd4d13d13ec9c44cc4142886e40ad111
parent031e09eb555929253e90f8c815ba8300cc1e5774
[windows] [asan] Add wholearchive flag when including static lib asan.

In Windows, when the sanitizer is implemented as a static library, we use
auxiliary static library dll_thunk that will be linked to the dlls that have
instrumentation, so they can refer to the runtime in the main executable.
It uses interception to get a pointer the function in the main executable and
override its function with that pointer.
Because of that, we need to ensure that the main executable exports all the
sanitizers' interface, otherwise the initialization in dll_thunk will fail.

In this commit we add the flag -wholearchive to clang driver to ensure that
the linker does not omit any object files from asan library.

Differential Revision: https://reviews.llvm.org/D29334

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293668 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Driver/Tools.cpp