internal/rosa/llvm: migrate musl
All checks were successful
Test / Create distribution (push) Successful in 2m48s
Test / Sandbox (push) Successful in 6m4s
Test / Hakurei (push) Successful in 7m14s
Test / ShareFS (push) Successful in 7m23s
Test / Sandbox (race detector) (push) Successful in 9m34s
Test / Hakurei (race detector) (push) Successful in 4m2s
Test / Flake checks (push) Successful in 1m33s
All checks were successful
Test / Create distribution (push) Successful in 2m48s
Test / Sandbox (push) Successful in 6m4s
Test / Hakurei (push) Successful in 7m14s
Test / ShareFS (push) Successful in 7m23s
Test / Sandbox (race detector) (push) Successful in 9m34s
Test / Hakurei (race detector) (push) Successful in 4m2s
Test / Flake checks (push) Successful in 1m33s
This removes the pointless special treatment given to musl. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -69,10 +69,7 @@ func (t Toolchain) newLLVMVariant(variant string, attr *llvmAttr) pkg.Artifact {
|
||||
}
|
||||
|
||||
func (t Toolchain) newCompilerRT() (pkg.Artifact, string) {
|
||||
muslHeaders, _ := t.newMusl(true, []string{
|
||||
"CC=clang",
|
||||
})
|
||||
|
||||
muslHeaders, _ := t.newMusl(true)
|
||||
return t.newLLVMVariant("compiler-rt", &llvmAttr{
|
||||
env: stage0ExclConcat(t, []string{},
|
||||
"LDFLAGS="+earlyLDFLAGS(false),
|
||||
@@ -128,7 +125,7 @@ func init() {
|
||||
}
|
||||
|
||||
// newLLVM returns LLVM toolchain across multiple [pkg.Artifact].
|
||||
func (t Toolchain) newLLVM() (musl, runtimes, clang pkg.Artifact) {
|
||||
func (t Toolchain) newLLVM() (runtimes, clang pkg.Artifact) {
|
||||
target := "'AArch64;RISCV;X86'"
|
||||
if t.isStage0() {
|
||||
switch runtime.GOARCH {
|
||||
@@ -151,16 +148,7 @@ func (t Toolchain) newLLVM() (musl, runtimes, clang pkg.Artifact) {
|
||||
}
|
||||
|
||||
compilerRT := t.Load(LLVMCompilerRT)
|
||||
|
||||
musl, _ = t.newMusl(false, stage0ExclConcat(t, []string{
|
||||
"CC=clang",
|
||||
"LIBCC=/system/lib/clang/" + llvmVersionMajor + "/lib/" +
|
||||
triplet() + "/libclang_rt.builtins.a",
|
||||
"AR=ar",
|
||||
"RANLIB=ranlib",
|
||||
},
|
||||
"LDFLAGS="+earlyLDFLAGS(false),
|
||||
), compilerRT)
|
||||
musl := t.Load(Musl)
|
||||
|
||||
runtimes = t.newLLVMVariant("runtimes", &llvmAttr{
|
||||
env: stage0ExclConcat(t, []string{},
|
||||
@@ -242,7 +230,7 @@ ninja check-all
|
||||
func init() {
|
||||
artifactsM[LLVMRuntimes] = Metadata{
|
||||
f: func(t Toolchain) (pkg.Artifact, string) {
|
||||
_, runtimes, _ := t.newLLVM()
|
||||
runtimes, _ := t.newLLVM()
|
||||
return runtimes, llvmVersion
|
||||
},
|
||||
|
||||
@@ -253,7 +241,7 @@ func init() {
|
||||
|
||||
artifactsM[LLVMClang] = Metadata{
|
||||
f: func(t Toolchain) (pkg.Artifact, string) {
|
||||
_, _, clang := t.newLLVM()
|
||||
_, clang := t.newLLVM()
|
||||
return clang, llvmVersion
|
||||
},
|
||||
|
||||
@@ -288,15 +276,15 @@ func init() {
|
||||
|
||||
var (
|
||||
// llvm stores the result of Toolchain.newLLVM.
|
||||
llvm [_toolchainEnd][3]pkg.Artifact
|
||||
llvm [_toolchainEnd][2]pkg.Artifact
|
||||
// llvmOnce is for lazy initialisation of llvm.
|
||||
llvmOnce [_toolchainEnd]sync.Once
|
||||
)
|
||||
|
||||
// NewLLVM returns LLVM toolchain across multiple [pkg.Artifact].
|
||||
func (t Toolchain) NewLLVM() (musl, runtimes, clang pkg.Artifact) {
|
||||
func (t Toolchain) NewLLVM() (runtimes, clang pkg.Artifact) {
|
||||
llvmOnce[t].Do(func() {
|
||||
llvm[t][0], llvm[t][1], llvm[t][2] = t.newLLVM()
|
||||
llvm[t][0], llvm[t][1] = t.newLLVM()
|
||||
})
|
||||
return llvm[t][0], llvm[t][1], llvm[t][2]
|
||||
return llvm[t][0], llvm[t][1]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user