internal/rosa/package: migrate llvm patches

LLVM itself is unlikely to ever be migrated due to complexity of the bootstrap, so migrate patches instead.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-21 17:51:23 +09:00
parent 58646f8ea5
commit 54aae9d72a
6 changed files with 101 additions and 95 deletions

View File

@@ -1,9 +1,11 @@
package rosa
import (
"io/fs"
"regexp"
"slices"
"strings"
"unsafe"
"hakurei.app/internal/pkg"
)
@@ -48,6 +50,24 @@ func litArgs(verbose bool, skipChecks ...string) string {
}
func init() {
var llvmPatches []KV
for _, name := range [...]string{
"increase-stack-size-unconditional",
"add-rosa-vendor",
"xfail-broken-tests",
"path-system-include",
"path-system-libraries",
} {
p, err := fs.ReadFile(nativeB, "package/llvm/"+name+".patch")
if err != nil {
panic(err)
}
llvmPatches = append(llvmPatches, KV{
name,
unsafe.String(unsafe.SliceData(p), len(p)),
})
}
native.MustRegister("early-compiler-rt", func(t Toolchain) (*Metadata, pkg.Artifact) {
meta := Metadata{
Name: "early-compiler-rt",