[Lldb-commits] [lldb] a5a13ca - [lldb-dap] Make lldbDAP an OBJECT library (NFC) (#196108)
via lldb-commits
lldb-commits at lists.llvm.org
Wed May 6 11:00:23 PDT 2026
Author: Jonas Devlieghere
Date: 2026-05-06T11:00:18-07:00
New Revision: a5a13ca29186355407bfa6de913db6b7018d60df
URL: https://github.com/llvm/llvm-project/commit/a5a13ca29186355407bfa6de913db6b7018d60df
DIFF: https://github.com/llvm/llvm-project/commit/a5a13ca29186355407bfa6de913db6b7018d60df.diff
LOG: [lldb-dap] Make lldbDAP an OBJECT library (NFC) (#196108)
Convert lldbDAP from a static library to an OBJECT library and move its
LINK_COMPONENTS (Option, Support) and LINK_LIBS (liblldb, lldbHost) to
its consumers (the lldb-dap tool and the DAPTests unit test).
This avoids transitive propagation of LLVM's static components through
lldbDAP, which would otherwise collide with the same symbols re-exported
by liblldb when LLDB_EXPORT_ALL_SYMBOLS is enabled, breaking
llvm::Error's RTTI (e.g. ErrorInfoBase::ID) across library boundaries.
Extracted from #189718 for easier reviewing.
Added:
Modified:
lldb/tools/lldb-dap/CMakeLists.txt
lldb/tools/lldb-dap/tool/CMakeLists.txt
lldb/unittests/DAP/CMakeLists.txt
Removed:
################################################################################
diff --git a/lldb/tools/lldb-dap/CMakeLists.txt b/lldb/tools/lldb-dap/CMakeLists.txt
index 1bb7a2e498b9b..1a8f167ef0a42 100644
--- a/lldb/tools/lldb-dap/CMakeLists.txt
+++ b/lldb/tools/lldb-dap/CMakeLists.txt
@@ -1,8 +1,10 @@
-# We need to include the llvm components we depend on manually, as liblldb does
-# not re-export those.
-set(LLVM_LINK_COMPONENTS Support)
-
-add_lldb_library(lldbDAP
+# lldbDAP is an OBJECT library: a collection of compiled object files that is
+# shared between the lldb-dap tool and the DAPTests unit test, with no declared
+# link dependencies of its own. Each consumer lists its own LINK_LIBS and
+# LINK_COMPONENTS, avoiding transitive propagation of static LLVM components
+# that would collide with symbols re-exported by liblldb when
+# LLDB_EXPORT_ALL_SYMBOLS is ON.
+add_lldb_library(lldbDAP OBJECT
Breakpoint.cpp
BreakpointBase.cpp
ClientLauncher.cpp
@@ -73,13 +75,6 @@ add_lldb_library(lldbDAP
Protocol/ProtocolEvents.cpp
Protocol/ProtocolTypes.cpp
Protocol/ProtocolRequests.cpp
-
- LINK_COMPONENTS
- Option
- Support
- LINK_LIBS
- liblldb
- lldbHost
)
target_include_directories(lldbDAP
diff --git a/lldb/tools/lldb-dap/tool/CMakeLists.txt b/lldb/tools/lldb-dap/tool/CMakeLists.txt
index 2216e54064bf3..fbd3cf0cd4377 100644
--- a/lldb/tools/lldb-dap/tool/CMakeLists.txt
+++ b/lldb/tools/lldb-dap/tool/CMakeLists.txt
@@ -2,16 +2,18 @@ set(LLVM_TARGET_DEFINITIONS Options.td)
tablegen(LLVM Options.inc -gen-opt-parser-defs)
add_public_tablegen_target(LLDBDAPOptionsTableGen)
-set(LLDB_DAP_LINK_LIBS lldbDAP)
+set(LLDB_DAP_LINK_LIBS lldbDAP liblldb lldbHost)
if(WIN32)
list(APPEND LLDB_DAP_LINK_LIBS lldbHostPythonPathSetup)
- list(APPEND LLDB_DAP_LINK_LIBS liblldb)
endif()
add_lldb_tool(lldb-dap
lldb-dap.cpp
+ LINK_COMPONENTS
+ Option
+ Support
LINK_LIBS
${LLDB_DAP_LINK_LIBS}
)
diff --git a/lldb/unittests/DAP/CMakeLists.txt b/lldb/unittests/DAP/CMakeLists.txt
index 53e0fde5687ec..c6a2a0a9675d2 100644
--- a/lldb/unittests/DAP/CMakeLists.txt
+++ b/lldb/unittests/DAP/CMakeLists.txt
@@ -22,11 +22,14 @@ add_lldb_unittest(DAPTests
LINK_COMPONENTS
Support
+
LINK_LIBS
- liblldb
lldbDAP
+ lldbHost
+ lldbUtility
lldbUtilityHelpers
LLVMTestingSupport
+ liblldb
)
set(test_inputs
More information about the lldb-commits
mailing list