Skip to content

Commit b5209a9

Browse files
Yashinde145DeepeshWR
authored andcommitted
rust: Upgrade 1.90.0 -> 1.91.0
https://blog.rust-lang.org/2025/10/30/Rust-1.91.0/ * Recent updates to rustc now require 'target_pointer_width' to be specified as an integer. Cast it to 'int' in rust target configuration to resolve the type consistency error. rust-lang/rust#144443 * The "remote-test-server" bin is now generated in stage2-tools-bin dir rather than stage1. Update the test suite and recipe accordingly. * Rebase existing patches with v1.91.0. * Drop merged patches with rust v1.91.0. - 0001-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch llvm/llvm-project@bcc31a9 Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
1 parent b7ea6c4 commit b5209a9

12 files changed

+75
-162
lines changed

meta/classes-recipe/rust-target-config.bbclass

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def rust_gen_target(d, thing, wd, arch):
385385
if tspec['data-layout'] is None:
386386
bb.fatal("No rust target defined for %s" % arch_abi)
387387
tspec['max-atomic-width'] = int(d.getVarFlag('MAX_ATOMIC_WIDTH', arch_abi))
388-
tspec['target-pointer-width'] = d.getVarFlag('TARGET_POINTER_WIDTH', arch_abi)
388+
tspec['target-pointer-width'] = int(d.getVarFlag('TARGET_POINTER_WIDTH', arch_abi))
389389
tspec['target-c-int-width'] = int(d.getVarFlag('TARGET_C_INT_WIDTH', arch_abi))
390390
tspec['target-endian'] = d.getVarFlag('TARGET_ENDIAN', arch_abi)
391391
tspec['arch'] = arch_to_rust_target_arch(rust_arch)

meta/conf/distro/include/tcmode-default.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ PREFERRED_PROVIDER_virtual/gettext ??= "gettext"
1212
GCCVERSION ?= "15.%"
1313
SDKGCCVERSION ?= "${GCCVERSION}"
1414
GLIBCVERSION ?= "2.42%"
15-
RUSTVERSION ?= "1.90.0%"
15+
RUSTVERSION ?= "1.91.0%"
1616

1717
PREFERRED_VERSION_gcc ?= "${GCCVERSION}"
1818
PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}"

