Skip to content

Commit 8750239

Browse files
authored
[lldb][windows] Allow exporting plugin symbols in LLDB_EXPORT_ALL_SYMBOLS (#71087)
Plugins aren't exported by default in the msvc path because we explicitly limit the symbols exported to prevent hitting the symbol export limit. Some plugins, however, can still be useful for downstream projects to build on, e.g. the Mojo language uses parts of the dwarf plugin to implement dwarf handling within its debugger plugin. This PR adds a cmake variable in the MSVC path, LLDB_EXPORT_ALL_SYMBOLS_PLUGINS, that allows for providing the set of plugins to export symbols from.
1 parent 95e11a9 commit 8750239

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

lldb/cmake/modules/LLDBConfig.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ set(LLDB_EXPORT_ALL_SYMBOLS 0 CACHE BOOL
128128
set(LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE "" CACHE PATH
129129
"When `LLDB_EXPORT_ALL_SYMBOLS` is enabled, this specifies the exports file to use when building liblldb.")
130130

131+
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
132+
set(LLDB_EXPORT_ALL_SYMBOLS_PLUGINS "" CACHE STRING
133+
"When `LLDB_EXPORT_ALL_SYMBOLS` is enabled, this specifies the plugins whose symbols should be exported.")
134+
endif()
135+
131136
if ((NOT MSVC) OR MSVC12)
132137
add_definitions( -DHAVE_ROUND )
133138
endif()

lldb/source/API/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,15 @@ elseif (LLDB_EXPORT_ALL_SYMBOLS)
196196
MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb and lldb_private namespaces")
197197

198198
# Pull out the various lldb libraries linked into liblldb, these will be used
199-
# when looking for symbols to extract. We ignore plugin libraries here,
200-
# because these symbols aren't publicly exposed.
199+
# when looking for symbols to extract. We ignore most plugin libraries here,
200+
# because we may expose more symbols than the DLL limit and these symbols
201+
# aren't useful to expose.
201202
get_target_property(all_liblldb_libs liblldb LINK_LIBRARIES)
202203
set(lldb_libs "")
203204
foreach(lib ${all_liblldb_libs})
204205
if(TARGET ${lib} AND ${lib} MATCHES "^lldb" AND
205-
NOT ${lib} MATCHES "^lldbPlugin")
206+
(${lib} IN_LIST LLDB_EXPORT_ALL_SYMBOLS_PLUGINS OR
207+
NOT ${lib} MATCHES "^lldbPlugin"))
206208
get_target_property(lib_type ${lib} TYPE)
207209
if("${lib_type}" STREQUAL "STATIC_LIBRARY")
208210
list(APPEND lldb_libs ${lib})

0 commit comments

Comments
 (0)