diff --git a/recipes/dev/llvm21/recipe.toml b/recipes/dev/llvm21/recipe.toml index c210b8f07b..7a5492fb3b 100644 --- a/recipes/dev/llvm21/recipe.toml +++ b/recipes/dev/llvm21/recipe.toml @@ -68,14 +68,20 @@ set(ENV{CFLAGS} "") set(ENV{CXXFLAGS} "") NATIVE_EOF +# amd64-only (see local/AGENTS.md): the CPU target is X86 (= amd64/x86_64). +# AMDGPU is the GPU codegen backend Mesa's radeonsi/radv (AMD GPU) drivers +# require via `dependency('llvm', modules: [... amdgpu ...])` — without it the +# host llvm-config the mesa build reads reports amdgpu(missing) and mesa fails +# to configure. AMDGPU is a GPU backend, not a second CPU platform, so it does +# not violate amd64-only. case "${ARCH}" in - x86 | x86_64) LLVM_TARGETS_TO_BUILD="X86";; - aarch64) LLVM_TARGETS_TO_BUILD="AArch64";; - riscv64gc) LLVM_TARGETS_TO_BUILD="RISCV";; + x86 | x86_64) LLVM_TARGETS_TO_BUILD="X86;AMDGPU";; + aarch64) LLVM_TARGETS_TO_BUILD="AArch64;AMDGPU";; + riscv64gc) LLVM_TARGETS_TO_BUILD="RISCV;AMDGPU";; esac if [ "${COOKBOOK_HOST_SYSROOT}" = "/usr" ]; then - LLVM_TARGETS_TO_BUILD="X86;AArch64;RISCV" + LLVM_TARGETS_TO_BUILD="X86;AMDGPU" fi # This just build the LLVM library and tools just enough for Rust, to build the rest of LLVM see