prefix: propagate AMDGPU/NVPTX host LLVM into the redoxer toolchain

clang-install now cooks host:llvm21 (which carries AMDGPU;NVPTX). rsync its
host LLVM (llvm-config + libs + llvm headers) into ~/.redoxer/toolchain so the
host llvm-config the Mesa build reads reports the amdgpu module (mesa's
dependency('llvm', modules: amdgpu) otherwise fails against the toolchain's
downloaded X86-only LLVM). Mirrors the existing relibc->toolchain propagation;
rsync without --delete preserves the toolchain's gcc/rust/redox-target files.
This commit is contained in:
2026-07-31 11:10:52 +03:00
parent ce8359342c
commit 448800aea9
+16
View File
@@ -493,6 +493,22 @@ endif
cp -r "$(CLANG_TARGET)/stage/usr/". "$@.partial"
cp -r "$(LLD_TARGET)/stage/usr/". "$@.partial"
mv "$@.partial" "$@"
# Propagate the freshly-built host LLVM (which now carries the AMDGPU + NVPTX GPU
# backends per recipes/dev/llvm21) into the redoxer toolchain. The Mesa build
# reads a host llvm-config through bin/x86_64-unknown-redox-llvm-config, which
# execs $COOKBOOK_HOST_SYSROOT/bin/llvm-config (= this toolchain). The toolchain
# ships a downloaded X86-only LLVM, so without this sync mesa's
# dependency('llvm', modules: [... amdgpu ...]) reports amdgpu(missing) and the
# GPU driver build fails. rsync WITHOUT --delete so the toolchain's gcc/rust and
# redox-target files are preserved; only the (same-version, 21.1.2) LLVM
# binaries/libs/headers/cmake are updated to the AMDGPU/NVPTX build.
@REDOXER_TC=$(HOME)/.redoxer/$(TARGET)/toolchain; \
if [ -d "$$REDOXER_TC/bin" ]; then \
rsync -a "$@/bin/llvm-config" "$$REDOXER_TC/bin/llvm-config"; \
rsync -a "$@/lib/" "$$REDOXER_TC/lib/"; \
rsync -a "$@/include/llvm" "$@/include/llvm-c" "$$REDOXER_TC/include/" 2>/dev/null || true; \
echo " [toolchain] synced AMDGPU/NVPTX host LLVM into redoxer toolchain"; \
fi
# no longer needed, delete build files to save disk space
rm -rf $(LLVM_TARGET) $(CLANG_TARGET) $(LLD_TARGET)
endif