-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[swiftinterface] Handle target variants the same as targets #77156
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
[swiftinterface] Handle target variants the same as targets #77156
Conversation
@swift-ci please test |
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.
Thanks for taking care of this! Out of curiosity, what assertion are you hitting without this fix? I thought the SILGen assertion I removed was the only one that was being triggered.
It was the I will try to make the triple checks into a function/lambda and send a new version. |
Based on preliminary work from @rhow. The compilation arguments for a swiftinterface file are preprocessed to modify the `-target` argument to match the preferred target (which comes from the command line) in cases in which the sub-architecture differs, but it is compatible (for example using `arm64e` when `arm64` is being compiled), but this was not done for the target variant, which ended up with mismatches on the sub-architecture used by the target and target variant, which fails an assert in assert toolchains.
9563f32
to
0b14bdc
Compare
@swift-ci please test |
Revert "[swiftinterface] Handle target variants the same as targets (#77156)"
In swiftlang#77156, normalization was introduced for -target-variant triples. That PR also caused -target-variant arguments to be inherited from the main compilation options whenever building dependency modules from their interfaces, which is incorrect. The -target-variant option must only be specified when compiling a "zippered" module, but the dependencies of zippered modules are not necessarily zippered themselves and indiscriminantly propagating the option can cause miscompilation. The new, more targeted approach to normalizing arm64e triples simply uses the arch and subarch of the -target argument of the main compile to decide whether the subarch of both the -target and -target-variant arguments of a dependency need adjustment. Resolves rdar://135322077 and rdar://141640919.
Based on preliminary work from @rmaz.
The compilation arguments for a swiftinterface file are preprocessed to modify the
-target
argument to match the preferred target (which comes from the command line) in cases in which the sub-architecture differs, but it is compatible (for example usingarm64e
whenarm64
is being compiled), but this was not done for the target variant, which ended up with mismatches on the sub-architecture used by the target and target variant, which fails an assert in assert toolchains.Maybe solves rdar://135322077