[libFuzzer] Port to Windows
authorMatt Morehouse <mascasa@google.com>
Thu, 30 Aug 2018 15:54:44 +0000 (15:54 +0000)
committerMatt Morehouse <mascasa@google.com>
Thu, 30 Aug 2018 15:54:44 +0000 (15:54 +0000)
commit7e042bb1d18a06fc4b67143b5615acb15b4b8c57
treeeffd0132d7b8811860d71c417fda7a072c36d482
parenta733d08db251c5c12103a30dd9c3a28f2eb82509
[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

llvm-svn: 341082
15 files changed:
clang/lib/Driver/ToolChains/MSVC.cpp
compiler-rt/cmake/config-ix.cmake
compiler-rt/lib/fuzzer/FuzzerDefs.h
compiler-rt/lib/fuzzer/FuzzerIO.cpp
compiler-rt/lib/fuzzer/FuzzerIO.h
compiler-rt/lib/fuzzer/FuzzerIOPosix.cpp
compiler-rt/lib/fuzzer/FuzzerIOWindows.cpp
compiler-rt/lib/fuzzer/FuzzerTracePC.cpp
compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp
compiler-rt/lib/fuzzer/tests/CMakeLists.txt
compiler-rt/lib/fuzzer/tests/FuzzerUnittest.cpp
compiler-rt/lib/sanitizer_common/sanitizer_coverage_win_sections.cc
compiler-rt/test/CMakeLists.txt
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
llvm/test/Instrumentation/SanitizerCoverage/coff-pc-table-inline-8bit-counters.ll [new file with mode: 0644]