diff --git a/internal/rosa/cmake.go b/internal/rosa/cmake.go index 13ad917..8d7129a 100644 --- a/internal/rosa/cmake.go +++ b/internal/rosa/cmake.go @@ -97,7 +97,7 @@ func (t Toolchain) NewViaCMake( } sourcePath := AbsUsrSrc.Append(name) - return t.New(name+"-"+variant+"-"+version, attr.Flag, stage3Concat(t, extra, + return t.New(name+"-"+variant+"-"+version, attr.Flag, stage0Concat(t, extra, t.Load(CMake), t.Load(Ninja), ), nil, slices.Concat([]string{ diff --git a/internal/rosa/llvm.go b/internal/rosa/llvm.go index a5e375f..9a85bf5 100644 --- a/internal/rosa/llvm.go +++ b/internal/rosa/llvm.go @@ -160,7 +160,7 @@ ln -s ld.lld /work/system/bin/ld [2]string{"LIBCXX_USE_COMPILER_RT", "ON"}, ) - if t > toolchainStage3 { + if t > toolchainStage0 { // libcxxabi fails to compile if c++ headers not prefixed in /usr // is found by the compiler, and doing this is easier than // overriding CXXFLAGS; not using mv here to avoid chown failures @@ -199,7 +199,7 @@ cp -r /system/include /usr/include && rm -rf /system/include Paths: attr.paths, Flag: TExclusive, - }, stage3Concat(t, attr.extra, + }, stage0Concat(t, attr.extra, t.Load(Libffi), t.Load(Python), t.Load(Perl), @@ -233,7 +233,7 @@ func (t Toolchain) newLLVM() (musl, compilerRT, runtimes, clang pkg.Artifact) { } compilerRT = t.newLLVMVariant("compiler-rt", &llvmAttr{ - env: stage3ExclConcat(t, []string{}, + env: stage0ExclConcat(t, []string{}, "LDFLAGS="+earlyLDFLAGS(false), ), cmake: [][2]string{ @@ -276,7 +276,7 @@ ln -s \ musl = t.NewMusl(&MuslAttr{ Extra: []pkg.Artifact{compilerRT}, - Env: stage3ExclConcat(t, []string{ + Env: stage0ExclConcat(t, []string{ "CC=clang", "LIBCC=/system/lib/clang/21/lib/" + triplet() + "/libclang_rt.builtins.a", @@ -288,7 +288,7 @@ ln -s \ }) runtimes = t.newLLVMVariant("runtimes", &llvmAttr{ - env: stage3ExclConcat(t, []string{}, + env: stage0ExclConcat(t, []string{}, "LDFLAGS="+earlyLDFLAGS(false), ), flags: llvmRuntimeLibunwind | llvmRuntimeLibcxx | llvmRuntimeLibcxxABI, @@ -308,7 +308,7 @@ ln -s \ clang = t.newLLVMVariant("clang", &llvmAttr{ flags: llvmProjectClang | llvmProjectLld, - env: stage3ExclConcat(t, []string{}, + env: stage0ExclConcat(t, []string{}, "CFLAGS="+earlyCFLAGS, "CXXFLAGS="+earlyCXXFLAGS(), "LDFLAGS="+earlyLDFLAGS(false), diff --git a/internal/rosa/make.go b/internal/rosa/make.go index c1c90bc..f330a0a 100644 --- a/internal/rosa/make.go +++ b/internal/rosa/make.go @@ -36,8 +36,8 @@ type MakeAttr struct { // Do not include default extras. OmitDefaults bool - // Dependencies not provided by stage3. - NonStage3 []pkg.Artifact + // Dependencies not provided by stage0. + NonStage0 []pkg.Artifact // Additional environment variables. Env []string @@ -148,8 +148,8 @@ func (t Toolchain) NewViaMake( panic("cannot remain in root") } - return t.New(name+"-"+version, attr.Flag, stage3Concat(t, - attr.NonStage3, + return t.New(name+"-"+version, attr.Flag, stage0Concat(t, + attr.NonStage0, finalExtra..., ), nil, attr.Env, scriptEarly+` /usr/src/`+name+`/configure \ diff --git a/internal/rosa/mksh.go b/internal/rosa/mksh.go index ffef8e5..318bd3c 100644 --- a/internal/rosa/mksh.go +++ b/internal/rosa/mksh.go @@ -7,7 +7,7 @@ func (t Toolchain) newMksh() pkg.Artifact { version = "59c" checksum = "0Zj-k4nXEu3IuJY4lvwD2OrC2t27GdZj8SPy4DoaeuBRH1padWb7oREpYgwY8JNq" ) - return t.New("mksh-"+version, 0, stage3Concat(t, []pkg.Artifact{}, + return t.New("mksh-"+version, 0, stage0Concat(t, []pkg.Artifact{}, t.Load(Perl), t.Load(Coreutils), ), nil, []string{ diff --git a/internal/rosa/musl.go b/internal/rosa/musl.go index 7848722..7967837 100644 --- a/internal/rosa/musl.go +++ b/internal/rosa/musl.go @@ -42,7 +42,7 @@ rmdir -v /work/lib script = "" } - return t.New("musl-"+version, 0, stage3Concat(t, attr.Extra, + return t.New("musl-"+version, 0, stage0Concat(t, attr.Extra, t.Load(Make), t.Load(Coreutils), ), nil, slices.Concat([]string{ diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go index 9e54fae..c92928f 100644 --- a/internal/rosa/rosa.go +++ b/internal/rosa/rosa.go @@ -82,11 +82,11 @@ func earlyLDFLAGS(static bool) string { return s } -// earlyCFLAGS is reference CFLAGS for the stage3 toolchain. +// earlyCFLAGS is reference CFLAGS for the stage0 toolchain. const earlyCFLAGS = "-Qunused-arguments " + "-isystem/system/include" -// earlyCXXFLAGS returns reference CXXFLAGS for the stage3 toolchain +// earlyCXXFLAGS returns reference CXXFLAGS for the stage0 toolchain // corresponding to [runtime.GOARCH]. func earlyCXXFLAGS() string { return "--start-no-unused-arguments " + @@ -105,12 +105,12 @@ const ( // binary distribution. This is for decompressing unsupported formats. toolchainBusybox Toolchain = iota - // toolchainStage3 denotes the Gentoo stage3 toolchain. Special care must be - // taken to compile correctly against this toolchain. - toolchainStage3 + // toolchainStage0 denotes the stage0 toolchain. Special care must be taken + // to compile correctly against this toolchain. + toolchainStage0 // toolchainIntermediate denotes the intermediate toolchain compiled against - // toolchainStage3. This toolchain should be functionally identical to [Std] + // toolchainStage0. This toolchain should be functionally identical to [Std] // and is used to bootstrap [Std]. toolchainIntermediate @@ -122,19 +122,19 @@ const ( _toolchainEnd ) -// stage3Concat concatenates s and values. If the current toolchain is -// toolchainStage3, stage3Concat returns s as is. -func stage3Concat[S ~[]E, E any](t Toolchain, s S, values ...E) S { - if t == toolchainStage3 { +// stage0Concat concatenates s and values. If the current toolchain is +// toolchainStage0, stage0Concat returns s as is. +func stage0Concat[S ~[]E, E any](t Toolchain, s S, values ...E) S { + if t == toolchainStage0 { return s } return slices.Concat(s, values) } -// stage3ExclConcat concatenates s and values. If the current toolchain is not -// toolchainStage3, stage3ExclConcat returns s as is. -func stage3ExclConcat[S ~[]E, E any](t Toolchain, s S, values ...E) S { - if t == toolchainStage3 { +// stage0ExclConcat concatenates s and values. If the current toolchain is not +// toolchainStage0, stage0ExclConcat returns s as is. +func stage0ExclConcat[S ~[]E, E any](t Toolchain, s S, values ...E) S { + if t == toolchainStage0 { return slices.Concat(s, values) } return s @@ -208,7 +208,7 @@ func (t Toolchain) New( args[0] = "hush" env = fixupEnviron(env, nil, "/system/bin") - case toolchainStage3: + case toolchainStage0: name += "-boot" var seed string switch runtime.GOARCH { @@ -224,11 +224,11 @@ func (t Toolchain) New( args[0] = "bash" support = slices.Concat([]pkg.Artifact{ cureEtc{}, - toolchainBusybox.New("stage3", 0, nil, nil, nil, ` -tar -C /work -xf /usr/src/stage3.tar.xz + toolchainBusybox.New("stage0", 0, nil, nil, nil, ` +tar -C /work -xf /usr/src/stage0.tar.xz rm -rf /work/dev/ /work/proc/ ln -vs ../usr/bin /work/bin -`, pkg.Path(AbsUsrSrc.Append("stage3.tar.xz"), false, +`, pkg.Path(AbsUsrSrc.Append("stage0.tar.xz"), false, pkg.NewHTTPGet( nil, "https://basement.gensokyo.uk/seed/"+seed, mustDecode(seed), @@ -328,7 +328,7 @@ cat /usr/src/` + name + `-patches/* | \ ` aname += "-patched" } - return t.New(aname, 0, stage3Concat(t, []pkg.Artifact{}, + return t.New(aname, 0, stage0Concat(t, []pkg.Artifact{}, t.Load(Patch), ), nil, nil, script, paths...) } diff --git a/internal/rosa/toybox.go b/internal/rosa/toybox.go index 8db20b7..2e4d470 100644 --- a/internal/rosa/toybox.go +++ b/internal/rosa/toybox.go @@ -7,13 +7,13 @@ func (t Toolchain) newToybox(suffix, script string) pkg.Artifact { version = "0.8.13" checksum = "rZ1V1ATDte2WeQZanxLVoiRGdfPXhMlEo5-exX-e-ml8cGn9qOv0ABEUVZpX3wTI" ) - return t.New("toybox-"+version+suffix, TEarly, stage3Concat(t, []pkg.Artifact{}, + return t.New("toybox-"+version+suffix, TEarly, stage0Concat(t, []pkg.Artifact{}, t.Load(Make), t.Load(Bash), t.Load(Gzip), t.Load(KernelHeaders), - ), nil, stage3Concat(t, []string{}, + ), nil, stage0Concat(t, []string{}, "ROSA_CHECK=make USER=cure tests", ), ` ln -s ../system/bin/bash /bin/ || true