From 0fcf1b23aec5e5a341ba79e748a6f65d11f46d18 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Fri, 13 Feb 2026 08:58:17 +0700 Subject: [PATCH] Reduce llvm link during bootstrap --- recipes/archives/zstd/recipe.toml | 2 +- recipes/dev/llvm21/recipe.toml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/recipes/archives/zstd/recipe.toml b/recipes/archives/zstd/recipe.toml index 906848506..2e723f8c6 100644 --- a/recipes/archives/zstd/recipe.toml +++ b/recipes/archives/zstd/recipe.toml @@ -6,7 +6,7 @@ patches = [ [build] template = "custom" script = """ -DYNAMIC_INIT +DYNAMIC_STATIC_INIT rsync -av --delete "${COOKBOOK_SOURCE}/" ./ ${COOKBOOK_MAKE} ${COOKBOOK_MAKE} install DESTDIR="${COOKBOOK_STAGE}" prefix="/usr" diff --git a/recipes/dev/llvm21/recipe.toml b/recipes/dev/llvm21/recipe.toml index 6b87a1b42..784ed391d 100644 --- a/recipes/dev/llvm21/recipe.toml +++ b/recipes/dev/llvm21/recipe.toml @@ -13,6 +13,7 @@ dependencies = [ dev-dependencies = [ "host:xz", "host:libarchive", # workaround for cmake error + "host:zstd" ] script = """ DYNAMIC_INIT @@ -59,6 +60,15 @@ COOKBOOK_CMAKE_FLAGS+=( -DUNIX=1 ) +if [ "${COOKBOOK_HOST_SYSROOT}" = "/usr" ]; then +# avoid linking as much as possible during bootstrapping + COOKBOOK_CMAKE_FLAGS+=( + -DLLVM_ENABLE_LIBXML2=Off + -DLLVM_ENABLE_ZLIB=Off + -DLLVM_USE_STATIC_ZSTD=On + ) +fi + COOKBOOK_SOURCE="$COOKBOOK_SOURCE/llvm" cookbook_cmake """