Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2db9b70

Browse files
ojedagregkh
authored andcommittedFeb 19, 2025
arm64: rust: clean Rust 1.85.0 warning using softfloat target
commit 446a835 upstream. 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 <rust-lang/rust#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@vger.kernel.org # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs). Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> Cc: Matthew Maurer <mmaurer@google.com> Cc: Alice Ryhl <aliceryhl@google.com> Cc: Ralf Jung <post@ralfj.de> Cc: Jubilee Young <workingjubilee@gmail.com> Link: rust-lang/rust#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: rust-lang/rust#135905 [3] Link: rust-lang/rust#116344 Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Reviewed-by: Trevor Gross <tmgross@umich.edu> Tested-by: Matthew Maurer <mmaurer@google.com> Reviewed-by: Ralf Jung <post@ralfj.de> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20250210163732.281786-1-ojeda@kernel.org Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 47be166 commit 2db9b70

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎arch/arm64/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ KBUILD_CFLAGS += $(CC_FLAGS_NO_FPU) \
4848
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
4949
KBUILD_AFLAGS += $(compat_vdso)
5050

51+
ifeq ($(call test-ge, $(CONFIG_RUSTC_VERSION), 108500),y)
52+
KBUILD_RUSTFLAGS += --target=aarch64-unknown-none-softfloat
53+
else
5154
KBUILD_RUSTFLAGS += --target=aarch64-unknown-none -Ctarget-feature="-neon"
55+
endif
5256

5357
KBUILD_CFLAGS += $(call cc-option,-mabi=lp64)
5458
KBUILD_AFLAGS += $(call cc-option,-mabi=lp64)

0 commit comments

Comments
 (0)
Failed to load comments.