internal/rosa: read-only access to built-ins

This removes potential footguns caused by mutable builtins without requiring unnecessary clones.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
cat
2026-08-25 14:00:42 +09:00
parent 7ee5d5368d
commit ac7abbbe3f
16 changed files with 123 additions and 94 deletions
+2 -2
View File
@@ -48,7 +48,7 @@ func litArgs(verbose bool, skipChecks ...string) string {
}
func init() {
native.MustRegister("llvm", func(t Toolchain) (*Metadata, pkg.Artifact) {
builtin.MustRegister("llvm", func(t Toolchain) (*Metadata, pkg.Artifact) {
meta := Metadata{
Name: "llvm",
Description: "a collection of modular and reusable compiler and toolchain technologies",
@@ -168,7 +168,7 @@ func init() {
)
}
if t.opts&OptLLVMNoLTO == 0 {
if t.opts&OptToolchainLTO != 0 {
cache = append(cache, []KV{
// very expensive
{"LLVM_ENABLE_LTO", "Thin"},