[Lldb-commits] [lldb] [lldb] Add Options to LINK_COMPONENTS (PR #225684)

via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 23 03:59:58 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Krzysztof Parzyszek (kparzysz)

<details>
<summary>Changes</summary>

This fixes shared library build of lldb:
```
/usr/bin/ld: lib/liblldbPluginPlatformMacOSX.a(PlatformDarwin.cpp.o): undefined reference to symbol '_ZNK4llvm3opt8OptTable9getOptionENS0_12OptSpecifierE'
/usr/bin/ld: /work/kparzysz/git/llvm.org/b/x86/lib/libLLVMOption.so.24.0git: error adding symbols: DSO missing from command line
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
```

And several other cases in unittests.

---
Full diff: https://github.com/llvm/llvm-project/pull/225684.diff


9 Files Affected:

- (modified) lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt (+1) 
- (modified) lldb/unittests/Callback/CMakeLists.txt (+1) 
- (modified) lldb/unittests/Core/CMakeLists.txt (+1) 
- (modified) lldb/unittests/Interpreter/CMakeLists.txt (+2) 
- (modified) lldb/unittests/Platform/CMakeLists.txt (+1) 
- (modified) lldb/unittests/Process/CMakeLists.txt (+2) 
- (modified) lldb/unittests/Process/gdb-remote/CMakeLists.txt (+1) 
- (modified) lldb/unittests/Protocol/CMakeLists.txt (+1) 
- (modified) lldb/unittests/Target/CMakeLists.txt (+1) 


``````````diff
diff --git a/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt b/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
index 9f98795edfd5e5..5b4b20f5c5c18a 100644
--- a/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ b/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -42,6 +42,7 @@ add_lldb_library(lldbPluginPlatformMacOSX PLUGIN
   ${PLUGIN_PLATFORM_MACOSX_SOURCES}
 
   LINK_COMPONENTS
+    Option
     Support
     TargetParser
   LINK_LIBS
diff --git a/lldb/unittests/Callback/CMakeLists.txt b/lldb/unittests/Callback/CMakeLists.txt
index e528663ffa5177..19259eb79d78d9 100644
--- a/lldb/unittests/Callback/CMakeLists.txt
+++ b/lldb/unittests/Callback/CMakeLists.txt
@@ -2,6 +2,7 @@ add_lldb_unittest(LLDBCallbackTests
   TestBreakpointSetCallback.cpp
 
   LINK_COMPONENTS
+    Option
     Support
   LINK_LIBS
     lldbBreakpoint
diff --git a/lldb/unittests/Core/CMakeLists.txt b/lldb/unittests/Core/CMakeLists.txt
index 959793d7d4de03..041a37432288ad 100644
--- a/lldb/unittests/Core/CMakeLists.txt
+++ b/lldb/unittests/Core/CMakeLists.txt
@@ -21,6 +21,7 @@ add_lldb_unittest(LLDBCoreTests
   Value.cpp
 
   LINK_COMPONENTS
+    Option
     Support
     Telemetry
   LINK_LIBS
diff --git a/lldb/unittests/Interpreter/CMakeLists.txt b/lldb/unittests/Interpreter/CMakeLists.txt
index 80308b48b806fc..06cd559f323720 100644
--- a/lldb/unittests/Interpreter/CMakeLists.txt
+++ b/lldb/unittests/Interpreter/CMakeLists.txt
@@ -9,6 +9,8 @@ add_lldb_unittest(InterpreterTests
   TestRegexCommand.cpp
   TestScriptedInterface.cpp
 
+  LINK_COMPONENTS
+      Option
   LINK_LIBS
       lldbCommands
       lldbCore
diff --git a/lldb/unittests/Platform/CMakeLists.txt b/lldb/unittests/Platform/CMakeLists.txt
index f08d48ddfc203d..8902688c79c906 100644
--- a/lldb/unittests/Platform/CMakeLists.txt
+++ b/lldb/unittests/Platform/CMakeLists.txt
@@ -9,6 +9,7 @@ add_lldb_unittest(LLDBPlatformTests
   PlatformWasmTest.cpp
 
   LINK_COMPONENTS
+    Option
     Support
   LINK_LIBS
     lldbPluginPlatformEmscripten
diff --git a/lldb/unittests/Process/CMakeLists.txt b/lldb/unittests/Process/CMakeLists.txt
index 939fb9f741c688..da997e1073e909 100644
--- a/lldb/unittests/Process/CMakeLists.txt
+++ b/lldb/unittests/Process/CMakeLists.txt
@@ -14,6 +14,8 @@ add_lldb_unittest(ProcessTests
   ProcessEventDataTest.cpp
   ProcessTraceTest.cpp
 
+  LINK_COMPONENTS
+      Option
   LINK_LIBS
       lldbCore
       lldbHost
diff --git a/lldb/unittests/Process/gdb-remote/CMakeLists.txt b/lldb/unittests/Process/gdb-remote/CMakeLists.txt
index 95c79c699f108d..133bf6e769232f 100644
--- a/lldb/unittests/Process/gdb-remote/CMakeLists.txt
+++ b/lldb/unittests/Process/gdb-remote/CMakeLists.txt
@@ -8,6 +8,7 @@ add_lldb_unittest(ProcessGdbRemoteTests
   ProcessGDBRemoteTest.cpp
 
   LINK_COMPONENTS
+    Option
     Support
   LINK_LIBS
     lldbCore
diff --git a/lldb/unittests/Protocol/CMakeLists.txt b/lldb/unittests/Protocol/CMakeLists.txt
index 1e9b02d7355441..5aecb03f2c0a59 100644
--- a/lldb/unittests/Protocol/CMakeLists.txt
+++ b/lldb/unittests/Protocol/CMakeLists.txt
@@ -8,6 +8,7 @@ add_lldb_unittest(ProtocolTests
   ProtocolMCPServerTest.cpp
 
   LINK_COMPONENTS
+    Option
     Support
   LINK_LIBS
     lldbCore
diff --git a/lldb/unittests/Target/CMakeLists.txt b/lldb/unittests/Target/CMakeLists.txt
index c4fbaa37c46005..1e8721b56261e8 100644
--- a/lldb/unittests/Target/CMakeLists.txt
+++ b/lldb/unittests/Target/CMakeLists.txt
@@ -21,6 +21,7 @@ add_lldb_unittest(TargetTests
   FindFileTest.cpp
 
   LINK_COMPONENTS
+      Option
       Support
   LINK_LIBS
       lldbCore

``````````

</details>


https://github.com/llvm/llvm-project/pull/225684


More information about the lldb-commits mailing list