Skip to contentSkip to conversation

rust: Upgrade 1.96.1 -> 1.97.1

PATCH New [email protected] 1 participant 1 message Aug 17 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH v2 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)
0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch
(backport from e743a4db6233)

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. 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)

New file:
0043-LoopUnroll-Iterate-exit-fold-candidates-in-determini.patch
Backport a patch from llvm upstream to fix the repro issue seen with rust 1.97.0

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)

Assisted-by Kiro CLI 2.12.0 (AI assistant)
---
 .../classes-recipe/rust-target-config.bbclass |   5 +
 meta/conf/distro/include/maintainers.inc      |   2 +-
 meta/conf/distro/include/tcmode-default.inc   |   2 +-
 meta/lib/oeqa/selftest/cases/rust.py          |   3 +-
 ...te-exit-fold-candidates-in-determini.patch |  71 ++++++++++++
 meta/recipes-devtools/clang/common.inc        |   1 +
 .../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 ----------------
 ...ild-script-path-leakage-in-artifacts.patch |  28 -----
 ...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    |   6 +-
 ...source_1.96.1.bb => rust-source_1.97.1.bb} |   0
 .../rust/{rust_1.96.1.bb => rust_1.97.1.bb}   |   3 +
 17 files changed, 137 insertions(+), 304 deletions(-)
 create mode 100644 meta/recipes-devtools/clang/clang/0043-LoopUnroll-Iterate-exit-fold-candidates-in-determini.patch
 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
 delete mode 100644 meta/recipes-devtools/rust/files/0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.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-source_1.96.1.bb => rust-source_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
index 54919091fe..58c36bfebb 100644
@@ -456,6 +456,11 @@ def rust_gen_target(d, thing, wd, arch):
     tspec['panic-strategy'] = d.getVar("RUST_PANIC_STRATEGY")
     if "musl" in tspec['llvm-target']:
         tspec['crt-static-respected'] = True
+    # 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"
 
     # write out the target spec json file
     with open(wd + rustsys + '.json', 'w') as f:
meta/conf/distro/include/maintainers.inc +1 -1
index f30aa06e15..a6737d65ce 100644
@@ -784,7 +784,7 @@ RECIPE_MAINTAINER:pn-ruby = "Ross Burton <[email protected]>"
 RECIPE_MAINTAINER:pn-run-postinsts = "Ross Burton <[email protected]>"
 RECIPE_MAINTAINER:pn-rust = "Randy MacLeod <[email protected]>"
 RECIPE_MAINTAINER:pn-rust-cross-canadian-${TRANSLATED_TARGET_ARCH} = "Randy MacLeod <[email protected]>"
-RECIPE_MAINTAINER:pn-rust-source-1.96.1 = "Deepesh Varatharajan <[email protected]>"
+RECIPE_MAINTAINER:pn-rust-source-1.97.1 = "Deepesh Varatharajan <[email protected]>"
 RECIPE_MAINTAINER:pn-rxvt-unicode = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-sassc = "Simone Weiß <[email protected]>"
 RECIPE_MAINTAINER:pn-sato-icon-theme = "Richard Purdie <[email protected]>"
meta/conf/distro/include/tcmode-default.inc +1 -1
index 9fbfc80040..dbd5473d1d 100644
@@ -12,7 +12,7 @@ PREFERRED_PROVIDER_virtual/gettext ??= "gettext"
 GCCVERSION ?= "16.%"
 SDKGCCVERSION ?= "${GCCVERSION}"
 GLIBCVERSION ?= "2.44%"
-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
index 4111d72044..fa8a8c1e7c 100644
@@ -82,7 +82,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',
@@ -92,6 +92,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/clang/clang/0043-LoopUnroll-Iterate-exit-fold-candidates-in-determini.patch new file +71 -0

71 lines not on this page · raw message

meta/recipes-devtools/clang/common.inc +1 -0
index e13f1c899d..e1e03872cd 100644
@@ -61,6 +61,7 @@ SRC_URI = "\
     file://0040-libcxxabi-declare-__gnu_unwind_frame-in-cxa_personal.patch \
     file://0041-Consolidate-and-fix-sysroot-based-compiler-rt-search.patch \
     file://0042-guard-clang-tools-extra-test.patch \
+    file://0043-LoopUnroll-Iterate-exit-fold-candidates-in-determini.patch \
 "
 # Fallback to no-PIE if not set
 GCCPIE ??= ""
