[PATCH] arm64: rust: clean Rust 1.85.0 warning using softfloat target
Ralf Jung
post at ralfj.de
Tue Feb 11 23:34:44 PST 2025
On 11.02.25 12:10, Trevor Gross wrote:
> On Mon, Feb 10, 2025 at 10:38 AM Miguel Ojeda <ojeda at kernel.org> wrote:
>>
>> Starting with Rust 1.85.0 (to be released 2025-02-20), `rustc` warns
>> [1] about disabling neon in the aarch64 hardfloat target:
>>
>> warning: target feature `neon` cannot be toggled with
>> `-Ctarget-feature`: unsound on hard-float targets
>> because it changes float ABI
>> |
>> = note: this was previously accepted by the compiler but
>> is being phased out; it will become a hard error
>> in a future release!
>> = note: for more information, see issue #116344
>> <https://github.com/rust-lang/rust/issues/116344>
>>
>> Thus, instead, use the softfloat target instead.
>>
>> While trying it out, I found that the kernel sanitizers were not enabled
>> for that built-in target [2]. Upstream Rust agreed to backport
>> the enablement for the current beta so that it is ready for
>> the 1.85.0 release [3] -- thanks!
>>
>> However, that still means that before Rust 1.85.0, we cannot switch
>> since sanitizers could be in use. Thus conditionally do so.
>>
>> Cc: <stable at vger.kernel.org> # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
>> Cc: Catalin Marinas <catalin.marinas at arm.com>
>> Cc: Will Deacon <will at kernel.org>
>> Cc: Matthew Maurer <mmaurer at google.com>
>> Cc: Alice Ryhl <aliceryhl at google.com>
>> Cc: Ralf Jung <post at ralfj.de>
>> Cc: Jubilee Young <workingjubilee at gmail.com>
>> Link: https://github.com/rust-lang/rust/pull/133417 [1]
>> Link: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/arm64.20neon.20.60-Ctarget-feature.60.20warning/near/495358442 [2]
>> Link: https://github.com/rust-lang/rust/pull/135905 [3]
>> Link: https://github.com/rust-lang/rust/issues/116344
>> Signed-off-by: Miguel Ojeda <ojeda at kernel.org>
>
> This is consistent with what has been discussed for a while on the Rust side.
>
> Reviewed-by: Trevor Gross <tmgross at umich.edu>
I don't know the kernel side of this, but from a Rust compiler perspective using
the "-softfloat" target is definitely the right call here, at least for now
(where none of the crypto/compression code that needs SIMD is written in Rust).
Reviewed-by: Ralf Jung <post at ralfj.de>
Kind regards,
Ralf
More information about the linux-arm-kernel
mailing list