-
Notifications
You must be signed in to change notification settings - Fork 52
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
[_AtomicShims] On Darwin, ensure we link against libswiftCore using assembly shenanigans #97
Conversation
…ssembly shenanigans This avoids a linker failure when the build system decides to build this module as a standalone library. Hopefully this will all go away soon, when swift_retain_n/swift_release_n will become primitives exposed by the stdlib.
@swift-ci test |
Local testing confirms that this resolves the issue that's plaguing #55 (and rdar://108390931). |
Not so fast! It looks like the method I'm using to override the swift-atomics release tag with a local checkout also resolves it, by itself. Grr. |
// Ensure we link with libswiftCore.dylib even when the build system decides | ||
// to build this module as a standalone library. | ||
// (See https://github.com/apple/swift-atomics/issues/55) | ||
__asm__(".linker_option \"-L/usr/lib/swift\"\n"); |
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.
Ah, -L
doesn't actually work, but (for some reason) it also seems unnecessary, at least on 5.9.
This emits a warning and it seems to be unnecessary.
@swift-ci test |
@lorentey does Swift 5.9 expose |
Like #95 and #96, the intention here is to avoid a linker failure when the build system decides to build this module as a standalone library.
Hopefully this will all go away soon, when swift_retain_n/swift_release_n will become primitives exposed by the stdlib.
Resolves #55
Checklist