libcxx: fix libunwind collision with musl builds
PATCH 1/1 libcxx: fix libunwind collision with musl builds
From: Sunil Dora <[email protected]>
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 <[email protected]>
Suggested-by Khem Raj <[email protected]>
Signed-off-by Sunil Dora <[email protected]>
--- meta/recipes-devtools/clang/libcxx_git.bb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
meta/recipes-devtools/clang/libcxx_git.bb +8 -2
@@ -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}"
Signature · 1 line
2.49.0