Skip to content

Prevent SVD2LLDB plugin init symbol from being stripped in release builds#181

Merged
rauhul merged 2 commits intoapple:mainfrom
iCMDdev:patch-1
Feb 11, 2026
Merged

Prevent SVD2LLDB plugin init symbol from being stripped in release builds#181
rauhul merged 2 commits intoapple:mainfrom
iCMDdev:patch-1

Conversation

@iCMDdev
Copy link
Contributor

@iCMDdev iCMDdev commented Jan 24, 2026

In SVD2LLDB release builds, there is no symbol for LLDB's entry point. Thus, loading the plugin fails with the following error:

(lldb) plugin load .build/release/libSVD2LLDB.dylib
error: plug-in is missing the required initialization: lldb::PluginInitialize(lldb::SBDebugger)

This PR adds @_used and public to the LLDB plugin entrypoint pluginInitialize (lldb::PluginInitialize(lldb::SBDebugger)), so the function is retained and exported for release builds as well.

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary (no changes required)

Add `@_used` to the LLDB plugin entrypoint `lldb::PluginInitialize`, so the symbol is retained and exported in release builds.
@iCMDdev iCMDdev requested a review from rauhul as a code owner January 24, 2026 17:22
@iCMDdev
Copy link
Contributor Author

iCMDdev commented Jan 24, 2026

Note: it seems to work without @_used as well.

@iCMDdev iCMDdev changed the title Prevent LLDB plugin init from being stripped in release builds Prevent LLDB plugin init symbol from being stripped in release builds Jan 24, 2026
@iCMDdev iCMDdev changed the title Prevent LLDB plugin init symbol from being stripped in release builds Prevent SVD2LLDB plugin init symbol from being stripped in release builds Jan 24, 2026
Works without it, and compiling won't require `-enable-experimental-feature SymbolLinkageMarkers` anymore.
@iCMDdev
Copy link
Contributor Author

iCMDdev commented Jan 24, 2026

Thanks for the workflow run! Seems that @_used is still experimental and requires a special flag:

51 | @_used
   | `- error: attribute requires '-enable-experimental-feature SymbolLinkageMarkers'

Since everything seems to work without it, perhaps it's better to remove it.

@rauhul rauhul merged commit c19205a into apple:main Feb 11, 2026
18 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants