summaryrefslogtreecommitdiff
path: root/cmake/config-ix.cmake
diff options
context:
space:
mode:
authorMatt Morehouse <mascasa@google.com>2018-08-30 15:54:44 +0000
committerMatt Morehouse <mascasa@google.com>2018-08-30 15:54:44 +0000
commit0364b6483c341e17d16415e4489f4022fec15820 (patch)
tree2cdbe8380284ddc3a2b145beef04ea306da4cb0e /cmake/config-ix.cmake
parent63e473d060af68b59e9cb7602ef4b8ff92354f09 (diff)
downloadcompiler-rt-0364b6483c341e17d16415e4489f4022fec15820.tar.gz
[libFuzzer] Port to Windows
Summary: Port libFuzzer to windows-msvc. This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well. It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch. It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them. Patch By: metzman Reviewers: morehouse, rnk Reviewed By: morehouse, rnk Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman Differential Revision: https://reviews.llvm.org/D51022 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@341082 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/config-ix.cmake')
-rw-r--r--cmake/config-ix.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index f3935ffd6..1c60c3d03 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -619,7 +619,10 @@ else()
endif()
if (COMPILER_RT_HAS_SANITIZER_COMMON AND FUZZER_SUPPORTED_ARCH AND
- OS_NAME MATCHES "Android|Darwin|Linux|NetBSD|FreeBSD|OpenBSD|Fuchsia")
+ OS_NAME MATCHES "Android|Darwin|Linux|NetBSD|FreeBSD|OpenBSD|Fuchsia|Windows" AND
+ # TODO: Support builds with MSVC.
+ NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" AND
+ NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
set(COMPILER_RT_HAS_FUZZER TRUE)
else()
set(COMPILER_RT_HAS_FUZZER FALSE)