Skip to content

Commit f4527d8

Browse files
committed
linux-musl: Add patch to fix build error on hexagon
rust-lang/rust#121666 caused regression on hexagon linux-musl: ``` ld.lld: error: undefined symbol: pthread_getname_np ```
1 parent e8ba521 commit f4527d8

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/src/sys/pal/unix/thread.rs b/src/sys/pal/unix/thread.rs
2+
index 2af6382..acf3ecb 100644
3+
--- a/src/sys/pal/unix/thread.rs
4+
+++ b/src/sys/pal/unix/thread.rs
5+
@@ -225,7 +225,9 @@ pub fn set_name(_name: &CStr) {
6+
// Newlib, Emscripten, and VxWorks have no way to set a thread name.
7+
}
8+
9+
- #[cfg(target_os = "linux")]
10+
+ // Qualcomm fork of musl doesn't have pthread_getname_np.
11+
+ // https://github.com/quic/musl/blob/7243e0d3a9d7e0f08d21fc194a05749e0bb26725/include/pthread.h
12+
+ #[cfg(all(target_os = "linux", not(target_arch = "hexagon")))]
13+
pub fn get_name() -> Option<CString> {
14+
const TASK_COMM_LEN: usize = 16;
15+
let mut name = vec![0u8; TASK_COMM_LEN];
16+
@@ -253,7 +255,7 @@ pub fn get_name() -> Option<CString> {
17+
}
18+
19+
#[cfg(not(any(
20+
- target_os = "linux",
21+
+ all(target_os = "linux", not(target_arch = "hexagon")),
22+
target_os = "macos",
23+
target_os = "ios",
24+
target_os = "tvos",

0 commit comments

Comments
 (0)