-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Runtime: split out extern "C"
marker from SWIFT_RUNTIME_EXPORT
#61476
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
Any reason we're still waiting on this? This is a growing problem for Linux builds. (On recent Ubuntu, "clang" defaults to clang-15, which trips over this.) |
@swift-ci Please test |
Trying to build locally on Linux with this change gives me:
and a number of other similar-looking errors. |
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.
I tried building on Ubuntu 22.10 with clang-15 and got a couple of failures.
#else | ||
#define SWIFT_EXPORT_FROM(LIBRARY) SWIFT_EXPORT_FROM_ATTRIBUTE(LIBRARY) |
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.
SWIFT_EXPORT_FROM()
is used in several other places, so you cannot drop this definition.
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.
But SWIFT_EXPORT_FROM_ATTRIBUTE
is not used outside of this file, so you could just rename that to SWIFT_EXPORT_FROM
// SWIFT_RUNTIME_EXPORT is just SWIFT_EXPORT_FROM(swiftCore). | ||
// | ||
// TODO: use this in shims headers in overlays. | ||
#define SWIFT_RUNTIME_EXPORT SWIFT_EXPORT_FROM_ATTRIBUTE(LIBRARY) |
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.
This should be SWIFT_EXPORT_FROM_ATTRIBUTE(swiftCore)
This fix might be replaced by something better, e.g. swiftlang#61476
This fix might be replaced by something better, e.g. swiftlang#61476
This fix might be replaced by something better, e.g. swiftlang#61476
This fix might be replaced by something better, e.g. swiftlang#61476
This fix might be replaced by something better, e.g. swiftlang#61476
@swift-ci please test |
Re-testing this one in the hope of merging it soon. |
This is required to a clang change. Attribute need to be in a certain order when building with a newer clang. This fix might be replaced by something better, e.g. swiftlang#61476
This is required to a clang change. Attribute need to be in a certain order when building with a newer clang. This fix might be replaced by something better, e.g. swiftlang#61476
@swift-ci please test |
1 similar comment
@swift-ci please test |
@swift-ci please test |
@swift-ci please test |
@swift-ci please test |
This is required to a clang change. Attribute need to be in a certain order when building with a newer clang. This fix might be replaced by something better, e.g. swiftlang#61476
Although the runtime exported symbols must be exported with "C" linkage and decoration, we split out the externalisation in the C++ mode. This is required to ensure that we are able to attribute the functions without following the more stringent rules that clang now enforces which place the attributes following the identifier to which they appertain, resulting in the attributes interleaving within the signature. The resulting spelling is more difficult to process for humans as well as more difficult to identify as function declarations making code perusal a challenge, particularly for the uninitiated.
@swift-ci please test |
Closing in favour of fixing llvm/llvm-project#58229 (https://reviews.llvm.org/D137979) |
Although the runtime exported symbols must be exported with "C" linkage and decoration, we split out the externalisation in the C++ mode. This is required to ensure that we are able to attribute the functions without following the more stringent rules that clang now enforces which place the attributes following the identifier to which they appertain, resulting in the attributes interleaving within the signature. The resulting spelling is more difficult to process for humans as well as more difficult to identify as function declarations making code perusal a challenge, particularly for the uninitiated.