From b2d9a31a4f4364230aa477a32494c28937f9e042 Mon Sep 17 00:00:00 2001 From: vasilito Date: Fri, 31 Jul 2026 05:16:36 +0300 Subject: [PATCH] llvm-native: LLVM_USE_HOST_TOOLS=OFF to kill the native sub-build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Even with LLVM_TABLEGEN/CLANG_TABLEGEN provided, LLVM_USE_HOST_TOOLS defaults ON when cross-compiling, so llvm/CMakeLists.txt creates the NATIVE external project (llvm_create_cross_target LLVM NATIVE) — a full second HOST LLVM build that inherits the Redox cross flags and died compiling native llvm-config. We already supply the only native tools a cross-build needs (the tablegens), so OFF eliminates the native sub-build entirely; LLVM uses the provided host tblgens for .inc generation. Completes the llvm-native cross-build fix chain (native-link, OPTIMIZED_TABLEGEN, LLVM_TABLEGEN var name, and now this). Co-Authored-By: Claude Fable 5 --- local/recipes/dev/llvm-native/recipe.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/local/recipes/dev/llvm-native/recipe.toml b/local/recipes/dev/llvm-native/recipe.toml index 42b6f9298a..7c498da9fc 100644 --- a/local/recipes/dev/llvm-native/recipe.toml +++ b/local/recipes/dev/llvm-native/recipe.toml @@ -98,6 +98,15 @@ COOKBOOK_CMAKE_FLAGS+=( # LLVM 21.1.2). LLVM_OPTIMIZED_TABLEGEN=On would build a second optimized # native tblgen instead of using them. Off => LLVM uses what we provide. -DLLVM_OPTIMIZED_TABLEGEN=Off + # OFF is REQUIRED here. LLVM_USE_HOST_TOOLS defaults ON when cross-compiling + # and makes llvm/CMakeLists.txt create the NATIVE external project + # (llvm_create_cross_target LLVM NATIVE), a full second host LLVM build that + # inherits the Redox cross flags and dies compiling native llvm-config/etc. + # We already supply host-runnable, version-matched tblgens via + # LLVM_TABLEGEN/CLANG_TABLEGEN (the only native tools a cross-build needs), + # so the NATIVE project is pure waste. OFF => no native sub-build; LLVM uses + # the provided tblgens for .inc generation. + -DLLVM_USE_HOST_TOOLS=OFF -DLLVM_TARGET_ARCH=$ARCH -DLLVM_TOOLS_INSTALL_DIR=bin -DLLVM_UTILS_INSTALL_DIR=bin