Skip to content

[build] hide some symbols in LLVMSupport #31951

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

Closed
wants to merge 1 commit into from

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented May 21, 2020

Reintroduce some changes done in #23131 to hide some weak symbols
generated when compiling as part of libswiftDemangle.dylib -- doing so will avoid a performance regression.

Addresses rdar://63454568

Reintroduce some changes done in swiftlang#23131 to hide some weak symbols
generated when compiling as part of libswiftDemangle.dylib, which may
introduce a performance regression.

Addresses rdar://63454568
@edymtt
Copy link
Contributor Author

edymtt commented May 21, 2020

@swift-ci please test

@compnerd
Copy link
Member

Can you explain why this is suddenly an issue? These did not change their annotation across the version, so why did they suddenly become an issue?

I think that using the SWIFT_ALWAYS_INLINE SWIFT_LIBRARY_VISIBILTIY attribute might be better if you explicitly want to annotate them. I think that the better solution is to use the correct flags. I'll put up a different change for the flags.

@edymtt
Copy link
Contributor Author

edymtt commented May 21, 2020

@compnerd I've loosely based my change on the feedback I could skim from #31665 and #20633 (which were done before #31665) but I'm not sure if I've accounted for the Windows scenario correctly (or if I need a different change now)

@compnerd
Copy link
Member

I think that a different change will be better using CMake to handle the problem. But it still doesn't explain why this wasn't an issue before.

@compnerd
Copy link
Member

#31953 should accomplish this in a more stable and platform agnostic manner. Could you please help answer the question of why its needed and what performance regression you believe that this is causing?

@edymtt
Copy link
Contributor Author

edymtt commented May 21, 2020

Sorry, replied at the same time you asked your questions.

We have some internal checks that ensure we have no weak symbol exports on dylibs, since they can cause launch time regression in applications.

To the best of my understanding, before #31665 libswiftDemangle.dylib only had a symbol reference to llvm::SmallVectorBase::grow_pod, which in was annotated with __attribute__((__weak__, __visibility__("hidden"))) in #23131, and this way we passed those checks.
With the change in #31665, now the dylib both "grabs" more (weak) symbols from llvm::SmallVectorBase and they are not hidden anymore -- triggering our checks.

Thanks a lot for #31953 -- I will study and experiment with this change.

@compnerd
Copy link
Member

Oh! Thank you, now it all makes sense. It didn't cause a performance regression, just triggered a test case failure - one that Id argue should just be in tree.

@edymtt
Copy link
Contributor Author

edymtt commented May 21, 2020

Closing this draft PR in favor of #31953 and #31955

@edymtt edymtt closed this May 21, 2020
@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 941fdea

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 941fdea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants