diff options
author | Matt Morehouse <mascasa@google.com> | 2018-08-28 18:34:32 +0000 |
---|---|---|
committer | Matt Morehouse <mascasa@google.com> | 2018-08-28 18:34:32 +0000 |
commit | 5ca960adad7c824b1ee5567271beb4b29abe9a3d (patch) | |
tree | 34181d3704317cb5b8226660070af44ca4207c1a /lib/fuzzer/FuzzerUtilWindows.cpp | |
parent | d5d5b22249814bb4a2193509ed7ab33687507f98 (diff) | |
download | compiler-rt-5ca960adad7c824b1ee5567271beb4b29abe9a3d.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: morehouse, kcc, eraman
Differential Revision: https://reviews.llvm.org/D51022
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@340860 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/fuzzer/FuzzerUtilWindows.cpp')
-rw-r--r-- | lib/fuzzer/FuzzerUtilWindows.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/fuzzer/FuzzerUtilWindows.cpp b/lib/fuzzer/FuzzerUtilWindows.cpp index 8227e778e..257723b60 100644 --- a/lib/fuzzer/FuzzerUtilWindows.cpp +++ b/lib/fuzzer/FuzzerUtilWindows.cpp @@ -179,7 +179,9 @@ const void *SearchMemory(const void *Data, size_t DataLen, const void *Patt, } std::string DisassembleCmd(const std::string &FileName) { - if (ExecuteCommand("dumpbin /summary > nul") == 0) + Vector<std::string> command_vector; + command_vector.push_back("dumpbin /summary > nul"); + if (ExecuteCommand(Command(command_vector)) == 0) return "dumpbin /disasm " + FileName; Printf("libFuzzer: couldn't find tool to disassemble (dumpbin)\n"); exit(1); |