meta/recipes-devtools/rust/cargo_1.97.1.bb renamed from meta/recipes-devtools/rust/cargo_1.96.1.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/rust/cargo_1.96.1.bb
rename to meta/recipes-devtools/rust/cargo_1.97.1.bb
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
deleted file mode 100644
index 7df6800c45..0000000000
@@ -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/files/0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch deleted +0 -28
deleted file mode 100644
index 8c93624df7..0000000000
@@ -1,28 +0,0 @@
-Backport a commit that remap OUT_DIR paths to fix build script path leakage in artifacts
-
-Upstream-Status: Backport [https://github.com/rust-lang/rust/commit/e743a4db62336027dcc1f1a755f4ca35f56b67df]
-
-Signed-off-by: Deepesh Varatharajan <[email protected]>
-
-diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
-index f785254..0264667 100644
---- a/src/bootstrap/src/core/builder/cargo.rs
-+++ b/src/bootstrap/src/core/builder/cargo.rs
-@@ -1077,6 +1077,8 @@ impl Builder<'_> {
-                         // rustc creates absolute paths (in part bc of the `rust-src` unremap
-                         // and for working directory) so let's remap the build directory as well.
-                         format!("{}={map_to}", self.build.src.display()),
-+                        // remap OUT_DIR so they don't leak into artifacts.
-+                        format!("{}={map_to}/out", self.build.out.display()),
-                     ]
-                     .join("\t");
-                     cargo.env("RUSTC_DEBUGINFO_MAP", map);
-@@ -1097,6 +1099,8 @@ impl Builder<'_> {
-                         // rustc creates absolute paths (in part bc of the `rust-src` unremap
-                         // and for working directory) so let's remap the build directory as well.
-                         format!("{}={map_to}", self.build.src.display()),
-+                        // remap OUT_DIR so they don't leak into artifacts.
-+                        format!("{}={map_to}/out", self.build.out.display()),
-                     ]
-                     .join("\t");
-                     cargo.env("RUSTC_DEBUGINFO_MAP", map);
meta/recipes-devtools/rust/libstd-rs_1.97.1.bb renamed from meta/recipes-devtools/rust/libstd-rs_1.96.1.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/rust/libstd-rs_1.96.1.bb
rename to meta/recipes-devtools/rust/libstd-rs_1.97.1.bb
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
similarity index 100%
rename from meta/recipes-devtools/rust/rust-cross-canadian_1.96.1.bb
rename to meta/recipes-devtools/rust/rust-cross-canadian_1.97.1.bb
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 -5
index 7b10eef9a6..68f3009a7b 100644
@@ -5,13 +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} \
-            file://0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch;patchdir=${RUSTSRC} \
 "
-SRC_URI[rust.sha256sum] = "77a6ff3003a4ad0cb00697b043c879e3e1a15d945b1a1f63818903bfc3fa8b98"
+SRC_URI[rust.sha256sum] = "0ed06fdaffd4722a7702e0b4eebfafc897ab8f513e8e1b247cdd7e5c6df6ded2"
 
 # Point UNPACKDIR into the work-shared location so rust-source.bb and all
 # consumers (via S/RUSTSRC) reference a single shared source tree.
meta/recipes-devtools/rust/rust-source_1.97.1.bb renamed from meta/recipes-devtools/rust/rust-source_1.96.1.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/rust/rust-source_1.96.1.bb
rename to meta/recipes-devtools/rust/rust-source_1.97.1.bb
meta/recipes-devtools/rust/rust_1.97.1.bb renamed from meta/recipes-devtools/rust/rust_1.96.1.bb +3 -0
similarity index 98%
rename from meta/recipes-devtools/rust/rust_1.96.1.bb
rename to meta/recipes-devtools/rust/rust_1.97.1.bb
index 82cb80a256..1f4ce5ebdb 100644
@@ -286,6 +286,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() {
@@ -322,6 +323,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
 
 }
 
@@ -346,6 +348,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