-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Runtime] Look up Error bridging symbols indirectly through special symbols that won't be stripped in static builds. #16677
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
[Runtime] Look up Error bridging symbols indirectly through special symbols that won't be stripped in static builds. #16677
Conversation
…ymbols that won't be stripped in static builds. This fixes a problem where error bridging didn't work in stripped executables using the static versions of the Swift libraries. ErrorObject.mm looks up some symbols with dlsym, but stripping makes it so it can't find those. This change makes a separate set of symbols explicitly made for ErrorObject.mm to look up, and marks them as dynamically referenced so stripping won't remove them. Longer term, we'd like a better solution for looking up these symbols, but this will do for now. rdar://problem/39810532
@swift-ci please test |
Build failed |
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 Mike!
Build failed |
@swift-ci please test |
Build failed |
Build failed |
@swift-ci Please test OS X platform |
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.
This needs an end-to-end test that actually strips a binary and checks the test.
@gottesmm |
I.e. we have functionality that actually strips the binary and then runs the test? |
That's right. It doesn't show up in the diffs because it was already there from before, but I also confirmed that the test fails without my fix. |
k SGTM. |
Cheers, thanks for the double check. |
This has appears to be crashing some tests (rdar://problem/40378113) I'm going to revert. |
To implement swift_errorBridgingInfo, the Foundation overlay needs to import private runtime headers. Now that we cannot statically link the Foundation overlay, there is no point to keeping this workaround in the overlay any more. This effectively reverts swiftlang#16677. rdar://problem/57809306
To implement swift_errorBridgingInfo, the Foundation overlay needs to import private runtime headers. Now that we cannot statically link the Foundation overlay, there is no point to keeping this workaround in the overlay any more. This effectively reverts swiftlang/swift#16677. rdar://problem/57809306
This fixes a problem where error bridging didn't work in stripped executables using the static versions of the Swift libraries. ErrorObject.mm looks up some symbols with dlsym, but stripping makes it so it can't find those. This change makes a separate set of symbols explicitly made for ErrorObject.mm to look up, and marks them as dynamically referenced so stripping won't remove them. Longer term, we'd like a better solution for looking up these symbols, but this will do for now.
rdar://problem/39810532