[PATCH] D108662: [X86] Add explicit library dependency on LLVMInstrumentation

Min-Yih Hsu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 24 13:46:04 PDT 2021


myhsu created this revision.
myhsu added reviewers: kstoimenov, vitalybuka.
Herald added subscribers: pengfei, hiraditya, mgorny.
myhsu requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Patch 9588b685c6b2 <https://reviews.llvm.org/rG9588b685c6b2d90e4b6dd68e02e6a44affd77c3f> introduced dependency on ASAN. But it didn't explicitly put LLVMInstrumentation as one of the library dependencies such that the build will fail if we're building LLVM as shared libraries (i.e. `-DBUILD_SHARED_LIBS=ON`). Here are the error messages:

  ld.lld: error: undefined symbol: llvm::ASanAccessInfo::ASanAccessInfo(int)
  >>> referenced by X86MCInstLower.cpp:1337 (/home/rem/repos/llvm-project/llvm/lib/Target/X86/X86MCInstLower.cpp:1337)
  >>>               lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86MCInstLower.cpp.o:(llvm::X86AsmPrinter::LowerASAN_CHECK_MEMACCESS(llvm::MachineInstr const&))
  >>> referenced by X86MCInstLower.cpp:1555 (/home/rem/repos/llvm-project/llvm/lib/Target/X86/X86MCInstLower.cpp:1555)
  >>>               lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86MCInstLower.cpp.o:(llvm::X86AsmPrinter::emitAsanMemaccessSymbols(llvm::Module&))
  
  ld.lld: error: undefined symbol: llvm::getAddressSanitizerParams(llvm::Triple const&, int, bool, unsigned long*, int*, bool*)
  >>> referenced by X86MCInstLower.cpp:1363 (/home/rem/repos/llvm-project/llvm/lib/Target/X86/X86MCInstLower.cpp:1363)
  >>>               lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86MCInstLower.cpp.o:(llvm::X86AsmPrinter::emitAsanMemaccessPartial(llvm::Module&, unsigned int, llvm::ASanAccessInfo const&, llvm::MCSubtargetInfo&))
  >>> referenced by X86MCInstLower.cpp:1464 (/home/rem/repos/llvm-project/llvm/lib/Target/X86/X86MCInstLower.cpp:1464)
  >>>               lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86MCInstLower.cpp.o:(llvm::X86AsmPrinter::emitAsanMemaccessFull(llvm::Module&, unsigned int, llvm::ASanAccessInfo const&, llvm::MCSubtargetInfo&))

This patch explicitly links X86CodeGen against the `Instrumentation` component.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108662

Files:
  llvm/lib/Target/X86/CMakeLists.txt


Index: llvm/lib/Target/X86/CMakeLists.txt
===================================================================
--- llvm/lib/Target/X86/CMakeLists.txt
+++ llvm/lib/Target/X86/CMakeLists.txt
@@ -91,6 +91,7 @@
   AsmPrinter
   CodeGen
   Core
+  Instrumentation
   MC
   SelectionDAG
   Support


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108662.368443.patch
Type: text/x-patch
Size: 291 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210824/7a6c1cdf/attachment.bin>


More information about the llvm-commits mailing list