From: Ross Burton Date: Wed, 24 Sep 2025 12:08:32 +0000 (+0100) Subject: clang: improve tablegen installation X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=93051e8730263cfc23e1230015a4789dac4914de;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git clang: improve tablegen installation Backport a patch from upstream to install lldb-tblgen, and change the llvm-tblgen-native recipe to use `cmake --install` instead of copying the binaries. This ensures that CMake does any post-install steps that are needed, and we don't install binaries that have eg RPATHs pointing at the build tree. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-devtools/clang/clang/0001-Install-lldb-tblgen.patch b/meta/recipes-devtools/clang/clang/0001-Install-lldb-tblgen.patch new file mode 100644 index 0000000000..c974167589 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0001-Install-lldb-tblgen.patch @@ -0,0 +1,29 @@ +From 7de6d35aeea2d06b1597539c47f6af30d2798d73 Mon Sep 17 00:00:00 2001 +From: Ross Burton +Date: Fri, 19 Sep 2025 16:33:55 +0100 +Subject: [PATCH] Install lldb-tblgen + +In keeping with the llvm-tblgen and clang-tblgen binaries, allow +lldb-tblgen to be installed by cmake so that cross builds are easier. + +Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/0ce6052a0c08035a07fcabb05271be7313308db3] +Signed-off-by: Ross Burton +--- + lldb/utils/TableGen/CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lldb/utils/TableGen/CMakeLists.txt b/lldb/utils/TableGen/CMakeLists.txt +index 0ac010bcda35..ce96dddd4420 100644 +--- a/lldb/utils/TableGen/CMakeLists.txt ++++ b/lldb/utils/TableGen/CMakeLists.txt +@@ -8,6 +8,7 @@ if (NOT DEFINED LLDB_TABLEGEN_EXE) + set(LLVM_LINK_COMPONENTS Support) + + add_tablegen(lldb-tblgen LLDB ++ DESTINATION "${CMAKE_INSTALL_BINDIR}" + LLDBOptionDefEmitter.cpp + LLDBPropertyDefEmitter.cpp + LLDBTableGen.cpp +-- +2.43.0 + diff --git a/meta/recipes-devtools/clang/common.inc b/meta/recipes-devtools/clang/common.inc index e01eb2d287..512bf1dd02 100644 --- a/meta/recipes-devtools/clang/common.inc +++ b/meta/recipes-devtools/clang/common.inc @@ -60,6 +60,7 @@ SRC_URI = "\ file://0037-Revert-libc-Remap-headers-in-the-debug-info-when-bui.patch \ file://0038-Prevent-revisiting-block-when-searching-for-noreturn.patch \ file://0039-Only-build-c-index-test-when-clang-tests-are-include.patch \ + file://0001-Install-lldb-tblgen.patch \ " # Fallback to no-PIE if not set GCCPIE ??= "" diff --git a/meta/recipes-devtools/clang/llvm-tblgen-native_git.bb b/meta/recipes-devtools/clang/llvm-tblgen-native_git.bb index be04c1aa4d..8023d74578 100644 --- a/meta/recipes-devtools/clang/llvm-tblgen-native_git.bb +++ b/meta/recipes-devtools/clang/llvm-tblgen-native_git.bb @@ -16,12 +16,10 @@ OECMAKE_SOURCEPATH = "${S}/llvm" EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS='llvm;clang;lldb'" -BINARIES = "llvm-min-tblgen llvm-tblgen clang-tblgen lldb-tblgen" - -OECMAKE_TARGET_COMPILE = "${BINARIES}" +OECMAKE_TARGET_COMPILE = "llvm-tblgen clang-tblgen lldb-tblgen" do_install() { - for f in ${BINARIES}; do - install -D ${B}/bin/$f ${D}${bindir}/$f + for TARGET in ${OECMAKE_TARGET_COMPILE}; do + DESTDIR=${D} cmake --install ${B} --component $TARGET done }