Skip to content

[Runtime] Temporarily update attribute ordering #62667

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

Merged
merged 1 commit into from
Dec 19, 2022

Conversation

bnbarham
Copy link
Contributor

clang-15 requires extern "C" to be the first attribute and does not allow mixing GNU attributes and standard attributes. Temporarily split and re-order attributes to prevent compilation errors. Avoid updating the public stdlib here (Visibility.h) and instead add the definitions to Config.h, which all impacted headers and up including.

This should be removed once Swift uses at least stable/20221013, which has https://reviews.llvm.org/D137979 and would thus allow us to just move SWIFT_RUNTIME_EXPORT to be the first attribute.

Resolves #61468.

clang-15 requires `extern "C"` to be the first attribute and does not
allow mixing GNU attributes and standard attributes. Temporarily split
and re-order attributes to prevent compilation errors. Avoid updating
the public stdlib here (`Visibility.h`) and instead add the definitions
to `Config.h`, which all impacted headers and up including.

This should be removed once Swift uses at least stable/20221013, which
has https://reviews.llvm.org/D137979 and would thus allow us to just
move `SWIFT_RUNTIME_EXPORT` to be the first attribute.

Resolves swiftlang#61468.
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@bnbarham
Copy link
Contributor Author

#62497 doesn't work on main unfortunately. I'll rebase it onto rebranch after fixing the conflicts this PR will cause.

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this seems like a good compromise for the 5.8 release.

@bnbarham bnbarham merged commit 01d48e0 into swiftlang:main Dec 19, 2022
@bnbarham bnbarham deleted the temp-fix-attribute-ordering branch December 19, 2022 06:29
@bnbarham
Copy link
Contributor Author

@eeckstein this will have rebranch merge conflicts from this I imagine. I'll fix those + put up the separate fix tomorrow.

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.

The Swift compiler cannot be built with clang 15 on linux/Android
2 participants