From 18d270b25e6fc86c2125d7acfe356aca1f8ea4c0 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Thu, 3 Apr 2025 20:02:07 +0300 Subject: clang: remove LLVM files from sysroot if clang is not providing it Upcoming Mesa patches for OE-Core pull both LLVM and Clang into the sysroot if meta-clang is being used. Now as libLLVM.so in OE-Core is compatible with the one being built by Clang, remove LLVM artifacts from the native sysroot if clang recipe is not selected as LLVM provider. The spirv-llvm-translator recipe is changed to also DEPEND on llvm in order to pull the library into the chroot. Signed-off-by: Dmitry Baryshkov --- recipes-devtools/clang/clang_git.bb | 14 ++++++++++++++ .../spirv-llvm-translator/spirv-llvm-translator_git.bb | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 7ba1a11..dbc5fc5 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -289,6 +289,20 @@ do_install:append:class-native () { ln -sf clang-tblgen ${D}${bindir}/clang-tblgen${PV} ln -sf llvm-tblgen ${D}${bindir}/llvm-tblgen${PV} ln -sf llvm-config ${D}${bindir}/llvm-config${PV} + + if ${@ 'false' if 'llvm' in d.getVar('PROVIDES') or '' else 'true' } ; then + for f in bugpoint dsymutil llc lli opt reduce-chunk-list sancov sanstats verify-uselistorder ; do + rm -f ${D}${bindir}/$f + done + rm -f ${D}${bindir}/llvm-* + + rm -rf ${D}${includedir}/llvm + rm -rf ${D}${includedir}/llvm-c + rm -rf ${D}${libdir}/cmake/llvm + rm -rf ${D}${libdir}/libLLVM* + rm -rf ${D}${libdir}/libLTO* + rm -rf ${D}${libdir}/libRemarks* + fi } do_install:append:class-nativesdk () { diff --git a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb index c566f43..f6a5f64 100644 --- a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb +++ b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb @@ -14,7 +14,7 @@ SRCREV_FORMAT = "default_headers" S = "${WORKDIR}/git" -DEPENDS = "spirv-tools clang" +DEPENDS = "spirv-tools clang llvm" inherit cmake pkgconfig python3native -- cgit v1.2.3-54-g00ecf