From e9c890cbb2c8c15d5db41d56b99878e500edeed0 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 10 Apr 2026 00:59:14 +0900 Subject: [PATCH] internal/rosa/llvm: enable cross compilation This now passes the test suite. Signed-off-by: Ophestra --- internal/rosa/llvm.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/internal/rosa/llvm.go b/internal/rosa/llvm.go index e68ab6aa..7424a2fd 100644 --- a/internal/rosa/llvm.go +++ b/internal/rosa/llvm.go @@ -216,17 +216,19 @@ index 9da357a7ebb9..b2931510c1ae 100644 // newLLVM returns LLVM toolchain across multiple [pkg.Artifact]. func (t Toolchain) newLLVM() (musl, compilerRT, runtimes, clang pkg.Artifact) { - var target string - switch runtime.GOARCH { - case "386", "amd64": - target = "X86" - case "arm64": - target = "AArch64" - case "riscv64": - target = "RISCV" + target := "'AArch64;RISCV;X86'" + if t.isStage0() { + switch runtime.GOARCH { + case "386", "amd64": + target = "X86" + case "arm64": + target = "AArch64" + case "riscv64": + target = "RISCV" - default: - panic("unsupported target " + runtime.GOARCH) + default: + panic("unsupported target " + runtime.GOARCH) + } } minimalDeps := []KV{ @@ -248,7 +250,7 @@ func (t Toolchain) newLLVM() (musl, compilerRT, runtimes, clang pkg.Artifact) { {"CMAKE_CXX_COMPILER_TARGET", ""}, {"COMPILER_RT_BUILD_BUILTINS", "ON"}, - {"COMPILER_RT_DEFAULT_TARGET_ONLY", "ON"}, + {"COMPILER_RT_DEFAULT_TARGET_ONLY", "OFF"}, {"COMPILER_RT_SANITIZERS_TO_BUILD", "asan"}, {"LLVM_ENABLE_PER_TARGET_RUNTIME_DIR", "ON"},