llvm21: add AMDGPU LLVM target for Mesa radeonsi/radv (amd64-only)
Mesa's radeonsi/radv AMD-GPU drivers require the LLVM 'amdgpu' codegen backend
(dependency('llvm', modules: [... amdgpu ...])). llvm21 built X86 only, so the
host llvm-config the mesa build reads reported amdgpu(missing). Add AMDGPU to
LLVM_TARGETS_TO_BUILD (X86;AMDGPU per the amd64-only policy — AMDGPU is a GPU
backend, not a second CPU platform). This is the redox-target LLVM whose libs
mesa links AND the source of the prefix clang-install host LLVM. NB: the
~/.redoxer toolchain host llvm-config (a provisioned prebuilt) still needs the
rebuilt AMDGPU host-LLVM propagated into it (follow-up).
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user