diff options
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 { |
