[PATCH] D24092: [compiler-rt] Allow sanitizers to be compiled for windows with clang

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 14:16:34 PDT 2016


compnerd added inline comments.

================
Comment at: cmake/config-ix.cmake:418
@@ -417,3 +417,3 @@
     (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD" OR
-    (OS_NAME MATCHES "Windows" AND MSVC)))
+    (OS_NAME MATCHES "Windows" AND (MSVC OR ${CMAKE_C_COMPILER_ID} MATCHES Clang))))
   set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)
----------------
rnk wrote:
> I think what we really want to say here is "we support the MS CRT, not the mingw CRT". The check as written will enable building asan for mingw, and that would break their builds. I don't know how to ask that CRT question in cmake though...
The only way that I can see how to phrase that is to use the `COMPILER_RT_TARGET` and rip the environment from that.  The `gnu` and `cygnus` environments are the one with their own CRT and `msvc` and `itanium` use the Microsoft CRT.


https://reviews.llvm.org/D24092





More information about the llvm-commits mailing list