From f4527d850d17dc1e40f271817e148cf8d5ff1233 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 3 Mar 2024 17:34:46 +0900 Subject: [PATCH] linux-musl: Add patch to fix build error on hexagon https://github.com/rust-lang/rust/pull/121666 caused regression on hexagon linux-musl: ``` ld.lld: error: undefined symbol: pthread_getname_np ``` --- .../std+hexagon-unknown-linux-musl.diff | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 docker/test-base/patches/std+hexagon-unknown-linux-musl.diff diff --git a/docker/test-base/patches/std+hexagon-unknown-linux-musl.diff b/docker/test-base/patches/std+hexagon-unknown-linux-musl.diff new file mode 100644 index 0000000..a681c20 --- /dev/null +++ b/docker/test-base/patches/std+hexagon-unknown-linux-musl.diff @@ -0,0 +1,24 @@ +diff --git a/src/sys/pal/unix/thread.rs b/src/sys/pal/unix/thread.rs +index 2af6382..acf3ecb 100644 +--- a/src/sys/pal/unix/thread.rs ++++ b/src/sys/pal/unix/thread.rs +@@ -225,7 +225,9 @@ pub fn set_name(_name: &CStr) { + // Newlib, Emscripten, and VxWorks have no way to set a thread name. + } + +- #[cfg(target_os = "linux")] ++ // Qualcomm fork of musl doesn't have pthread_getname_np. ++ // https://github.com/quic/musl/blob/7243e0d3a9d7e0f08d21fc194a05749e0bb26725/include/pthread.h ++ #[cfg(all(target_os = "linux", not(target_arch = "hexagon")))] + pub fn get_name() -> Option { + const TASK_COMM_LEN: usize = 16; + let mut name = vec![0u8; TASK_COMM_LEN]; +@@ -253,7 +255,7 @@ pub fn get_name() -> Option { + } + + #[cfg(not(any( +- target_os = "linux", ++ all(target_os = "linux", not(target_arch = "hexagon")), + target_os = "macos", + target_os = "ios", + target_os = "tvos",