When LLVM_ENABLE_ZLIB is ON gdb-remote should link with ZLIB::ZLIB.
Details
Details
- Reviewers
JDevlieghere mceier - Group Reviewers
Restricted Project - Commits
- rG385f5c4d3379: [lldb][CMake] Fix linking of gdb-remote when LLVM_ENABLE_ZLIB is ON
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
We should add this to LLDB_SYSTEM_LIBS like we do in lldb/source/Host/CMakeLists.txt and include ${LLDB_SYSTEM_LIBS} for lldbPluginProcessGDBRemote.
Comment Actions
Basically it should mirror what we have for LZMA:
if (LLDB_ENABLE_LZMA) list(APPEND EXTRA_LIBS ${LIBLZMA_LIBRARIES}) endif()
Comment Actions
So should I add:
if(LLVM_ENABLE_ZLIB) list(APPEND LLDB_SYSTEM_LIBS ZLIB::ZLIB) endif()
to lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt or do you have different CMakeLists.txt file in mind ?
Comment Actions
Yup that's fine. I think at some point we'll want to centralize all these dependencies somewhere higher up and have it shared by the different targets, but that's definitely for a separate patch.
Comment Actions
Debian is still broken with this patch on -14:
lib/liblldbPluginProcessGDBRemote.a(GDBRemoteCommunication.cpp.o):GDBRemoteCommunication.cpp:function lldb_private::process_gdb_remote::GDBRemoteCommunication::DecompressPacket(): error: undefined reference to 'inflateInit2_' lib/liblldbPluginProcessGDBRemote.a(GDBRemoteCommunication.cpp.o):GDBRemoteCommunication.cpp:function lldb_private::process_gdb_remote::GDBRemoteCommunication::DecompressPacket(): error: undefined reference to 'inflate' lib/liblldbPluginProcessGDBRemote.a(GDBRemoteCommunication.cpp.o):GDBRemoteCommunication.cpp:function lldb_private::process_gdb_remote::GDBRemoteCommunication::DecompressPacket(): error: undefined reference to 'inflateEnd'
Comment Actions
I downloaded build artifacts and it doesn't seem this patch was applied in this build. I grepped for ZLIB::ZLIB and only lld had it.