public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] libcxx: fix libunwind collision with musl builds
@ 2026-04-20 22:27 sunilkumar.dora
  0 siblings, 0 replies; only message in thread
From: sunilkumar.dora @ 2026-04-20 22:27 UTC (permalink / raw)
  To: openembedded-core
  Cc: ross.burton, raj.khem, SunilKumar.Dora, Sundeep.Kokkonda

From: Sunil Dora <sunilkumar.dora@windriver.com>

Commit 75409c60 (rust: enable fully static linking with TCLIBC=musl)
used install-unwind for musl builds which also installs libunwind.so
and libunwind.h, causing a file collision with the libunwind recipe.

Only libunwind.a is needed for Rust static musl linking. Since no
other recipe in oe-core builds LLVM libunwind, compile it
unconditionally for musl and use do_install to install only the
static library.

Reported-by: Ross Burton <ross.burton@arm.com>
Suggested-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
---
 meta/recipes-devtools/clang/libcxx_git.bb | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/clang/libcxx_git.bb b/meta/recipes-devtools/clang/libcxx_git.bb
index dff063ad8b..d7af23ddbc 100644
--- a/meta/recipes-devtools/clang/libcxx_git.bb
+++ b/meta/recipes-devtools/clang/libcxx_git.bb
@@ -32,9 +32,15 @@ OECMAKE_TARGET_COMPILE = "cxxabi cxx"
 OECMAKE_TARGET_INSTALL = "install-cxxabi install-cxx"
 
 # LLVM libunwind.a needed for static Rust musl builds.
-# GNU libunwind never produces .a on musl so no collision risk.
+# Install only static library to avoid collision with libunwind recipe.
 OECMAKE_TARGET_COMPILE:append:libc-musl = " unwind"
-OECMAKE_TARGET_INSTALL:append:libc-musl = " install-unwind"
+
+do_install:append:libc-musl() {
+    if [ -f ${B}/lib${LLVM_LIBDIR_SUFFIX}/libunwind.a ]; then
+        install -m 0644 ${B}/lib${LLVM_LIBDIR_SUFFIX}/libunwind.a \
+            ${D}${libdir}/libunwind.a
+    fi
+}
 
 CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
 CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
-- 
2.49.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-20 22:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 22:27 [PATCH] libcxx: fix libunwind collision with musl builds sunilkumar.dora

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox