]> granicus.if.org Git - llvm/commitdiff
llvm-isel-fuzzer: Weak function invoke the ire of PE/COFF
authorJustin Bogner <mail@justinbogner.com>
Fri, 1 Sep 2017 19:37:49 +0000 (19:37 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 1 Sep 2017 19:37:49 +0000 (19:37 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312354 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-isel-fuzzer/DummyISelFuzzer.cpp

index 929a63a541d5ffc95dbc9626afd74dae27abe3a7..89c1c81cdbe47496fdba4b0606ae312727b10280 100644 (file)
 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"