]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86: rust: set rustc-abi=x86-softfloat on rustc>=1.86.0
authorAlice Ryhl <aliceryhl@google.com>
Mon, 3 Feb 2025 08:40:57 +0000 (08:40 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Feb 2025 09:05:23 +0000 (10:05 +0100)
commit93893d74135780f2d98b25312603bc91ee31caac
treedc8d0a3e67b261d825d7f193dd5d3ac881993a27
parent332e85d220eead662b13f8a4e7db8c9cdff751c3
x86: rust: set rustc-abi=x86-softfloat on rustc>=1.86.0

commit 6273a058383e05465083b535ed9469f2c8a48321 upstream.

When using Rust on the x86 architecture, we are currently using the
unstable target.json feature to specify the compilation target. Rustc is
going to change how softfloat is specified in the target.json file on
x86, thus update generate_rust_target.rs to specify softfloat using the
new option.

Note that if you enable this parameter with a compiler that does not
recognize it, then that triggers a warning but it does not break the
build.

[ For future reference, this solves the following error:

        RUSTC L rust/core.o
      error: Error loading target specification: target feature
      `soft-float` is incompatible with the ABI but gets enabled in
      target spec. Run `rustc --print target-list` for a list of
      built-in targets

  - Miguel ]

Cc: <stable@vger.kernel.org> # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Link: https://github.com/rust-lang/rust/pull/136146
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com> # for x86
Link: https://lore.kernel.org/r/20250203-rustc-1-86-x86-softfloat-v1-1-220a72a5003e@google.com
[ Added 6.13.y too to Cc: stable tag and added reasoning to avoid
  over-backporting. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
scripts/generate_rust_target.rs