From 726cc0788cd7a211d67871e5844f33ab54ad4293 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Tue, 3 Mar 2026 23:38:21 +0700 Subject: [PATCH] Fix rust recipe linker flag, remove libxml2 from llvm --- recipes/dev/lld21/recipe.toml | 10 +--------- recipes/dev/llvm21/recipe.toml | 13 +------------ recipes/dev/rust/recipe.toml | 5 +---- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/recipes/dev/lld21/recipe.toml b/recipes/dev/lld21/recipe.toml index d3f0c892..bce4c663 100644 --- a/recipes/dev/lld21/recipe.toml +++ b/recipes/dev/lld21/recipe.toml @@ -10,8 +10,6 @@ dependencies = [ dev-dependencies = [ "llvm21.dev", "llvm21.runtime", - "host:xz", - "host:libarchive", # workaround for cmake error ] script = """ DYNAMIC_INIT @@ -28,6 +26,7 @@ fi COOKBOOK_CMAKE_FLAGS+=( -DLLVM_ROOT="${COOKBOOK_SYSROOT}" -DCROSS_TOOLCHAIN_FLAGS_NATIVE="-DCMAKE_TOOLCHAIN_FILE=$(realpath native.cmake)" + -DLLVM_USE_STATIC_ZSTD=On # the shared options from llvm -DCMAKE_CXX_FLAGS="--std=gnu++11" @@ -47,13 +46,6 @@ COOKBOOK_CMAKE_FLAGS+=( -DUNIX=1 ) -if [ "${COOKBOOK_HOST_SYSROOT}" = "/usr" ]; then -# avoid linking as much as possible during bootstrapping - COOKBOOK_CMAKE_FLAGS+=( - -DLLVM_USE_STATIC_ZSTD=On - ) -fi - COOKBOOK_SOURCE="$COOKBOOK_SOURCE/lld" cookbook_cmake diff --git a/recipes/dev/llvm21/recipe.toml b/recipes/dev/llvm21/recipe.toml index e5454478..a2b11e11 100644 --- a/recipes/dev/llvm21/recipe.toml +++ b/recipes/dev/llvm21/recipe.toml @@ -8,11 +8,6 @@ shallow_clone = true template = "custom" dependencies = [ "zstd", - "libxml2", -] -dev-dependencies = [ - "host:xz", - "host:libarchive", # workaround for cmake error ] script = """ DYNAMIC_INIT @@ -41,6 +36,7 @@ COOKBOOK_CMAKE_FLAGS+=( -DLLVM_TARGETS_TO_BUILD="$LLVM_TARGETS_TO_BUILD" -DLLVM_ENABLE_ZLIB=Off -DLLVM_USE_STATIC_ZSTD=On + -DLLVM_ENABLE_LIBXML2=Off # the rest of options that shared to clang -DCROSS_TOOLCHAIN_FLAGS_NATIVE="-DCMAKE_TOOLCHAIN_FILE=$(realpath "${COOKBOOK_RECIPE}/native.cmake")" @@ -61,13 +57,6 @@ 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 - ) -fi - COOKBOOK_SOURCE="$COOKBOOK_SOURCE/llvm" cookbook_cmake """ diff --git a/recipes/dev/rust/recipe.toml b/recipes/dev/rust/recipe.toml index 671a9511..e6a60bce 100644 --- a/recipes/dev/rust/recipe.toml +++ b/recipes/dev/rust/recipe.toml @@ -30,10 +30,7 @@ DYNAMIC_INIT # Linker flags for stage2 compiler (host -> target) ARCH="${TARGET%%-*}" export LDFLAGS_${ARCH}_unknown_redox="${LDFLAGS}" # LLVM -export CARGO_TARGET_${ARCH}_UNKNOWN_REDOX_RUSTFLAGS="\ --Clink-args=-L${COOKBOOK_SYSROOT}/lib \ --Clink-args=-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib \ --Clink-args=-lz -Clink-args=-lzstd" +export CARGO_TARGET_${ARCH^^}_UNKNOWN_REDOX_RUSTFLAGS="${RUSTFLAGS}" # Rust # Hack for Rust errorneusly running `llvm-config --version` on cross compiled llvm-config cat "${COOKBOOK_ROOT}/bin/${TARGET}-llvm-config" > "${COOKBOOK_SYSROOT}/bin/llvm-config" # Hack for Rust stage1 being dynamically linked with LLVM in prefix toolchain