make target feature ABI check a hard error on ARM - #161280
Conversation
|
r? @TaKO8Ki rustbot has assigned @TaKO8Ki. Use Why was this reviewer chosen?The reviewer was selected based on:
|
ac3223c to
ae04514
Compare
|
Pinging maintainers of affected targets |
|
Error: This team ( Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip. |
This comment has been minimized.
This comment has been minimized.
ae04514 to
b684a89
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
On the llvm pr adding the error there is a comment llvm/llvm-project#111334 (comment) arguing against this general requirement. |
|
We've been emitting the warning without regard for which function signatures are actually used, and so far nobody complained about those warnings AFAIK. Doing this for function signatures would require completely overhauling the check we do (and that would be hard to do without impacting compile times). Also, since the underlying ABI of many types is not guaranteed, checking the function signature would expose internal rustc implementation details in a way where changing such details (which we are explicitly permitted to do any time) could lead to compilation failures, so a proper check here would require developing an entire new set of guarantees around which types are definitely not using float registers for their ABI. |
With LLVM 24, we now (finally) get hard errors from the backend for "you want ABI X but the target features required for that ABI are missing", at least on the ARM backend:
That's not a pretty error, so let's make rust emit a hard error before we even get there -- just on ARM for now, matching LLVM. We have emitted a future-compat error for this since Rust 1.86 (#136147, #134794). I'm not making it a hard error everywhere since for other targets we are still figuring out the exact things we have to check, and it's better to do that without risking new hard errors.
For ARM, the exact check we are doing is:
llvm_floatabito either "soft" or "hard"Since this is a new hard error, this probably requires FCP. I am not sure for which team -- @rust-lang/lang is often involved for target feature things, but this is mostly about rejecting invalid
-Cflags which are handled by t-compiler (@davidtwco @BoxyUwU).Fixes #161276
Tracking issue #116344
Cc @TimNN