From 020e3aa4fec74cf72bb853b854bba66e96302ea9 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 26 Oct 2026 02:55:38 +0900 Subject: 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 --- internal/rosa/rosa.go | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'internal/rosa/rosa.go') 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 { -- cgit v1.3.1