diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-05-21 17:51:23 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-05-21 17:51:23 +0900 |
| commit | 54aae9d72a12ae8af93ba35d00a3817e3105dcce (patch) | |
| tree | fcd8a264d970c0060c9ee5070e845fe446b6fce2 /internal/rosa/llvm.go | |
| parent | 58646f8ea56d2b2093891e5265225e0c100104f6 (diff) | |
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>
Diffstat (limited to 'internal/rosa/llvm.go')
| -rw-r--r-- | internal/rosa/llvm.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/rosa/llvm.go b/internal/rosa/llvm.go index 11f8ad0b..c4d84988 100644 --- a/internal/rosa/llvm.go +++ b/internal/rosa/llvm.go @@ -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", |
