diff options
-rw-r--r-- | compiler-rt/lib/fuzzer/CMakeLists.txt | 2 | ||||
-rw-r--r-- | compiler-rt/lib/fuzzer/FuzzerExtFunctionsDlsymWin.cpp | 62 | ||||
-rw-r--r-- | compiler-rt/test/fuzzer/bogus-initialize.test | 2 | ||||
-rw-r--r-- | compiler-rt/test/fuzzer/fuzzer-customcrossover.test | 2 | ||||
-rw-r--r-- | compiler-rt/test/fuzzer/fuzzer-custommutator.test | 2 | ||||
-rw-r--r-- | compiler-rt/test/fuzzer/fuzzer-flags.test | 3 | ||||
-rw-r--r-- | compiler-rt/test/fuzzer/initialize.test | 2 | ||||
-rw-r--r-- | compiler-rt/test/fuzzer/standalone.test | 2 |
8 files changed, 1 insertions, 76 deletions
diff --git a/compiler-rt/lib/fuzzer/CMakeLists.txt b/compiler-rt/lib/fuzzer/CMakeLists.txt index 679318e460b..aae3df8dbf8 100644 --- a/compiler-rt/lib/fuzzer/CMakeLists.txt +++ b/compiler-rt/lib/fuzzer/CMakeLists.txt @@ -3,7 +3,7 @@ set(LIBFUZZER_SOURCES FuzzerDataFlowTrace.cpp FuzzerDriver.cpp FuzzerExtFunctionsDlsym.cpp - FuzzerExtFunctionsDlsymWin.cpp + FuzzerExtFunctionsWeakAlias.cpp FuzzerExtFunctionsWeak.cpp FuzzerExtraCounters.cpp FuzzerIO.cpp diff --git a/compiler-rt/lib/fuzzer/FuzzerExtFunctionsDlsymWin.cpp b/compiler-rt/lib/fuzzer/FuzzerExtFunctionsDlsymWin.cpp deleted file mode 100644 index e09da3fdeee..00000000000 --- a/compiler-rt/lib/fuzzer/FuzzerExtFunctionsDlsymWin.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//===- FuzzerExtFunctionsDlsymWin.cpp - Interface to external functions ---===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Implementation using dynamic loading for Windows. -//===----------------------------------------------------------------------===// -#include "FuzzerDefs.h" -#if LIBFUZZER_WINDOWS - -#include "FuzzerExtFunctions.h" -#include "FuzzerIO.h" -#include <windows.h> - -// This must be included after Windows.h. -#include <psapi.h> - -namespace fuzzer { - -ExternalFunctions::ExternalFunctions() { - HMODULE Modules[1024]; - DWORD BytesNeeded; - HANDLE CurrentProcess = GetCurrentProcess(); - - if (!EnumProcessModules(CurrentProcess, Modules, sizeof(Modules), - &BytesNeeded)) { - Printf("EnumProcessModules failed (error: %d).\n", GetLastError()); - exit(1); - } - - if (sizeof(Modules) < BytesNeeded) { - Printf("Error: the array is not big enough to hold all loaded modules.\n"); - exit(1); - } - - for (size_t i = 0; i < (BytesNeeded / sizeof(HMODULE)); i++) - { - FARPROC Fn; -#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \ - if (this->NAME == nullptr) { \ - Fn = GetProcAddress(Modules[i], #NAME); \ - if (Fn == nullptr) \ - Fn = GetProcAddress(Modules[i], #NAME "__dll"); \ - this->NAME = (decltype(ExternalFunctions::NAME)) Fn; \ - } -#include "FuzzerExtFunctions.def" -#undef EXT_FUNC - } - -#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \ - if (this->NAME == nullptr && WARN) \ - Printf("WARNING: Failed to find function \"%s\".\n", #NAME); -#include "FuzzerExtFunctions.def" -#undef EXT_FUNC -} - -} // namespace fuzzer - -#endif // LIBFUZZER_WINDOWS diff --git a/compiler-rt/test/fuzzer/bogus-initialize.test b/compiler-rt/test/fuzzer/bogus-initialize.test index 69cebb614ec..2dff2d5a263 100644 --- a/compiler-rt/test/fuzzer/bogus-initialize.test +++ b/compiler-rt/test/fuzzer/bogus-initialize.test @@ -1,5 +1,3 @@ -# FIXME: Disabled on Windows since LLVMFuzzerInitialize does not yet work. -UNSUPPORTED: windows RUN: %cpp_compiler %S/BogusInitializeTest.cpp -o %t-BogusInitializeTest RUN: not %run %t-BogusInitializeTest 2>&1 | FileCheck %s --check-prefix=BOGUS_INITIALIZE diff --git a/compiler-rt/test/fuzzer/fuzzer-customcrossover.test b/compiler-rt/test/fuzzer/fuzzer-customcrossover.test index ce84f133cb4..0835081f289 100644 --- a/compiler-rt/test/fuzzer/fuzzer-customcrossover.test +++ b/compiler-rt/test/fuzzer/fuzzer-customcrossover.test @@ -1,5 +1,3 @@ -# FIXME: Disabled on Windows since LLVMFuzzerCustomCrossOver does not yet work. -UNSUPPORTED: windows RUN: %cpp_compiler %S/CustomCrossOverTest.cpp -o %t-CustomCrossOverTest RUN: not %run %t-CustomCrossOverTest -seed=1 -runs=1000000 2>&1 | FileCheck %s --check-prefix=CHECK_CO diff --git a/compiler-rt/test/fuzzer/fuzzer-custommutator.test b/compiler-rt/test/fuzzer/fuzzer-custommutator.test index 5c47ff9ce5d..51aef2373cc 100644 --- a/compiler-rt/test/fuzzer/fuzzer-custommutator.test +++ b/compiler-rt/test/fuzzer/fuzzer-custommutator.test @@ -1,5 +1,3 @@ -# FIXME: Disabled on Windows since LLVMFuzzerCustomMutator does not yet work. -UNSUPPORTED: windows RUN: %cpp_compiler %S/CustomMutatorTest.cpp -o %t-CustomMutatorTest RUN: not %run %t-CustomMutatorTest 2>&1 | FileCheck %s --check-prefix=LLVMFuzzerCustomMutator LLVMFuzzerCustomMutator: In LLVMFuzzerCustomMutator diff --git a/compiler-rt/test/fuzzer/fuzzer-flags.test b/compiler-rt/test/fuzzer/fuzzer-flags.test index 340e0b07cee..65ed77baa53 100644 --- a/compiler-rt/test/fuzzer/fuzzer-flags.test +++ b/compiler-rt/test/fuzzer/fuzzer-flags.test @@ -1,6 +1,3 @@ -# FIXME: Disabled on Windows since LLVMFuzzerInitialize does not yet work. -UNSUPPORTED: windows -RUN: %cpp_compiler %S/FlagsTest.cpp -o %t-FlagsTest RUN: %run %t-FlagsTest -runs=10 -foo_bar=1 2>&1 | FileCheck %s --check-prefix=FOO_BAR FOO_BAR: WARNING: unrecognized flag '-foo_bar=1'; use -help=1 to list all flags FOO_BAR: BINGO diff --git a/compiler-rt/test/fuzzer/initialize.test b/compiler-rt/test/fuzzer/initialize.test index 217743bd265..dc6e8697558 100644 --- a/compiler-rt/test/fuzzer/initialize.test +++ b/compiler-rt/test/fuzzer/initialize.test @@ -1,5 +1,3 @@ -# FIXME: Disabled on Windows since LLVMFuzzerInitialize does not yet work. -UNSUPPORTED: windows CHECK: BINGO RUN: %cpp_compiler %S/InitializeTest.cpp -o %t-InitializeTest RUN: not %run %t-InitializeTest -use_value_profile=1 2>&1 | FileCheck %s diff --git a/compiler-rt/test/fuzzer/standalone.test b/compiler-rt/test/fuzzer/standalone.test index da7cf1eb7ef..cd2422e4e68 100644 --- a/compiler-rt/test/fuzzer/standalone.test +++ b/compiler-rt/test/fuzzer/standalone.test @@ -1,5 +1,3 @@ -# FIXME: Disabled on Windows because memmem is a GNU extension. -UNSUPPORTED: windows RUN: %no_fuzzer_c_compiler %libfuzzer_src/standalone/StandaloneFuzzTargetMain.c -c -o %t_1.o RUN: %no_fuzzer_cpp_compiler %S/InitializeTest.cpp -c -o %t_2.o |