internal/rosa: standard toolchain via 2-stage bootstrap
All checks were successful
Test / Create distribution (push) Successful in 51s
Test / Sandbox (push) Successful in 3m0s
Test / ShareFS (push) Successful in 5m2s
Test / Hpkg (push) Successful in 5m30s
Test / Sandbox (race detector) (push) Successful in 5m32s
Test / Hakurei (push) Successful in 6m18s
Test / Hakurei (race detector) (push) Successful in 8m8s
Test / Flake checks (push) Successful in 1m56s

This implements the 2-stage bootstrap build without clumping the stages together in the cmake target.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-19 02:57:28 +09:00
parent ff98c9ded9
commit b14964a66d

View File

@@ -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)))
}