[PATCH] D27869: [libFuzzer] Diff 24 - Use clang as linker in Windows, to properly include sanitizer libraries.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 16:30:35 PST 2016


mpividori added inline comments.


================
Comment at: lib/Fuzzer/test/CMakeLists.txt:41
 
+if(MSVC)
+  # In order to use the sanitizers in Windows, we need to link against many
----------------
rnk wrote:
> kcc wrote:
> > sounds wrong. 
> > why we can't have this in the clang driver? 
> We can't have it in the clang driver because the clang driver isn't called to perform links on Windows, as explained in this comment. This CL seems to do what you're suggesting: call the driver and keep the logic to find sanitizer runtimes there.
@kcc
If we use clang, it will automatically include the libraries from compiler-rt when using the linker (link.exe)
If we don't add this modification, cmake will directly try to link using link.exe, but it won't include the libraries, so it will fail.
It is different in linux, because the linker receives the compiler flags. As far a I understand.


Repository:
  rL LLVM

https://reviews.llvm.org/D27869





More information about the llvm-commits mailing list