Skip to content

Commit 8321a48

Browse files
ojedabpf-ci[bot]
authored andcommitted
rust: x86: support Rust >= 1.98.0 target spec
commit 905b06d upstream. 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 targets Thus 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. Cc: Ralf Jung <post@ralfj.de> Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs). Link: rust-lang/rust#157151 [1] Link: rust-lang/rust#151154 [2] Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://patch.msgid.link/20260530114925.260754-1-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b107635 commit 8321a48

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

scripts/generate_rust_target.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ fn main() {
194194
}
195195
} else if cfg.has("X86_64") {
196196
ts.push("arch", "x86_64");
197-
if cfg.rustc_version_atleast(1, 86, 0) {
197+
if cfg.rustc_version_atleast(1, 98, 0) {
198+
ts.push("rustc-abi", "softfloat");
199+
} else if cfg.rustc_version_atleast(1, 86, 0) {
198200
ts.push("rustc-abi", "x86-softfloat");
199201
}
200202
ts.push(
@@ -234,7 +236,9 @@ fn main() {
234236
panic!("32-bit x86 only works under UML");
235237
}
236238
ts.push("arch", "x86");
237-
if cfg.rustc_version_atleast(1, 86, 0) {
239+
if cfg.rustc_version_atleast(1, 98, 0) {
240+
ts.push("rustc-abi", "softfloat");
241+
} else if cfg.rustc_version_atleast(1, 86, 0) {
238242
ts.push("rustc-abi", "x86-softfloat");
239243
}
240244
ts.push(

0 commit comments

Comments
 (0)