rust: x86: support Rust >= 1.98.0 target spec
Subsystems (3)
Miguel Ojeda
maintainerPATCH 1/1 rust: x86: support Rust >= 1.98.0 target spec
Starting with Rust 1.98.0 (expected 2026-08-20), the target spec will not support x86-softfloat anymore [1]. Instead, softfloat should be used, which is an alias. Otherwise, one gets:
error: error loading target specification: rustc-abi: invalid rustc abi: 'x86-softfloat'. allowed values: 'x86-sse2', 'softfloat' at line 3 column 32
|
= help: run `rustc --print target-list` for a list of built-in targetsThus conditionally use one or the other depending on the version.
The alias has existed since Rust 1.95.0 (released 2026-04-16) [2], but use the newer version instead to avoid changing how the build works for existing compilers, at least until more testing takes place.
--- scripts/generate_rust_target.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/generate_rust_target.rs +3 -1
@@ -196,7 +196,9 @@ fn main() { } }else if cfg.has ("X86_64" ) { ts.push ("arch" ,"x86_64" ); -if cfg.rustc_version_atleast (1 ,86 ,0 ) { +if cfg.rustc_version_atleast (1 ,98 ,0 ) { + ts.push ("rustc-abi" ,"softfloat" ); + }else if cfg.rustc_version_atleast (1 ,86 ,0 ) { ts.push ("rustc-abi" ,"x86-softfloat" ); } ts.push(
base-commit: ac35b5580ace12e5d0a0b5e61e36d2c4e1ffa29c
Signature · 1 line
2.54.0
Quoted 2 lines · Miguel Ojeda
} else if cfg.has("X86_64") {And the same change for 32-bit UML as Sashiko points out, of course -- tested that one now too.
Cheers,
Miguel
Quoted 15 lines · Miguel Ojeda
Starting with Rust 1.98.0 (expected 2026-08-20), the target spec will not support
x86-softfloatanymore [1]. Instead,softfloatshould be used, which is an alias. Otherwise, one gets:error: error loading target specification: rustc-abi: invalid rustc abi: 'x86-softfloat'. allowed values: 'x86-sse2', 'softfloat' at line 3 column 32 | = help: run `rustc --print target-list` for a list of built-in targetsThus conditionally use one or the other depending on the version.
The alias has existed since Rust 1.95.0 (released 2026-04-16) [2], but use the newer version instead to avoid changing how the build works for existing compilers, at least until more testing takes place.
Quoted 5 lines
Cc Ralf Jung <[email protected]>Cc [email protected] # Needed in 6.12.y and later (Rust is pinned in older LTSs).Signed-off-by Miguel Ojeda <[email protected]>
With UML updated too:
Quoted 15 lines · Miguel Ojeda
Starting with Rust 1.98.0 (expected 2026-08-20), the target spec will not support
x86-softfloatanymore [1]. Instead,softfloatshould be used, which is an alias. Otherwise, one gets:error: error loading target specification: rustc-abi: invalid rustc abi: 'x86-softfloat'. allowed values: 'x86-sse2', 'softfloat' at line 3 column 32 | = help: run `rustc --print target-list` for a list of built-in targetsThus conditionally use one or the other depending on the version.
The alias has existed since Rust 1.95.0 (released 2026-04-16) [2], but use the newer version instead to avoid changing how the build works for existing compilers, at least until more testing takes place.
Quoted 5 lines
Cc Ralf Jung <[email protected]>Cc [email protected] # Needed in 6.12.y and later (Rust is pinned in older LTSs).Signed-off-by Miguel Ojeda <[email protected]>
Applied to rust-fixes early so that we start getting testing tomorrow -- thanks everyone!
Tags still welcome for a day or so.
(I considered rust-next, but to simplify testing for ~2 weeks for those that want to use nightly, I decided to put it in rust-fixes instead.)
Cheers,
Miguel