From 91be62ae2553c462e1308f5160b9673962986803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kl=C3=B6tzke?= Date: Thu, 18 Dec 2025 07:57:40 +0100 Subject: [PATCH 1/2] devel::llvm: enable RTTI for host-tools too The host-tools llvm variant has to be built the same way as the "real" cross-compiled variant. Otherwise, llvm-config will report a wrong value for "llvm-config --has-rtti". --- recipes/devel/llvm.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/devel/llvm.yaml b/recipes/devel/llvm.yaml index c41ebc4..a7abc8f 100644 --- a/recipes/devel/llvm.yaml +++ b/recipes/devel/llvm.yaml @@ -58,6 +58,7 @@ multiPackage: buildScript: | cmakeBuild $1/llvm \ -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_ENABLE_RTTI=ON \ -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" \ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS}" \ -DLLVM_INCLUDE_BENCHMARKS=OFF \ From b52b79fd0ed73bdc05defc169f70eaae38a92e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kl=C3=B6tzke?= Date: Thu, 18 Dec 2025 07:59:45 +0100 Subject: [PATCH 2/2] devel::llvm: use correct llvm-config when cross compiling When llvm is cross-compiled, the llvm-config executable is built for the target architecture. We pass a copy of llvm-config in devel::llvm-libs-dev which apparently requires a version that can be executed on the build machine. Use the one from the host-tool package unless llvm is not cross compiled. --- recipes/devel/llvm.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/recipes/devel/llvm.yaml b/recipes/devel/llvm.yaml index a7abc8f..b42c665 100644 --- a/recipes/devel/llvm.yaml +++ b/recipes/devel/llvm.yaml @@ -283,6 +283,13 @@ multiPackage: /usr/ /usr/lib/ /usr/lib/{clang,llvm}/"***" \ /usr/bin/ /usr/bin/llvm-config + # If we're cross-compiling, we need to take + # llvm-config from the host-tools package so that + # it can be executed at build time. + if [[ ${BOB_TOOL_PATHS[clang-host]:+true} ]] ; then + cp ${BOB_TOOL_PATHS[clang-host]}/llvm-config usr/bin/ + fi + # Add some wrapper scripts for all executables, # except llvm-config. The CMake exported targets # expect them relative to them and check this!