[Lldb-commits] [lldb] 385f5c4 - [lldb][CMake] Fix linking of gdb-remote when LLVM_ENABLE_ZLIB is ON
Fangrui Song via lldb-commits
lldb-commits at lists.llvm.org
Mon Feb 7 23:26:27 PST 2022
Author: Mariusz Ceier
Date: 2022-02-07T23:26:22-08:00
New Revision: 385f5c4d33799df25a85ceb54b6232499cb8a78d
URL: https://github.com/llvm/llvm-project/commit/385f5c4d33799df25a85ceb54b6232499cb8a78d
DIFF: https://github.com/llvm/llvm-project/commit/385f5c4d33799df25a85ceb54b6232499cb8a78d.diff
LOG: [lldb][CMake] Fix linking of gdb-remote when LLVM_ENABLE_ZLIB is ON
When LLVM_ENABLE_ZLIB is ON gdb-remote should link against ZLIB::ZLIB.
This fixes
```
/mnt/b/yoe/master/build/tmp/hosttools/ld: lib/liblldbPluginProcessGDBRemote.a(GDBRemoteCommunication.cpp.o): in function `lldb_private::process_gdb_remote::GDBRemoteCommunication::DecompressPacket() [clone .localalias]':
GDBRemoteCommunication.cpp:(.text._ZN12lldb_private18process_gdb_remote22GDBRemoteCommunication16DecompressPacketEv+0x59a): undefined reference to `inflateInit2_'
/mnt/b/yoe/master/build/tmp/hosttools/ld: GDBRemoteCommunication.cpp:(.text._ZN12lldb_private18process_gdb_remote22GDBRemoteCommunication16DecompressPacketEv+0x5af): undefined reference to `inflate'
```
Reviewed By: JDevlieghere, MaskRay
Differential Revision: https://reviews.llvm.org/D119186
Added:
Modified:
lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
Removed:
################################################################################
diff --git a/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt b/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
index 3a1a0e435ad25..e0c798187bd5b 100644
--- a/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
@@ -15,6 +15,10 @@ if(HAVE_LIBCOMPRESSION)
set(LIBCOMPRESSION compression)
endif()
+if(LLVM_ENABLE_ZLIB)
+ list(APPEND LLDB_SYSTEM_LIBS ZLIB::ZLIB)
+endif()
+
add_lldb_library(lldbPluginProcessGDBRemote PLUGIN
GDBRemoteClientBase.cpp
GDBRemoteCommunication.cpp
@@ -39,6 +43,7 @@ add_lldb_library(lldbPluginProcessGDBRemote PLUGIN
lldbSymbol
lldbTarget
lldbUtility
+ ${LLDB_SYSTEM_LIBS}
${LLDB_PLUGINS}
${LIBCOMPRESSION}
LINK_COMPONENTS
More information about the lldb-commits
mailing list