[clang] cab3fc5 - Fix linker error in clang-fuzzer following 89ea0b05207d45c145fb525df554b3b986ae379b.

Alexandre Ganea via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 18 07:07:49 PDT 2020


Author: Alexandre Ganea
Date: 2020-06-18T10:07:31-04:00
New Revision: cab3fc53d2e173243a462e9c8e914af58ddbeaba

URL: https://github.com/llvm/llvm-project/commit/cab3fc53d2e173243a462e9c8e914af58ddbeaba
DIFF: https://github.com/llvm/llvm-project/commit/cab3fc53d2e173243a462e9c8e914af58ddbeaba.diff

LOG: Fix linker error in clang-fuzzer following 89ea0b05207d45c145fb525df554b3b986ae379b.

This fixes:
tools/clang/tools/clang-fuzzer/handle-cxx/CMakeFiles/obj.clangHandleCXX.dir/handle_cxx.cpp.o:handle_cxx.cpp:function clang_fuzzer::HandleCXX(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*, std::vector<char const*, std::allocator<char const*> > const&): error: undefined reference to 'clang::tooling::newInvocation(clang::DiagnosticsEngine*, llvm::SmallVector<char const*, 16u> const&)'

Added: 
    

Modified: 
    clang/include/clang/Tooling/Tooling.h
    clang/tools/clang-fuzzer/handle-cxx/handle_cxx.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Tooling/Tooling.h b/clang/include/clang/Tooling/Tooling.h
index ced2405f6e83..4fb0c18be95e 100644
--- a/clang/include/clang/Tooling/Tooling.h
+++ b/clang/include/clang/Tooling/Tooling.h
@@ -505,7 +505,8 @@ void addTargetAndModeForProgramName(std::vector<std::string> &CommandLine,
 
 /// Creates a \c CompilerInvocation.
 CompilerInvocation *newInvocation(DiagnosticsEngine *Diagnostics,
-                                  const llvm::opt::ArgStringList &CC1Args);
+                                  const llvm::opt::ArgStringList &CC1Args,
+                                  const char *const BinaryName);
 
 } // namespace tooling
 

diff  --git a/clang/tools/clang-fuzzer/handle-cxx/handle_cxx.cpp b/clang/tools/clang-fuzzer/handle-cxx/handle_cxx.cpp
index 32d351f4c3e9..14204021d262 100644
--- a/clang/tools/clang-fuzzer/handle-cxx/handle_cxx.cpp
+++ b/clang/tools/clang-fuzzer/handle-cxx/handle_cxx.cpp
@@ -37,7 +37,7 @@ void clang_fuzzer::HandleCXX(const std::string &S,
       IntrusiveRefCntPtr<clang::DiagnosticIDs>(new DiagnosticIDs()), &*DiagOpts,
       &Diags, false);
   std::unique_ptr<clang::CompilerInvocation> Invocation(
-      tooling::newInvocation(&Diagnostics, CC1Args));
+      tooling::newInvocation(&Diagnostics, CC1Args, /*BinaryName=*/nullptr));
   std::unique_ptr<llvm::MemoryBuffer> Input =
       llvm::MemoryBuffer::getMemBuffer(S);
   Invocation->getPreprocessorOpts().addRemappedFile(FileName,


        


More information about the cfe-commits mailing list