diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go index ebad810..6c4d585 100644 --- a/internal/rosa/rosa.go +++ b/internal/rosa/rosa.go @@ -111,6 +111,14 @@ const ( // toolchainStage3 denotes the Gentoo stage3 toolchain. Special care must be // taken to compile correctly against this toolchain. toolchainStage3 + + // toolchainIntermediate denotes the intermediate toolchain compiled against + // toolchainStage3. This toolchain should be functionally identical to [Std] + // and is used to bootstrap [Std]. + toolchainIntermediate + + // Std denotes the standard Rosa OS toolchain. + Std ) // lastIndexFunc is like [strings.LastIndexFunc] but for [slices]. @@ -203,6 +211,35 @@ ln -vs ../usr/bin /work/bin "/usr/bin", "/usr/lib/llvm/21/bin", ) + + case toolchainIntermediate, Std: + boot := t - 1 + musl, compilerRT, runtimes, clang := boot.NewLLVM() + support = slices.Concat([]pkg.Artifact{ + cureEtc{}, + musl, + compilerRT, + runtimes, + clang, + boot.NewBusybox(), + }, extra) + env = fixupEnviron(env, []string{ + EnvTriplet + "=" + triplet(), + lcMessages, + + // autotools projects act up with CFLAGS + "CC=clang " + cflags, + EnvRefCFLAGS + "=" + cflags, + "CXX=clang++ " + cxxflags(), + EnvRefCXXFLAGS + "=" + cxxflags(), + ldflags(false), + + "AR=ar", + "RANLIB=ranlib", + "LIBCC=/system/lib/clang/21/lib/" + triplet() + + "/libclang_rt.builtins.a", + }, "/system/bin", "/bin") + default: panic("unsupported toolchain " + strconv.Itoa(int(t))) }