diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-10-26 02:55:38 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-10-26 03:49:41 +0900 |
| commit | 020e3aa4fec74cf72bb853b854bba66e96302ea9 (patch) | |
| tree | c0eca28968b52a4f26b18271bcc71d249ab3e2fd /internal/rosa/rosa.go | |
| parent | 828174513b690652a0c54f590cd224caaa6723b0 (diff) | |
internal/rosa: LLVM-specific arch name
This is different from linuxArch for PowerPC. While the alternative
usually works fine, compiling compiler-rt builtins produces no output
with linuxArch. The musl installation also uses this name.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/rosa.go')
| -rw-r--r-- | internal/rosa/rosa.go | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go index 5f487bb7..c730127b 100644 --- a/internal/rosa/rosa.go +++ b/internal/rosa/rosa.go @@ -60,24 +60,39 @@ func linuxArch(arch string) string { return "x86_64" case "arm64": return "aarch64" - case "riscv64": - return "riscv64" + + case "ppc64le", "riscv64": + return arch default: panic("unsupported target " + arch) } } +// llvmArch returns the LLVM target-triple-specific name corresponding to arch. +func llvmArch(arch string) string { + switch arch { + case "ppc64le": + return "powerpc64le" + + default: + return linuxArch(arch) + } +} + // linuxArch returns the architecture name used by linux corresponding to arch. -func (s *S) linuxArch() string { return linuxArch(s.arch) } +func (s *S) linuxArch() string { return linuxArch(s.Arch()) } + +// llvmArch returns the LLVM target-triple-specific name corresponding to arch. +func (s *S) llvmArch() string { return llvmArch(s.Arch()) } // triple returns the Rosa OS host triple corresponding to arch. func triple(arch string) string { - return linuxArch(arch) + "-rosa-linux-musl" + return llvmArch(arch) + "-rosa-linux-musl" } // triple returns the Rosa OS target triple corresponding to arch. -func (s *S) triple() string { return triple(s.arch) } +func (s *S) triple() string { return triple(s.Arch()) } // earlyLDFLAGS returns LDFLAGS corresponding to triplet. func (s *S) earlyLDFLAGS(static bool) string { |
