summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rust/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/rust/files')
-rw-r--r--meta/recipes-devtools/rust/files/0001-Disable-libunwind-cross-architecture-unwinding.patch46
-rw-r--r--meta/recipes-devtools/rust/files/rust-oe-selftest.patch44
2 files changed, 46 insertions, 44 deletions
diff --git a/meta/recipes-devtools/rust/files/0001-Disable-libunwind-cross-architecture-unwinding.patch b/meta/recipes-devtools/rust/files/0001-Disable-libunwind-cross-architecture-unwinding.patch
new file mode 100644
index 0000000000..4a282032eb
--- /dev/null
+++ b/meta/recipes-devtools/rust/files/0001-Disable-libunwind-cross-architecture-unwinding.patch
@@ -0,0 +1,46 @@
1From 56b669cd7adcc413bb1e64c3d2d7c347a82ae35a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 21 May 2025 18:47:09 -0700
4Subject: [PATCH] Disable libunwind cross-architecture unwinding
5
6Building with _LIBUNWIND_IS_NATIVE_ONLY disables code for cross-architecture unwinding
7it is disabled by default in LLVM [1], replicate the cmake behavior in bootstrap process
8
9It also enables some additional code that handles PAC-specific unwind info
10it helps compiling with the -mbranch-protection=pac or -mbranch-protection=standard flags
11
12This fixes build with clang/musl on aarch64
13
14[1] https://github.com/llvm/llvm-project/commit/85624c5de3e831ffa01fdc2d159e3d69c30de08d
15
16Upstream-Status: Submitted [https://github.com/rust-lang/rust/pull/141375]
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18---
19 src/bootstrap/src/core/build_steps/llvm.rs | 3 +--
20 1 file changed, 1 insertion(+), 2 deletions(-)
21
22diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs
23index a3788197471..5e4a1c7d9f0 100644
24--- a/src/bootstrap/src/core/build_steps/llvm.rs
25+++ b/src/bootstrap/src/core/build_steps/llvm.rs
26@@ -1430,6 +1430,7 @@ fn run(self, builder: &Builder<'_>) -> Self::Output {
27 cfg.flag("-funwind-tables");
28 cfg.flag("-fvisibility=hidden");
29 cfg.define("_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS", None);
30+ cfg.define("_LIBUNWIND_IS_NATIVE_ONLY", "1");
31 cfg.include(root.join("include"));
32 cfg.cargo_metadata(false);
33 cfg.out_dir(&out_dir);
34@@ -1447,12 +1448,10 @@ fn run(self, builder: &Builder<'_>) -> Self::Output {
35 cfg.define("__NO_STRING_INLINES", None);
36 cfg.define("__NO_MATH_INLINES", None);
37 cfg.define("_LIBUNWIND_IS_BAREMETAL", None);
38- cfg.define("__LIBUNWIND_IS_NATIVE_ONLY", None);
39 cfg.define("NDEBUG", None);
40 }
41 if self.target.is_windows() {
42 cfg.define("_LIBUNWIND_HIDE_SYMBOLS", "1");
43- cfg.define("_LIBUNWIND_IS_NATIVE_ONLY", "1");
44 }
45 }
46
diff --git a/meta/recipes-devtools/rust/files/rust-oe-selftest.patch b/meta/recipes-devtools/rust/files/rust-oe-selftest.patch
index 909bc971db..048fc3f10b 100644
--- a/meta/recipes-devtools/rust/files/rust-oe-selftest.patch
+++ b/meta/recipes-devtools/rust/files/rust-oe-selftest.patch
@@ -103,50 +103,6 @@ index 1a9d3d3f12f..0a9cfc48806 100644
103 fn test_get_mut_poison() { 103 fn test_get_mut_poison() {
104 let mut m = new_poisoned_rwlock(NonCopy(10)); 104 let mut m = new_poisoned_rwlock(NonCopy(10));
105 105
106diff --git a/library/std/src/thread/tests.rs b/library/std/src/thread/tests.rs
107index 5d6b9e94ee9..a5aacb2eb87 100644
108--- a/library/std/src/thread/tests.rs
109+++ b/library/std/src/thread/tests.rs
110@@ -116,6 +116,7 @@ fn test_is_finished() {
111 }
112
113 #[test]
114+#[ignore]
115 fn test_join_panic() {
116 match thread::spawn(move || panic!()).join() {
117 result::Result::Err(_) => (),
118@@ -218,6 +219,7 @@ fn test_simple_newsched_spawn() {
119 }
120
121 #[test]
122+#[ignore]
123 fn test_try_panic_message_string_literal() {
124 match thread::spawn(move || {
125 panic!("static string");
126@@ -234,6 +236,7 @@ fn test_try_panic_message_string_literal() {
127 }
128
129 #[test]
130+#[ignore]
131 fn test_try_panic_any_message_owned_str() {
132 match thread::spawn(move || {
133 panic_any("owned string".to_string());
134@@ -250,6 +253,7 @@ fn test_try_panic_any_message_owned_str() {
135 }
136
137 #[test]
138+#[ignore]
139 fn test_try_panic_any_message_any() {
140 match thread::spawn(move || {
141 panic_any(Box::new(413u16) as Box<dyn Any + Send>);
142@@ -268,6 +272,7 @@ fn test_try_panic_any_message_any() {
143 }
144
145 #[test]
146+#[ignore]
147 fn test_try_panic_any_message_unit_struct() {
148 struct Juju;
149
150diff --git a/library/test/src/tests.rs b/library/test/src/tests.rs 106diff --git a/library/test/src/tests.rs b/library/test/src/tests.rs
151--- a/library/test/src/tests.rs 107--- a/library/test/src/tests.rs
152+++ b/library/test/src/tests.rs 108+++ b/library/test/src/tests.rs