-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[c-interop] Make Extern a suppressible language feature #70852
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
Conversation
Addresses regression from #69352. |
@swift-ci please smoke test |
@tshortli Thank you for fixing this 🙏 I don't know when older compiler parses newer stdlib's module interface, but is it safe to change the symbol name by suppressing the attribute depending on whether the compiler supports the feature? Looks like other suppressible language features are not ABI-affecting features but |
As a rule of thumb, the most recently released Swift compiler toolchain should be able to successfully compile the Standard library module from its |
If |
Thanks for your detailed explanation. Those functions attributed with #if compiler(>=5.3) && $Extern
@_extern(c, "swift_retainCount")
#else
@_silgen_name("swift_retainCount")
#endif
@usableFromInline
internal func _swift_retainCount(_: UnsafeMutableRawPointer) -> Int |
It looks to me like the functions that gained |
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.
Looks good! Thank you for following up on this. 👍
Yes, that's correct.
Yeah, that's reasonable. If it's not critical path, I think we can accept the breakage.
Hmm, they have slightly different ABI semantics and we can expect there is no other usage of Anyway, this approach seems reasonable to me. Thanks again! |
@swift-ci please smoke test macOS |
@swift-ci please smoke test Linux |
Fixes building the standard library's .swiftinterface with older Swift compilers.
3dad7b5
to
ba1f50f
Compare
@swift-ci please smoke test |
Fixes building the standard library's .swiftinterface with older Swift compilers.