Conversation
Previously, `+fix-cortex-a53-835769` was statically included in `base.features` for `aarch64-unknown-fuchsia`. This caused the Cortex-A53 erratum workaround to be unconditionally enabled regardless of the selected target CPU (e.g., when passing `-C target-cpu=cortex-a73`). The behavior we want is to have it enabled by default only for the generic CPU (armv8-a), and it should be togglable via the normal `-Ctarget-features=` flag. This matches the target-feature logic in clang. AI: Note gemini was used to help verify this does match Clang's behavior and write out the matrix of different test invocations. I reviewed this code to the best of my ability before submitting.
|
These commits modify compiler targets. |
|
rustbot has assigned @petrochenkov. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? @RalfJung afaik you've been reworking the target feature system, not sure how this fits into that |
|
|
| "generic" | "cortex-a53" | ||
| ) | ||
| { | ||
| extend_backend_features("fix-cortex-a53-835769", true); |
There was a problem hiding this comment.
This hack (wtf is even going on there) looks LLVM-specific but the file you put it in is also used for other backends.
For that you have to make it a Rust target feature, i.e., add it in I can give general advice for target feature but cannot review whatever insanity this weird hack is. I just wonder if this is really the best way to deal with whatever problem this solves. @rustbot reroll |
Yes, |
|
Actually, I mixed things up. features in the target spec can be overwritten by |
|
TBH IMO this would be best handled by LLVM. LLVM can realize that the selected target CPU does not need whatever that "fix" thing is any more, and then stop applying it. Asking frontends to do this means that it requires hacks in a whole bunch of places as it does not follow the usual structure of a target feature. Cc @nikic |
|
Also not at all familiar with this code |
|
@rustbot reroll |
|
@rustbot reroll |
|
☔ The latest upstream changes (presumably #161432) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
Previously,
+fix-cortex-a53-835769was statically included inbase.featuresforaarch64-unknown-fuchsia. This caused the Cortex-A53 erratum workaround to be unconditionally enabled regardless of the selected target CPU (e.g., when passing-C target-cpu=cortex-a73).The behavior we want is to have it enabled by default only for the generic CPU (armv8-a), and it should be togglable via the normal
-Ctarget-features=flag. This matches the target-feature logic in clang.AI: Note gemini was used to help verify this does match Clang's behavior and write out the matrix of different test invocations. I reviewed this code to the best of my ability before submitting.