]> granicus.if.org Git - llvm/commit
[libFuzzer] Use clang as linker on Windows, to properly include sanitizer libraries.
authorMarcos Pividori <mpividori@google.com>
Fri, 20 Jan 2017 22:49:08 +0000 (22:49 +0000)
committerMarcos Pividori <mpividori@google.com>
Fri, 20 Jan 2017 22:49:08 +0000 (22:49 +0000)
commitcad86c75f7a9e308404f484ca2819eca14c2f1bc
tree2dc01f6400c8ecc4619b32244655a67e05bb8593
parent40dcc15c2508410250f8ea473965efed1f494a34
[libFuzzer] Use clang as linker on Windows, to properly include sanitizer libraries.

In order to use sanitizers on Windows, we need to link against many runtime
libraries which will depend on the target being created (executable or dll) and
the c runtime library used (MT/MD).
By default, cmake uses link.exe for linking, which fails because we don't
specify the appropiate dependencies. As we don't want to consider all of that
possible situations which depends on the implementation of the compiler-rt, the
simplest option is to change the rules for linking executables and shared
libraries, using the compiler instead of link.exe.
Clang driver will consider the sanitizer flags, and automatically provide the
required libraries to the linker.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292669 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Fuzzer/test/CMakeLists.txt