-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
[LLDB] Allow specifying a custom exports file #68013
Conversation
@llvm/pr-subscribers-lldb ChangesLLDB has the cmake flag This adds the new cmake flag This is a follow up of #67851 Full diff: https://github.com/llvm/llvm-project/pull/68013.diff 2 Files Affected:
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index 380016ce48015fa..264eed1ad82012f 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -125,6 +125,9 @@ endif()
set(LLDB_EXPORT_ALL_SYMBOLS 0 CACHE BOOL
"Causes lldb to export all symbols when building liblldb.")
+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 )
endif()
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index 7cfa3aaafdae188..45e3b7a91034006 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -177,11 +177,15 @@ 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()
+ 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")
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}'")
+ 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)
|
Personally I have no qualms about this. It's just an option that lets you choose which symbols to export. We already allow exporting every symbol, why not just some of them? I would be careful though, since we don't guarantee any stability for lldb_private (including things from plugins) relying on this could come back to bite you. |
I think we need to make it clear wherever in the build system that the knob for turning on these exports lives that you use these symbols at your own risk, and we guarantee NO ABI stability for anything but the SB API's. We know that on this list but somebody getting the sources might think this was a supported configuration and be sad further down the line.
Jim
… On Oct 4, 2023, at 2:43 PM, Alex Langford ***@***.***> wrote:
Personally I have no qualms about this. It's just an option that lets you choose which symbols to export. We already allow exporting every symbol, why not just some of them? I would be careful though, since we don't guarantee any stability for lldb_private (including things from plugins) relying on this could come back to bite you.
—
Reply to this email directly, view it on GitHub <#68013 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADUPVWZPJKB4IDSCHUJY5QDX5XJ65AVCNFSM6AAAAAA5PZHAVSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBXGY4DGOJQGQ>.
You are receiving this because you are on a team that was mentioned.
|
In that case, maybe we should emit a CMake warning instead of just an info message? |
That sounds appropriate to me.
Jim
… On Oct 4, 2023, at 3:03 PM, Alex Langford ***@***.***> wrote:
I think we need to make it clear wherever in the build system that the knob for turning on these exports lives that you use these symbols at your own risk, and we guarantee NO ABI stability for anything but the SB API's. We know that on this list but somebody getting the sources might think this was a supported configuration and be sad further down the line. Jim
In that case, maybe we should emit a CMake warning instead of just an info message?
—
Reply to this email directly, view it on GitHub <#68013 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADUPVWYL7ICSNC3FRQ6FLUTX5XMLHAVCNFSM6AAAAAA5PZHAVSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBXG4YDSMBSGI>.
You are receiving this because you are on a team that was mentioned.
|
I'll add the warning as you guys mention. That'll set clear expectations on what users will be getting. Besides that, @bulbazord , the current symbols getting exported by |
4abd947
to
d557ea5
Compare
LLDB has the cmake flag `LLDB_EXPORT_ALL_SYMBOLS` that exports the lldb, lldb_private namespaces, as well as other symbols like python and lua (see `third-party/llvm-project/lldb/source/API/liblldb-private.exports`). However, not all symbols in lldb fall into these categories and in order to get access to some symbols that live in plugin folders (like dwarf parsing symbols), it's useful to be able to specify a custom exports file giving more control to the developer using lldb as a library. This adds the new cmake flag `LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE` that is used when `LLDB_EXPORT_ALL_SYMBOLS` is enabled to specify that custom exports file. This is a follow up of llvm#67851
d557ea5
to
a472a16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warnings look good to me, thanks for taking care of that.
How does this look @jimingham?
LGTM |
Thanks! |
LLDB has the cmake flag
LLDB_EXPORT_ALL_SYMBOLS
that exports the lldb, lldb_private namespaces, as well as other symbols like python and lua (seelldb/source/API/liblldb-private.exports
). However, not all symbols in lldb fall into these categories and in order to get access to some symbols that live in plugin folders (like dwarf parsing symbols), it's useful to be able to specify a custom exports file giving more control to the developer using lldb as a library.This adds the new cmake flag
LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE
that is used whenLLDB_EXPORT_ALL_SYMBOLS
is enabled to specify that custom exports file.This is a follow up of #67851