-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Protocol Metadata] Create protocol metadata using WeakAnyLinkage to avoid duplication #39944
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
@swift-ci please smoke test |
I think we also should match the visibility by setting it to hidden.
|
@swift-ci Please smoke test |
@swift-ci please smoke test linux |
@swift-ci test Linux platform |
@swift-ci Please test macOS |
Build failed |
@swift-ci test |
Build failed |
@swift-ci please smoke test |
@swift-ci Please test |
Build failed |
…avoid duplication
@swift-ci please smoke test |
@swift-ci Please test |
…c metadata This extends swiftlang#39944 to apply to more objc metadata. rdar://85037490
…c metadata This extends swiftlang#39944 to apply to more objc metadata. rdar://85037490
I've noticed that some SWIFT binaries show duplicate metadata entries such as __PROTOCOL_NSObject along with all descending linked metadata.
The Issue is that the protocol global is created with internal linkage. Because of the internal linkage, the linker will not merge identical records in the final output.
The fix is to update the linkage type to WeakAnyLinkage, same as in ObjC.
Also, from review feedback, we also match the visibility with ObjC visibility(GlobalValue::HiddenVisibility);
Resolves SR-15376.