Description
Current status: all use of the flag causes a warning (will be shipped in 1.83), announcing that it will become a hard error in the future.
@bjorn3 just made me aware of this amazing flag:
-C soft-float=val -- use soft float ABI (*eabihf targets only) (default: no)
This is quite unsound: if code gets compiled with -Csoft-float
and calls code from the standard library that uses the hard float ABI, we have UB. Generally we need different target triples for softfloat vs hardfloat ABIs, since (as per the discussion in rust-lang/lang-team#235) code within a single target should be ABI compatible. Cargo even (unstably) allows overwriting RUSTFLAGS
on a per-crate basis, so we better make sure crates compiled with different flags can be linked with each other.
This was added a looooong time ago in #9617. I couldn't find any discussion regarding its soundness.
We have e.g. arm-unknown-linux-musleabi
and arm-unknown-linux-musleabihf
, so using the *hf
target but with -Csoft-float
also seems kind of unnecessary. (But I have not checked whether all eabihf
targets have a corresponding eabi
target.)
According to the documentation, this can only be used by ARM targets. So paging in some ARM folks -- is this used in practice, and if yes, how do people avoid the soundness problems?
@rustbot ping arm
Note that this issue is not about -Ctarget-feature=+soft-float
, see #116344 for that.