diff options
author | Jonathan Metzman <metzman@chromium.org> | 2019-01-22 18:59:25 +0000 |
---|---|---|
committer | Jonathan Metzman <metzman@chromium.org> | 2019-01-22 18:59:25 +0000 |
commit | e4e52f63756f5d5639809ca6c44e3d745744780a (patch) | |
tree | 9ddd949c5bf7023816eb37bc7ed515aa0e48acc8 /lib/fuzzer/CMakeLists.txt | |
parent | ca5da89cdde6d31218a580dcf331afa3fe4bfdad (diff) | |
download | compiler-rt-e4e52f63756f5d5639809ca6c44e3d745744780a.tar.gz |
[libFuzzer][MSVC] Enable building libFuzzer with MSVC
Summary:
Enable building libFuzzer with MSVC.
* Don't try to include <endian.h> in FuzzerSHA1.cpp. MSVC
doesn't have this header, and WINDOWS is always little
endian (even on ARM)
Subscribers: srhines, mgorny, javed.absar, kristof.beyls
Differential Revision: https://reviews.llvm.org/D56510
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/fuzzer/CMakeLists.txt')
-rw-r--r-- | lib/fuzzer/CMakeLists.txt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/fuzzer/CMakeLists.txt b/lib/fuzzer/CMakeLists.txt index caea9734f..f6c5b761a 100644 --- a/lib/fuzzer/CMakeLists.txt +++ b/lib/fuzzer/CMakeLists.txt @@ -71,8 +71,14 @@ if (CMAKE_CXX_FLAGS MATCHES "fsanitize-coverage") list(APPEND LIBFUZZER_CFLAGS -fno-sanitize-coverage=trace-pc-guard,edge,trace-cmp,indirect-calls,8bit-counters) endif() -if(NOT HAS_THREAD_LOCAL) - list(APPEND LIBFUZZER_CFLAGS -Dthread_local=__thread) +if(OS_NAME MATCHES "Windows") + # Silence warnings with /Ehsc and avoid an error by unecessarily defining + # thread_local when it isn't even used on Windows. + list(APPEND LIBFUZZER_CFLAGS /EHsc) +else() + if(NOT HAS_THREAD_LOCAL) + list(APPEND LIBFUZZER_CFLAGS -Dthread_local=__thread) + endif() endif() set(FUZZER_SUPPORTED_OS ${SANITIZER_COMMON_SUPPORTED_OS}) |