aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-01-19 02:57:28 +0900
committerOphestra <cat@gensokyo.uk>2026-01-19 02:57:28 +0900
commitb14964a66ddfb9cd575c66da35a030ffe6fb57ea (patch)
tree6fc63ab28b2f032010f00756daefb743f9da7895 /internal
parentff98c9ded97f93348b0a754a551b07050f16a236 (diff)
internal/rosa: standard toolchain via 2-stage bootstrap
This implements the 2-stage bootstrap build without clumping the stages together in the cmake target. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal')
-rw-r--r--internal/rosa/rosa.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go
index ebad8101..6c4d585d 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)))
}