meta/lib/oeqa/selftest/cases/rust.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def test_rust(self, *args, **kwargs):
9393
'tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs',
9494
'tests/ui/feature-gates/version_check.rs',
9595
'tests/ui-fulldeps/',
96+
'tests/ui/panics/panic-abort-backtrace-without-debuginfo.rs',
9697
'tests/ui/process/nofile-limit.rs',
9798
'tidyselftest'
9899
]
@@ -108,7 +109,7 @@ def test_rust(self, *args, **kwargs):
108109
# Copy remote-test-server to image through scp
109110
host_sys = get_bb_var("RUST_BUILD_SYS", "rust")
110111
ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user="root")
111-
ssh.copy_to(builddir + "/build/" + host_sys + "/stage1-tools-bin/remote-test-server","~/")
112+
ssh.copy_to(builddir + "/build/" + host_sys + "/stage2-tools-bin/remote-test-server","~/")
112113
# Execute remote-test-server on image through background ssh
113114
command = '~/remote-test-server --bind 0.0.0.0:12345 -v'
114115
sshrun=subprocess.Popen(("ssh", '-o', 'UserKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no', '-f', "root@%s" % qemu.ip, command), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

meta/recipes-devtools/rust/files/0001-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch

Lines changed: 0 additions & 66 deletions
This file was deleted.

meta/recipes-devtools/rust/files/0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core
2424
index 087df2f8a..00790affb 100644
2525
--- a/src/bootstrap/src/core/build_steps/tool.rs
2626
+++ b/src/bootstrap/src/core/build_steps/tool.rs
27-
@@ -16,14 +16,12 @@ use std::{env, fs};
28-
#[cfg(feature = "tracing")]
29-
use tracing::instrument;
27+
@@ -13,14 +13,12 @@ use std::ffi::OsStr;
28+
use std::path::PathBuf;
29+
use std::{env, fs};
3030

3131
-use crate::core::build_steps::compile::is_lto_stage;
3232
use crate::core::build_steps::toolstate::ToolState;
@@ -41,14 +41,16 @@ index 087df2f8a..00790affb 100644
4141
+use crate::core::config::{DebuginfoLevel, TargetSelection};
4242
use crate::utils::exec::{BootstrapCommand, command};
4343
use crate::utils::helpers::{add_dylib_path, exe, t};
44-
use crate::{Compiler, FileType, Kind, Mode, gha};
45-
@@ -160,20 +158,7 @@ impl Step for ToolBuild {
44+
use crate::{Compiler, FileType, Kind, Mode};
45+
@@ -121,22 +119,7 @@ impl Step for ToolBuild {
4646
cargo.env("RUSTC_WRAPPER", ccache);
4747
}
4848

49-
- // Rustc tools (miri, clippy, cargo, rustfmt, rust-analyzer)
49+
- // RustcPrivate tools (miri, clippy, rustfmt, rust-analyzer) and cargo
5050
- // could use the additional optimizations.
51-
- if self.mode == Mode::ToolRustc && is_lto_stage(&self.build_compiler) {
51+
- if is_lto_stage(&self.build_compiler)
52+
- && (self.mode == Mode::ToolRustcPrivate || self.path == "src/tools/cargo")
53+
- {
5254
- let lto = match builder.config.rust_lto {
5355
- RustcLto::Off => Some("off"),
5456
- RustcLto::Thin => Some("thin"),
@@ -67,12 +69,12 @@ index 087df2f8a..00790affb 100644
6769
diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs
6870
--- a/src/bootstrap/src/core/builder/mod.rs
6971
+++ b/src/bootstrap/src/core/builder/mod.rs
70-
@@ -13,7 +13,7 @@
72+
@@ -13,7 +13,7 @@ use clap::ValueEnum;
7173
#[cfg(feature = "tracing")]
7274
use tracing::instrument;
7375

7476
-pub use self::cargo::{Cargo, cargo_profile_var};
7577
+pub use self::cargo::Cargo;
7678
pub use crate::Compiler;
7779
use crate::core::build_steps::compile::{Std, StdLink};
78-
use crate::core::build_steps::{
80+
use crate::core::build_steps::tool::RustcPrivateCompilers;

meta/recipes-devtools/rust/files/rust-oe-selftest.patch

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Signed-off-by: Peter Tatrai <Peter.Tatrai@siemens.com>
1010
diff --git a/compiler/rustc_errors/src/markdown/tests/term.rs b/compiler/rustc_errors/src/markdown/tests/term.rs
1111
--- a/compiler/rustc_errors/src/markdown/tests/term.rs
1212
+++ b/compiler/rustc_errors/src/markdown/tests/term.rs
13-
@@ -61,6 +61,7 @@ fn test_wrapping_write() {
13+
@@ -62,6 +62,7 @@ fn test_wrapping_write() {
1414
}
1515

1616
#[test]
@@ -21,23 +21,23 @@ diff --git a/compiler/rustc_errors/src/markdown/tests/term.rs b/compiler/rustc_e
2121
diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs
2222
--- a/compiler/rustc_interface/src/tests.rs
2323
+++ b/compiler/rustc_interface/src/tests.rs
24-
@@ -137,6 +137,7 @@ fn assert_non_crate_hash_different(x: &Options, y: &Options) {
24+
@@ -147,6 +147,7 @@ fn assert_non_crate_hash_different(x: &Options, y: &Options) {
2525

2626
// When the user supplies --test we should implicitly supply --cfg test
2727
#[test]
2828
+#[ignore]
2929
fn test_switch_implies_cfg_test() {
3030
sess_and_cfg(&["--test"], |_sess, cfg| {
3131
assert!(cfg.contains(&(sym::test, None)));
32-
@@ -145,6 +146,7 @@ fn test_switch_implies_cfg_test() {
32+
@@ -155,6 +156,7 @@ fn test_switch_implies_cfg_test() {
3333

3434
// When the user supplies --test and --cfg test, don't implicitly add another --cfg test
3535
#[test]
3636
+#[ignore]
3737
fn test_switch_implies_cfg_test_unless_cfg_test() {
3838
sess_and_cfg(&["--test", "--cfg=test"], |_sess, cfg| {
3939
let mut test_items = cfg.iter().filter(|&&(name, _)| name == sym::test);
40-
@@ -154,6 +156,7 @@ fn test_switch_implies_cfg_test_unless_cfg_test() {
40+
@@ -164,6 +166,7 @@ fn test_switch_implies_cfg_test_unless_cfg_test() {
4141
}
4242

4343
#[test]
@@ -49,86 +49,62 @@ diff --git a/library/std/tests/sync/rwlock.rs b/library/std/tests/sync/rwlock.rs
4949
index 1a9d3d3f12f..0a9cfc48806 100644
5050
--- a/library/std/tests/sync/rwlock.rs
5151
+++ b/library/std/tests/sync/rwlock.rs
52-
@@ -74,6 +74,7 @@
52+
@@ -605,6 +605,7 @@
5353

5454
#[test]
5555
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
5656
+#[ignore]
5757
fn test_rw_arc_poison_wr() {
5858
let arc = Arc::new(RwLock::new(1));
5959
let arc2 = arc.clone();
60-
@@ -87,6 +88,7 @@
60+
@@ -618,6 +619,7 @@
6161

6262
#[test]
6363
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
6464
+#[ignore]
6565
fn test_rw_arc_poison_mapped_w_r() {
6666
let arc = Arc::new(RwLock::new(1));
6767
let arc2 = arc.clone();
68-
@@ -101,6 +103,7 @@
68+
@@ -632,6 +634,7 @@
6969

7070
#[test]
7171
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
7272
+#[ignore]
7373
fn test_rw_arc_poison_ww() {
7474
let arc = Arc::new(RwLock::new(1));
7575
assert!(!arc.is_poisoned());
76-
@@ -115,6 +118,7 @@
76+
@@ -646,6 +649,7 @@
7777
}
7878

7979
#[test]
8080
+#[ignore]
8181
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
8282
fn test_rw_arc_poison_mapped_w_w() {
8383
let arc = Arc::new(RwLock::new(1));
84-
@@ -131,6 +135,7 @@
84+
@@ -662,6 +666,7 @@
8585

8686
#[test]
8787
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
8888
+#[ignore]
8989
fn test_rw_arc_no_poison_rr() {
9090
let arc = Arc::new(RwLock::new(1));
9191
let arc2 = arc.clone();
92-
@@ -160,6 +165,7 @@
92+
@@ -691,6 +696,7 @@
9393

9494
#[test]
9595
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
9696
+#[ignore]
9797
fn test_rw_arc_no_poison_rw() {
9898
let arc = Arc::new(RwLock::new(1));
9999
let arc2 = arc.clone();
100-
@@ -227,6 +233,7 @@
101-
102-
#[test]
103-
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
104-
+#[ignore]
105-
fn test_rw_arc_access_in_unwind() {
106-
let arc = Arc::new(RwLock::new(1));
107-
let arc2 = arc.clone();
108-
@@ -326,6 +333,7 @@
109-
110-
#[test]
111-
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
112-
+#[ignore]
113-
fn test_into_inner_poison() {
114-
let m = new_poisoned_rwlock(NonCopy(10));
115-
116-
@@ -362,6 +370,7 @@
117-
118-
#[test]
119-
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
120-
+#[ignore]
121-
fn test_get_mut_poison() {
122-
let mut m = new_poisoned_rwlock(NonCopy(10));
123-
124-
@@ -571,6 +571,7 @@
100+
@@ -794,6 +800,7 @@
125101

126102
#[test]
127103
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
128104
+#[ignore]
129105
fn panic_while_mapping_write_unlocked_poison() {
130106
let lock = RwLock::new(());
131-
107+
132108
diff --git a/library/test/src/tests.rs b/library/test/src/tests.rs
133109
--- a/library/test/src/tests.rs
134110
+++ b/library/test/src/tests.rs
@@ -143,15 +119,15 @@ diff --git a/library/test/src/tests.rs b/library/test/src/tests.rs
143119
diff --git a/library/std/tests/sync/mutex.rs b/library/std/tests/sync/mutex.rs
144120
--- a/library/std/tests/sync/mutex.rs
145121
+++ b/library/std/tests/sync/mutex.rs
146-
@@ -312,6 +312,7 @@
122+
@@ -472,6 +472,7 @@
147123

148124
#[test]
149125
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
150126
+#[ignore]
151127
fn test_mutex_arc_poison_mapped() {
152128
let arc = Arc::new(Mutex::new(1));
153129
assert!(!arc.is_poisoned());
154-
@@ -391,6 +392,7 @@
130+
@@ -388,6 +389,7 @@
155131

156132
#[test]
157133
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
@@ -308,13 +284,14 @@ diff --git a/tests/codegen-llvm/transmute-scalar.rs b/tests/codegen-llvm/transmu
308284
index ce1b0558b2e..e8fda2cd566 100644
309285
--- a/tests/codegen-llvm/transmute-scalar.rs
310286
+++ b/tests/codegen-llvm/transmute-scalar.rs
311-
@@ -1,5 +1,6 @@
287+
@@ -1,6 +1,7 @@
312288
//@ add-core-stubs
313-
//@ compile-flags: -C opt-level=0 -C no-prepopulate-passes
289+
//@ compile-flags: -C opt-level=0 -C no-prepopulate-passes --target=x86_64-unknown-linux-gnu
290+
//@ needs-llvm-components: x86
314291
+//@ ignore-riscv64
315292

316293
#![crate_type = "lib"]
317-
#![feature(no_core, repr_simd, arm_target_feature, mips_target_feature, s390x_target_feature)]
294+
#![feature(no_core, repr_simd)]
318295
diff --git a/tests/codegen-llvm/uninhabited-transparent-return-abi.rs b/tests/codegen-llvm/uninhabited-transparent-return-abi.rs
319296
index face1577c3f..09e0846bad0 100644
320297
--- a/tests/codegen-llvm/uninhabited-transparent-return-abi.rs

0 commit comments

Comments
 (0)