aboutsummaryrefslogtreecommitdiff
path: root/compiler-rt/lib/fuzzer/FuzzerDriver.cpp
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2020-07-17 18:29:47 -0700
committerVitaly Buka <vitalybuka@google.com>2020-07-17 18:29:47 -0700
commitc12f11184682c55e10922665cea628332eb158eb (patch)
tree44490a33ddc54c7a3dca6ec5ed09ab3e9f416e5b /compiler-rt/lib/fuzzer/FuzzerDriver.cpp
parent7c2f2762695896aee5d3c5ebb3943f1a28a5ed3b (diff)
downloadllvm-c12f11184682c55e10922665cea628332eb158eb.zip
llvm-c12f11184682c55e10922665cea628332eb158eb.tar.gz
llvm-c12f11184682c55e10922665cea628332eb158eb.tar.bz2
Corrected __libfuzzer_is_present symbol inclusion for MSVC x86 32-bit
The incorrect symbol will cause linking failures for 32-bit targets: clang_rt.fuzzer-i386.lib(FuzzerDriver.obj) : error LNK2001: unresolved external symbol __libfuzzer_is_present Verified no longer fails to link with this change for 32-bit and still succeeds for 64-bit MSVC. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D83594
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerDriver.cpp')
-rw-r--r--compiler-rt/lib/fuzzer/FuzzerDriver.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerDriver.cpp b/compiler-rt/lib/fuzzer/FuzzerDriver.cpp
index a847c76..00a33a4 100644
--- a/compiler-rt/lib/fuzzer/FuzzerDriver.cpp
+++ b/compiler-rt/lib/fuzzer/FuzzerDriver.cpp
@@ -33,7 +33,11 @@
// binary can test for its existence.
#if LIBFUZZER_MSVC
extern "C" void __libfuzzer_is_present() {}
+#if defined(_M_IX86) || defined(__i386__)
+#pragma comment(linker, "/include:___libfuzzer_is_present")
+#else
#pragma comment(linker, "/include:__libfuzzer_is_present")
+#endif
#else
extern "C" __attribute__((used)) void __libfuzzer_is_present() {}
#endif // LIBFUZZER_MSVC