rust: Upgrade 1.96.1 -> 1.97.1
PATCH 1/1 rust: Upgrade 1.96.1 -> 1.97.1
From: Deepesh Varatharajan <[email protected]>
1.97.1
Rust 1.97.1 is a point release that fixes a critical miscompilation in an LLVM optimization (rust-lang/rust#159035) that has been silently affecting generated code since at least Rust 1.87.
https://github.com/rust-lang/rust/releases/tag/1.97.1
1.97.0
Rust Changes:
https://github.com/rust-lang/rust/releases/tag/1.97.0
Cargo Changes:
https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html#cargo-197-2026-07-09
Release highlights:
- v0 symbol mangling scheme now default
- New allow-by-default dead_code_pub_in_binary lint
- Cargo: stabilized build.warnings and resolver.lockfile-path configs
- Multiple new stabilized APIs (isolate_highest_one, bit_width, etc)
Drop merged patches:
0001-riscv32-Define-plain-syscalls-as-their-time64-varian.patch
(merged upstream in vendored libc 0.2.186)
0003-explicit-tail-calls-disable-two-tests.patch
(backport from fb9e970c1f93 and 250beb317422)
0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch
(backport from ded0aaba6ce2)
rust-target-config: Set frame-pointer to non-leaf for aarch64
The upstream rustc aarch64-unknown-linux-gnu target specifies "frame-pointer": "non-leaf" as required by the AArch64 AAPCS64 ABI [1]. OE custom target JSON was missing this, causing codegen differences that led to test failures in tests/assembly-llvm/issue-141649.rs.
Set frame-pointer to non-leaf for aarch64 in rust_gen_target() to match the upstream target configuration.
[1] https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#the-frame-pointer
Updated files:
rust-source.inc: updated sha256sum, removed merged patches, added new patches rust-snapshot.inc: updated SNAPSHOT_VERSION 1.95.0 -> 1.96.0 with all arch checksums tcmode-default.inc: updated RUSTVERSION 1.96.1% -> 1.97.0% rust_1.97.0.bb: remove vendored .a files from installed sources
(fix dwarfsrcfiles failure on non-ELF wit-bindgen-0.57.1 archive)
Selftest Changes:
Exclude tests/ui/codegen/huge-stacks.rs (fails in QEMU emulated
environments due to resource limits — new test in 1.97.0. Upstream discussion - https://github.com/rust-lang/rust/issues/158557)
Fix stale exclusion path: tests/assembly-llvm/c-variadic-arm.rs ->
tests/assembly-llvm/c-variadic/arm.rs (file moved to subdirectory)
Excluded tests:
+---------+---------+---------+ | Before | After | Skipped | +---------+---------+---------+ | 41 | 42 | +1 | +---------+---------+---------+
rust v1.97.0 (from autobuilder)
+-------------+---------+---------+ | Machine | Passed | Skipped | +-------------+---------+---------+ | qemux86-64 | 22752 | 762 | | qemux86 | 22505 | 1009 | | qemuarm64 | 22579 | 935 | | qemuarm | 22486 | 1028 | | qemuriscv64 | 22528 | 986 | +-------------+---------+---------+
Test results difference (1.97.0 - 1.96.0):
+-------------+--------+---------+ | Machine | Passed | Skipped | +-------------+--------+---------+ | qemux86-64 | +316 | +30 | | qemux86 | +315 | +31 | | qemuarm64 | +317 | +29 | | qemuarm | +314 | +32 | | qemuriscv64 | +312 | +34 | +-------------+--------+---------+
Reproducibility: PASSED (x86-64)
---
.../classes-recipe/rust-target-config.bbclass | 5 +
meta/conf/distro/include/tcmode-default.inc | 2 +-
meta/lib/oeqa/selftest/cases/rust.py | 3 +-
.../rust/{cargo_1.96.1.bb => cargo_1.97.1.bb} | 0
...lain-syscalls-as-their-time64-varian.patch | 81 --------------
...xplicit-tail-calls-disable-two-tests.patch | 39 -------
...lls-ignore-tests-on-unsupported-llvm.patch | 96 ----------------
...ibstd-rs_1.96.1.bb => libstd-rs_1.97.1.bb} | 0
....96.1.bb => rust-cross-canadian_1.97.1.bb} | 0
meta/recipes-devtools/rust/rust-snapshot.inc | 104 +++++++++---------
meta/recipes-devtools/rust/rust-source.inc | 5 +-
.../rust/{rust_1.96.1.bb => rust_1.97.1.bb} | 3 +
12 files changed, 64 insertions(+), 274 deletions(-)
rename meta/recipes-devtools/rust/{cargo_1.96.1.bb => cargo_1.97.1.bb} (100%)
delete mode 100644 meta/recipes-devtools/rust/files/0001-riscv32-Define-plain-syscalls-as-their-time64-varian.patch
delete mode 100644 meta/recipes-devtools/rust/files/0003-explicit-tail-calls-disable-two-tests.patch
delete mode 100644 meta/recipes-devtools/rust/files/0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch
rename meta/recipes-devtools/rust/{libstd-rs_1.96.1.bb => libstd-rs_1.97.1.bb} (100%)
rename meta/recipes-devtools/rust/{rust-cross-canadian_1.96.1.bb => rust-cross-canadian_1.97.1.bb} (100%)
rename meta/recipes-devtools/rust/{rust_1.96.1.bb => rust_1.97.1.bb} (98%)meta/classes-recipe/rust-target-config.bbclass +5 -0
@@ -447,6 +447,11 @@ def rust_gen_target(d, thing, wd, arch): tspec['has-thread-local'] = True tspec['position-independent-executables'] = True tspec['panic-strategy'] = d.getVar("RUST_PANIC_STRATEGY") + # AArch64 AAPCS64 requires non-leaf frame pointers per + # https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#the-frame-pointer + # This matches the upstream aarch64-unknown-linux-gnu target in rustc. + if arch == "aarch64": + tspec['frame-pointer'] = "non-leaf" if "musl" in tspec['llvm-target']: tspec['crt-static-respected'] = True
meta/conf/distro/include/tcmode-default.inc +1 -1
@@ -12,7 +12,7 @@ PREFERRED_PROVIDER_virtual/gettext ??= "gettext" GCCVERSION ?= "16.%" SDKGCCVERSION ?= "${GCCVERSION}" GLIBCVERSION ?= "2.43%" -RUSTVERSION ?= "1.96.1%" +RUSTVERSION ?= "1.97.1%" PREFERRED_VERSION_gcc ?= "${GCCVERSION}" PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}"
meta/lib/oeqa/selftest/cases/rust.py +2 -1
@@ -81,7 +81,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): 'src/tools/suggest-tests', 'src/tools/tidy', 'tests/assembly-llvm/asm/aarch64-outline-atomics.rs', - 'tests/assembly-llvm/c-variadic-arm.rs', + 'tests/assembly-llvm/c-variadic/arm.rs', 'tests/codegen-llvm/thread-local.rs', 'tests/mir-opt/', 'tests/run-make',
@@ -91,6 +91,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): 'tests/rustdoc-js-std', 'tests/ui/abi/stack-probes-lto.rs', 'tests/ui/abi/stack-probes.rs', + 'tests/ui/codegen/huge-stacks.rs', 'tests/ui/codegen/mismatched-data-layouts.rs', 'tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs', 'tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs',
meta/recipes-devtools/rust/cargo_1.97.1.bb renamed from meta/recipes-devtools/rust/cargo_1.96.1.bb +0 -0
meta/recipes-devtools/rust/files/0001-riscv32-Define-plain-syscalls-as-their-time64-varian.patch deleted +0 -81
81 lines not on this page · raw message
meta/recipes-devtools/rust/files/0003-explicit-tail-calls-disable-two-tests.patch deleted +0 -39
@@ -1,39 +0,0 @@ -Backport two commits that disable two failing tests on LoongArch. - -Upstream-Status: Backport [https://github.com/rust-lang/rust/commit/fb9e970c1f9377fa6c093f18aabab76204a18ea4] -Upstream-Status: Backport [https://github.com/rust-lang/rust/commit/250beb317422dad63d9bdefee9d82c55a732ba60] - -Signed-off-by: Deepesh Varatharajan <[email protected]> - -diff --git a/tests/ui/explicit-tail-calls/support/bystack.rs b/tests/ui/explicit-tail-calls/support/bystack.rs -index ad1e082..b0ac29e 100644 ---- a/tests/ui/explicit-tail-calls/support/bystack.rs -+++ b/tests/ui/explicit-tail-calls/support/bystack.rs -@@ -36,9 +36,11 @@ - //@ revisions: loongarch32 - //@[loongarch32] compile-flags: --target loongarch32-unknown-none - //@[loongarch32] needs-llvm-components: loongarch -+//@[loongarch32] ignore-llvm-version: 22 - 23 - //@ revisions: loongarch64 - //@[loongarch64] compile-flags: --target loongarch64-unknown-linux-gnu - //@[loongarch64] needs-llvm-components: loongarch -+//@[loongarch64] ignore-llvm-version: 22 - 23 - //@ revisions: bpf - //@[bpf] compile-flags: --target bpfeb-unknown-none - //@[bpf] needs-llvm-components: bpf -diff --git a/tests/ui/explicit-tail-calls/support/byval.rs b/tests/ui/explicit-tail-calls/support/byval.rs -index 965c63c..d29d0d8 100644 ---- a/tests/ui/explicit-tail-calls/support/byval.rs -+++ b/tests/ui/explicit-tail-calls/support/byval.rs -@@ -36,9 +36,11 @@ - //@ revisions: loongarch32 - //@[loongarch32] compile-flags: --target loongarch32-unknown-none - //@[loongarch32] needs-llvm-components: loongarch -+//@[loongarch32] ignore-llvm-version: 22 - 23 - //@ revisions: loongarch64 - //@[loongarch64] compile-flags: --target loongarch64-unknown-linux-gnu - //@[loongarch64] needs-llvm-components: loongarch -+//@[loongarch64] ignore-llvm-version: 22 - 23 - //@ revisions: bpf - //@[bpf] compile-flags: --target bpfeb-unknown-none - //@[bpf] needs-llvm-components: bpf
meta/recipes-devtools/rust/files/0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch deleted +0 -96
96 lines not on this page · raw message
meta/recipes-devtools/rust/libstd-rs_1.97.1.bb renamed from meta/recipes-devtools/rust/libstd-rs_1.96.1.bb +0 -0
meta/recipes-devtools/rust/rust-cross-canadian_1.97.1.bb renamed from meta/recipes-devtools/rust/rust-cross-canadian_1.96.1.bb +0 -0
meta/recipes-devtools/rust/rust-snapshot.inc +52 -52
110 lines not on this page · raw message
meta/recipes-devtools/rust/rust-source.inc +1 -4
@@ -5,12 +5,9 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n file://rust-oe-selftest.patch;patchdir=${RUSTSRC} \ file://repro-issue-fix-with-cc-crate-hashmap.patch;patchdir=${RUSTSRC} \ file://0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch;patchdir=${RUSTSRC} \ - file://0001-riscv32-Define-plain-syscalls-as-their-time64-varian.patch;patchdir=${RUSTSRC} \ file://0002-Fix-rust-build-failure-with-unstable-options.patch;patchdir=${RUSTSRC} \ - file://0003-explicit-tail-calls-disable-two-tests.patch;patchdir=${RUSTSRC} \ - file://0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch;patchdir=${RUSTSRC} \ " -SRC_URI[rust.sha256sum] = "77a6ff3003a4ad0cb00697b043c879e3e1a15d945b1a1f63818903bfc3fa8b98" +SRC_URI[rust.sha256sum] = "0ed06fdaffd4722a7702e0b4eebfafc897ab8f513e8e1b247cdd7e5c6df6ded2" RUSTSRC = "${UNPACKDIR}/rustc-${RUST_VERSION}-src"
meta/recipes-devtools/rust/rust_1.97.1.bb renamed from meta/recipes-devtools/rust/rust_1.96.1.bb +3 -0
@@ -271,6 +271,7 @@ rust_do_install:append:class-native() { install -d ${D}${libdir}/rustlib/src/rust cp -r ${S}/library ${D}${libdir}/rustlib/src/rust find ${D}${libdir}/rustlib/src/rust/ -name "*.sh" -type f -delete + find ${D}${libdir}/rustlib/src/rust/ -path "*/vendor/*.a" -type f -delete } rust_do_install:class-nativesdk() {
@@ -307,6 +308,7 @@ rust_do_install:class-nativesdk() { install -d ${D}${libdir}/rustlib/src/rust cp -r ${S}/library ${D}${libdir}/rustlib/src/rust find ${D}${libdir}/rustlib/src/rust/ -name "*.sh" -type f -delete + find ${D}${libdir}/rustlib/src/rust/ -path "*/vendor/*.a" -type f -delete }
@@ -331,6 +333,7 @@ rust_do_install:class-target() { install -d ${D}${libdir}/rustlib/src/rust cp -r ${S}/library ${D}${libdir}/rustlib/src/rust find ${D}${libdir}/rustlib/src/rust -name "*.sh" -type f -delete + find ${D}${libdir}/rustlib/src/rust -path "*/vendor/*.a" -type f -delete install -m 0644 ${WORKDIR}/rust-targets/${RUST_HOST_SYS}.json ${D}${libdir}/rustlib/${RUST_HOST_SYS}/${RUST_HOST_SYS}.json
Signature · 1 line
2.49.0
Hi Deepesh,
I see this patch got "Changes Requested" on patchwork — do you know what needs to be fixed?
I'm asking because I'm upgrading OpenSSL to 4.0.1 and cargo-native fails to build without Rust 1.97.1 (the vendored openssl-sys in 1.96.1 doesn't support OpenSSL 4.x).
The current Rust 1.96.1 ships openssl-sys 0.9.107 which fails when building against OpenSSL 4.0:
"This crate is only compatible with OpenSSL (version 1.1.0, 1.1.1, or 3.x)"
If there's anything I can help with to get this patch merged, happy to assist.
Regards,
Jaipaul
Quoted 2 lines · Jaipaul Cheernam via lists.openembedded.org
I see this patch got "Changes Requested" on patchwork — do you know what needs to be fixed?
I'm asking because I'm upgrading OpenSSL to 4.0.1 and cargo-native fails to build without Rust 1.97.1 (the vendored openssl-sys in 1.96.1 doesn't support OpenSSL 4.x).
This is not related to rust, but last time I tried to add openssl 4.x, that quickly ran into python support issues, as currently released python does not support openssl 4.x even in the latest commit on the stable branch, and we need to wait for a new major release sometime in the autumn. Did you check that? Has the situation changed?
Alex
Quoted 11 lines · Alexander Kanavin
Quoted 2 lines · Jaipaul Cheernam via lists.openembedded.org
I see this patch got "Changes Requested" on patchwork — do you know what needs to be fixed?
I'm asking because I'm upgrading OpenSSL to 4.0.1 and cargo-native fails to build without Rust 1.97.1 (the vendored openssl-sys in 1.96.1 doesn't support OpenSSL 4.x).This is not related to rust, but last time I tried to add openssl 4.x, that quickly ran into python support issues, as currently released python does not support openssl 4.x even in the latest commit on the stable branch, and we need to wait for a new major release sometime in the autumn. Did you check that? Has the situation changed? Hi Alex,
Yes, I ran into the same Python issue. Python 3.14.7 fails to build _ssl against OpenSSL 4.0.
The backport PR (#146403) was closed without merge. it looks like they're only targeting main (3.15).
I've included it as a backport patch(CPython main 3364e7e62fa2) in my series.
Alone with Python, I also had to fix:
- socat: two-line fix for ASN1_STRING made opaque (sent upstream)
- openssl recipe cleanup for deprecated engines
- Rust/cargo-native: needs 1.97.1 for openssl-sys 0.9.114 which adds OpenSSL 4.0 support
Happy to share the series if you want to take a look.
Regards,
Jaipaul
Quoted 3 lines · Jaipaul Cheernam
If there's anything I can help with to get this patch merged, happy to assist.
Hi Jaipaul,
Thanks for reaching out and for offering to help.
There was an intermittent reproducibility issue observed with Rust 1.97. We were debugging that issue, and we’ve now identified a fix.
We’ve sent a v2 of the upgrade with the fix included. Hopefully this addresses the issue and allows the patch to move forward.
Thanks again for your support and for flagging the OpenSSL 4.0 compatibility issue.
Regards,
Deepesh