-
Notifications
You must be signed in to change notification settings - Fork 344
[clang] Unconditionally add autolink hints for frameworks. #6502
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
Clang infers framework autolink hints when parsing a modulemap. In order to do so, it checks if the module is a framework and if there is a framework binary or TBD file in the SDK. Only when Clang finds the filei, then the autolink hint is added to the module metadata. During a project build many clang processes perform this check, which causes many stat calls - even for modules/frameworks that are not even used. The linker is already resilient to non-existing framework links that come from the autolink metadata, so there is no need for Clang to do this check. Instead the autolink hints are now added unconditionally and the linker only needs to do the check once. This reduces the overall number of stat calls. This fixes rdar://106578342. Differential Revision: https://reviews.llvm.org/D146255 (cherry picked from commit 29e2a4e)
@swift-ci please test |
1 similar comment
@swift-ci please test |
@swift-ci please test |
Please test with following pull request: @swift-ci please test |
Please test with following pull request: @swift-ci please test |
The Swift change has been merged. Trying another test build with that Swift fix. |
@swift-ci please test |
Hi @compnerd, could you please help me with the Windows test issue? |
From the build log:
This seems like you are forming the autolink directives incorrectly. |
Oh, you are likely embedding a |
Yup, that is what clang has done since day one with respect to autolink hints. I updated |
There is no special way around that unfortunately. Windows directly passes the arguments to the linker through the linker, you cannot change that behaviour as we cannot modify the linker from Microsoft. Perhaps we should instead of have a predicate to check if the linker supports |
@swift-ci please test windows |
Clang infers framework autolink hints when parsing a modulemap. In order to do so, it checks if the module is a framework and if there is a framework binary or TBD file in the SDK. Only when Clang finds the filei, then the autolink hint is added to the module metadata.
During a project build many clang processes perform this check, which causes many stat calls - even for modules/frameworks that are not even used.
The linker is already resilient to non-existing framework links that come from the autolink metadata, so there is no need for Clang to do this check.
Instead the autolink hints are now added unconditionally and the linker only needs to do the check once. This reduces the overall number of stat calls.
This fixes rdar://106578342.
Differential Revision: https://reviews.llvm.org/D146255
(cherry picked from commit 29e2a4e)