[Lldb-commits] [PATCH] D67885: [LLDB] Add a missing specification of linking against dbghelp

Martin Storsjö via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Sep 21 14:23:39 PDT 2019


mstorsjo created this revision.
mstorsjo added reviewers: amccarth, compnerd, hhb.
Herald added subscribers: JDevlieghere, abidh, mgorny.
Herald added a project: LLDB.

The PECOFF object file plugin uses the dbghelp API, but doesn't specify that it has to be linked in anywhere.

Current MSVC based builds have probably succeeded, as other parts in LLDB have had a "#pragma comment(lib, "dbghelp.lib")", but there's currently no such pragma in the PECOFF plugin.

The "#pragma comment(lib, ...)" approach doesn't work in MinGW mode (unless the compiler is given the -fms-extensions option, and even then, it's only supported by clang/lld, not by GCC/binutils), thus add it to be linked via CMake. (The other parts of LLDB that use dbghelp are within _MSC_VER ifdefs.)


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D67885

Files:
  lldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt


Index: lldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt
+++ lldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt
@@ -1,3 +1,9 @@
+if(WIN32)
+  set(DBGHELP_LINK_FILES dbghelp)
+else()
+  set(DBGHELP_LINK_FILES "")
+endif()
+
 add_lldb_library(lldbPluginObjectFilePECOFF PLUGIN
   ObjectFilePECOFF.cpp
   WindowsMiniDump.cpp
@@ -7,6 +13,7 @@
     lldbHost
     lldbSymbol
     lldbTarget
+    ${DBGHELP_LINK_FILES}
   LINK_COMPONENTS
     BinaryFormat
     Support


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67885.221199.patch
Type: text/x-patch
Size: 592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190921/02806020/attachment.bin>


More information about the lldb-commits mailing list