From 56e1ae0ccf8b5e206e0721c4dc22bd1e701966a9 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Mon, 21 Jul 2025 14:24:23 +0100 Subject: libclc: split out of clang Split the libclc subproject out of the clang recipe and into a dedicated libclc recipe. This is useful because libclc is the OpenCL runtime library and as such isn't target-specific and needs a native clang to build, not a target libllvm. Verified that nothing is dropped by adding clang and libclc to an image and verifying that the file list is the same before and after this change. We need to patch the libclc CMakeLists to allow it to use an out-of-tree prepare_builtins binary, discussion is ongoing with upstream to resolve this properly. (From OE-Core rev: 33a8742a1280b4c6779a7aa487c2dd4a713babe6) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/recipes-devtools/clang/clang_git.bb | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'meta/recipes-devtools/clang/clang_git.bb') diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb index 1210ca92de..a85626c45a 100644 --- a/meta/recipes-devtools/clang/clang_git.bb +++ b/meta/recipes-devtools/clang/clang_git.bb @@ -131,7 +131,7 @@ HF[vardepvalue] = "${HF}" # Ensure that LLVM_PROJECTS does not contain compiler runtime components e.g. libcxx etc # they are enabled via LLVM_ENABLE_RUNTIMES -LLVM_PROJECTS ?= "clang;clang-tools-extra;libclc;lld" +LLVM_PROJECTS ?= "clang;clang-tools-extra;lld" # linux hosts (.so) on Windows .pyd SOLIBSDEV:mingw32 = ".pyd" @@ -192,7 +192,7 @@ EXTRA_OECMAKE:append:class-target = "\ DEPENDS = "binutils zlib zstd libffi libxml2 libxml2-native ninja-native swig-native spirv-tools-native llvm-tblgen-native" DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_SYS} virtual/nativesdk-cross-binutils nativesdk-python3" -DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} python3 ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcxx', '', d)} spirv-llvm-translator-native" +DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} python3 ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcxx', '', d)}" RRECOMMENDS:${PN} = "binutils" RRECOMMENDS:${PN}:append:class-target = "${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', ' libcxx-dev', '', d)}" @@ -259,7 +259,6 @@ do_install:append:class-native () { install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clangd-indexer ${D}${bindir}/clangd-indexer fi install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tidy-confusable-chars-gen ${D}${bindir}/clang-tidy-confusable-chars-gen - install -Dm 0755 ${B}${BINPATHPREFIX}/bin/prepare_builtins ${D}${bindir}/prepare_builtins for f in `find ${D}${bindir} -executable -type f -not -type l`; do test -n "`file -b $f|grep -i ELF`" && ${STRIP} $f @@ -295,11 +294,11 @@ do_install:append:class-nativesdk () { fi } -PROVIDES:append:class-native = " llvm-native libclc-native" -PROVIDES:append:class-target = " llvm libclc" -PROVIDES:append:class-nativesdk = " nativesdk-llvm nativesdk-libclc" +PROVIDES:append:class-native = " llvm-native" +PROVIDES:append:class-target = " llvm" +PROVIDES:append:class-nativesdk = " nativesdk-llvm" -PACKAGES =+ "${PN}-libllvm ${PN}-libclang-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools ${PN}-clc \ +PACKAGES =+ "${PN}-libllvm ${PN}-libclang-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools \ libclang llvm-linker-tools" BBCLASSEXTEND = "native nativesdk" @@ -316,8 +315,6 @@ RDEPENDS:${PN}-tools += "\ perl-module-term-ansicolor \ " -RPROVIDES:${PN}-clc = "${MLPREFIX}libclc" - RRECOMMENDS:${PN}-tidy += "${PN}-tools" FILES:llvm-linker-tools = "${libdir}/LLVMgold* ${libdir}/libLTO.so.* ${libdir}/LLVMPolly*" @@ -384,8 +381,6 @@ FILES:${PN} += "\ ${nonarch_libdir}/${BPN}/*/include/ \ " -FILES:${PN}-clc += "${datadir}/clc" - FILES:${PN}-libllvm =+ "\ ${libdir}/libLLVM.so.${MAJOR_VER}.${MINOR_VER} \ ${libdir}/libLLVM-${MAJOR_VER}.so \ -- cgit v1.2.3-54-g00ecf