[llvm] r312354 - llvm-isel-fuzzer: Weak function invoke the ire of PE/COFF

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 1 12:37:49 PDT 2017


Author: bogner
Date: Fri Sep  1 12:37:49 2017
New Revision: 312354

URL: http://llvm.org/viewvc/llvm-project?rev=312354&view=rev
Log:
llvm-isel-fuzzer: Weak function invoke the ire of PE/COFF

It's non-trivial to use weak symbols in a cross platform way (See
sanitizer_win_defs.h in compiler-rt), and doing it naively like we
have here causes some build failures:

  http://lab.llvm.org:8011/builders/clang-with-thin-lto-windows/builds/1260

Instead of going down the rabbit hole of emulating weak symbols for
this very trivial dummy fuzzer driver, we can just rely on the fact
that we know which hooks any given fuzz target implements and forward
declare a normal symbol.

Modified:
    llvm/trunk/tools/llvm-isel-fuzzer/DummyISelFuzzer.cpp

Modified: llvm/trunk/tools/llvm-isel-fuzzer/DummyISelFuzzer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-isel-fuzzer/DummyISelFuzzer.cpp?rev=312354&r1=312353&r2=312354&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-isel-fuzzer/DummyISelFuzzer.cpp (original)
+++ llvm/trunk/tools/llvm-isel-fuzzer/DummyISelFuzzer.cpp Fri Sep  1 12:37:49 2017
@@ -20,10 +20,7 @@
 using namespace llvm;
 
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
-extern "C" LLVM_ATTRIBUTE_WEAK int LLVMFuzzerInitialize(int *argc,
-                                                        char ***argv) {
-  return 0;
-}
+extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv);
 
 int main(int argc, char *argv[]) {
   errs() << "*** This tool was not linked to libFuzzer.\n"




More information about the llvm-commits mailing list