Skip to content

remove -Csoft-float#152973

Open
RalfJung wants to merge 1 commit intorust-lang:mainfrom
RalfJung:soft-float
Open

remove -Csoft-float#152973
RalfJung wants to merge 1 commit intorust-lang:mainfrom
RalfJung:soft-float

Conversation

@RalfJung
Copy link
Member

@RalfJung RalfJung commented Feb 22, 2026

This fixes #129893 by removing the offending flag.

The flag has been added in pre-1.0 times (#9617) without much discussion, probably with the intent to mirror -msoft-float in C compilers. It never properly mirrored clang though because it only affected the LLVM float ABI setting, not the "soft-float" target feature (the clang flag sets both). It is also blatantly unsound because it affects how float arguments are passed, making it UB to invoke parts of the standard library.

The flag got deprecated with Rust 1.83 (released November 2024), and in the year since then, nobody spoke up in #129893 to have it preserved. I think it is time to remove it. I can totally imagine us bringing back a similar flag, properly registered as a target modifier to preserve soundness, but that should come with a coherent design that works for more than one architecture (the flag only does anything on ARM).

Blocked on approval of rust-lang/compiler-team#971.

@RalfJung RalfJung added relnotes Marks issues that should be documented in the release notes of the next release. I-compiler-nominated Nominated for discussion during a compiler team meeting. labels Feb 22, 2026
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 22, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 22, 2026

r? @JonathanBrouwer

rustbot has assigned @JonathanBrouwer.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 68 candidates
  • Random selection from 15 candidates

@RalfJung
Copy link
Member Author

Cc'ing some ARM folks (strangely does not seem to exist as a github group, making it hard to ping):
@adamgemmell @davidtwco @Jamesbarford @JamieCunliffe @lqd

@rust-log-analyzer

This comment has been minimized.

@Urgau
Copy link
Member

Urgau commented Feb 22, 2026

Are there any precedent for out-right removing a flag?

I see that we have options where we set a special flag that keep the flag, probably to not break people who set it, but still outputs a warning to tell them it does nothing.

#[rustc_lint_opt_deny_field_access("documented to do nothing")]
ar: String = (String::new(), parse_string, [UNTRACKED],
"this option is deprecated and does nothing",
deprecated_do_nothing: true),

@RalfJung
Copy link
Member Author

I guess that would also work. Not sure if it's better to silently ignore the flag vs show an error.

@Urgau
Copy link
Member

Urgau commented Feb 22, 2026

I think it still warns.

if *is_deprecated_and_do_nothing {
// deprecation works for prefixed options only
assert!(!prefix.is_empty());
early_dcx.early_warn(format!("`-{prefix} {key}`: {desc}"));
}

@RalfJung
Copy link
Member Author

RalfJung commented Feb 22, 2026

Oh, the macro calls the field deprecated_do_nothing but really it's called is_deprecated_and_do_nothing? That's very confusing, no wonder my grep didn't find anything.

@RalfJung RalfJung force-pushed the soft-float branch 2 times, most recently from 26a9ee8 to a389cd6 Compare February 22, 2026 21:27
@Noratrieb
Copy link
Member

Given that this has ABI implications, ignoring it seems even more horribly unsound than its current existence. Someone passing it is likely relying on it, so erroring seems like the correct behavior.

@Noratrieb
Copy link
Member

Noratrieb commented Feb 23, 2026

(FWIW I think the nomination should be removed and a Zulip topic or MCP opened instead. T-compiler doesn't really do design discussions or decisions in meetings unless there's a lack of activity elsewhere or it's urgent)

@RalfJung
Copy link
Member Author

Oh, so why does that label exist then...?

@Noratrieb
Copy link
Member

Sometimes we do nominate things for the compiler team triage meeting, like if it's urgent or has a lack of progress. But because of the scale of the team, the triage meeting has a different purpose than other team's meetings. I'm not sure if it is documented anywhere, but it should probably be.

@jieyouxu
Copy link
Member

jieyouxu commented Feb 23, 2026

Cc'ing some ARM folks (strangely does not seem to exist as a github group, making it hard to ping)

(It's not a github team, but it is an triagebot ping/notif group, see https://rustc-dev-guide.rust-lang.org/notification-groups/arm.html, invocation is @rustbot ping arm)

EDIT: also, an MCP for this would probably be good, we can kickoff FCP on the MCP itself.

@RalfJung RalfJung removed the I-compiler-nominated Nominated for discussion during a compiler team meeting. label Feb 23, 2026
@RalfJung
Copy link
Member Author

I filed an MCP: rust-lang/compiler-team#971.

}
if !setter(&mut op, value) {
match value {
_ if *type_desc == desc::parse_error => early_dcx.early_fatal(
Copy link
Member Author

Choose a reason for hiding this comment

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

This is quite the hack. I guess a better option would be to extend is_deprecated_and_do_nothing so that it can indicate both "ignored" and "removed"?

@rustbot

This comment has been minimized.

pub(crate) use super::*;
pub(crate) const MAX_THREADS_CAP: usize = 256;

/// THis is always an error. Used for removed options.
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
/// THis is always an error. Used for removed options.
/// This is always an error. Used for removed options.

@JonathanBrouwer JonathanBrouwer added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 27, 2026
@rustbot

This comment has been minimized.

@RalfJung RalfJung force-pushed the soft-float branch 2 times, most recently from 67a79c7 to 69146dd Compare March 2, 2026 16:11
@rust-bors

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Mar 4, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. relnotes Marks issues that should be documented in the release notes of the next release. S-blocked Status: Blocked on something else such as an RFC or other implementation work. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-Csoft-float flag is unsound

7 participants