-
Notifications
You must be signed in to change notification settings - Fork 67
Extract mangled names from .swiftinterface rather than using nm
#27
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
Extract mangled names from .swiftinterface rather than using nm
#27
Conversation
The Swift compiler is growing an option to emit mangled names along with various operations. Build example .swiftinterfaces with that option and rely on parsing the mangled name from there instead of 'nm'.
ktoso
left a comment
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.
LGTM thanks! Great to get rid of the vendored-in subprocess (and nm hack 😉)
Waiting for a toolchain then... 🕐
|
Sorry for the conflicts, but should be easy to resolve -- it's the to-be-removed subprocess mostly 🙇 |
No worries! The conflicts are all easy to resolve when it's time. |
3514b58 to
482e703
Compare
|
Look at who's passing on Linux: and all of its friends 😄 |
The Swift compiler recently added a frontend option (in swiftlang/swift#76600)
-abi-comments-in-module-interfacethat emits ABI-related comments into the generated Swift interface file. Parse the resulting// MANGLED NAME:comments to extract mangled name information for public symbols instead of relying on hardcodednminvocations on the shared library.Note that this pull request means that
jextract-swiftwill require an as-yet-unreleased Swift compiler that comes from themainbranch. At present, there is no downloadable toolchain containing the compiler fix, so I'm starting by opening this as a draft. Once downloadable toolchains are available for all platforms, we can update the documentation to pointjextract-swiftusers there and merge this pull request.Remove all of the supporting code for querying
nm, which turns out to be a lot :).