Skip to content

Commit 524758d

Browse files
Mariusz CeierMaskRay
authored andcommitted
[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 (cherry picked from commit 385f5c4)
1 parent 1e0f843 commit 524758d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ if(HAVE_LIBCOMPRESSION)
1515
set(LIBCOMPRESSION compression)
1616
endif()
1717

18+
if(LLVM_ENABLE_ZLIB)
19+
list(APPEND LLDB_SYSTEM_LIBS ZLIB::ZLIB)
20+
endif()
21+
1822
add_lldb_library(lldbPluginProcessGDBRemote PLUGIN
1923
GDBRemoteClientBase.cpp
2024
GDBRemoteCommunication.cpp
@@ -39,6 +43,7 @@ add_lldb_library(lldbPluginProcessGDBRemote PLUGIN
3943
lldbSymbol
4044
lldbTarget
4145
lldbUtility
46+
${LLDB_SYSTEM_LIBS}
4247
${LLDB_PLUGINS}
4348
${LIBCOMPRESSION}
4449
LINK_COMPONENTS

0 commit comments

Comments
 (0)