Skip to content

[LLDB] Allow specifying a custom exports file #68013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lldb/cmake/modules/LLDBConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ if(APPLE AND CMAKE_GENERATOR STREQUAL Xcode)
endif()

set(LLDB_EXPORT_ALL_SYMBOLS 0 CACHE BOOL
"Causes lldb to export all symbols when building liblldb.")
"Causes lldb to export some private symbols when building liblldb. See lldb/source/API/liblldb-private.exports for the full list of symbols that get exported.")

set(LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE "" CACHE PATH
"When `LLDB_EXPORT_ALL_SYMBOLS` is enabled, this specifies the exports file to use when building liblldb.")

if ((NOT MSVC) OR MSVC12)
add_definitions( -DHAVE_ROUND )
Expand Down
13 changes: 10 additions & 3 deletions lldb/source/API/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,18 @@ if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
# from working on some systems but limits the liblldb size.
MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb namespace")
add_llvm_symbol_exports(liblldb ${CMAKE_CURRENT_SOURCE_DIR}/liblldb.exports)
else()
# Don't use an explicit export. Instead, tell the linker to
# export all symbols.
elseif (NOT LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE)
# Don't use an explicit export. Instead, tell the linker to export all symbols.
MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb and lldb_private namespaces")
MESSAGE(WARNING "Private LLDB symbols frequently change and no API stability is guaranteed. "
"Only the SB API is guaranteed to be stable.")
add_llvm_symbol_exports(liblldb ${CMAKE_CURRENT_SOURCE_DIR}/liblldb-private.exports)
else ()
MESSAGE("-- Symbols (liblldb): exporting all symbols specified in the exports "
" file '${LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE}'")
MESSAGE(WARNING "Private LLDB symbols frequently change and no API stability is guaranteed. "
"Only the SB API is guaranteed to be stable.")
add_llvm_symbol_exports(liblldb "${LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE}")
endif()
set_target_properties(liblldb_exports PROPERTIES FOLDER "lldb misc")
elseif (LLDB_EXPORT_ALL_SYMBOLS)
Expand Down