Extract mangled names from .swiftinterface rather than using nm#27
Merged
Merged
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
reviewed
Oct 1, 2024
ktoso
reviewed
Oct 1, 2024
ktoso
approved these changes
Oct 1, 2024
Collaborator
ktoso
left a comment
There was a problem hiding this comment.
LGTM thanks! Great to get rid of the vendored-in subprocess (and nm hack 😉)
Waiting for a toolchain then... 🕐
Collaborator
|
Sorry for the conflicts, but should be easy to resolve -- it's the to-be-removed subprocess mostly 🙇 |
Member
Author
No worries! The conflicts are all easy to resolve when it's time. |
This was referenced Oct 3, 2024
3514b58 to
482e703
Compare
Collaborator
|
Look at who's passing on Linux: and all of its friends 😄 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 :).