diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-10-20 20:49:05 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-10-20 21:11:16 +0900 |
| commit | b61421e9930f114c25f0af17ffbb07d1ca4189ac (patch) | |
| tree | 32e55058425f9b6790b4b4bc1cd89e1bc57928c6 /internal/rosa/rosa.go | |
| parent | d42b67f47f4779f86133087ee9bb26219e536de9 (diff) | |
internal/rosa: remove triple from environment
This is cleaner and prepares for cross-compilation support.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/rosa.go')
| -rw-r--r-- | internal/rosa/rosa.go | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go index beffb3ff..c1f71cfa 100644 --- a/internal/rosa/rosa.go +++ b/internal/rosa/rosa.go @@ -54,8 +54,8 @@ var ( ) // linuxArch returns the architecture name used by linux corresponding to arch. -func (s *S) linuxArch() string { - switch s.arch { +func linuxArch(arch string) string { + switch arch { case "amd64": return "x86_64" case "arm64": @@ -64,19 +64,20 @@ func (s *S) linuxArch() string { return "riscv64" default: - panic("unsupported target " + s.arch) + panic("unsupported target " + arch) } } +// linuxArch returns the architecture name used by linux corresponding to arch. +func (s *S) linuxArch() string { return linuxArch(s.arch) } + // triple returns the Rosa OS host triple corresponding to arch. -func (s *S) triple() string { - return s.linuxArch() + "-rosa-linux-musl" +func triple(arch string) string { + return linuxArch(arch) + "-rosa-linux-musl" } -const ( - // EnvTriple holds the Rosa OS host triple. - EnvTriple = "ROSA_TRIPLE" -) +// triple returns the Rosa OS target triple corresponding to arch. +func (s *S) triple() string { return triple(s.arch) } // earlyLDFLAGS returns LDFLAGS corresponding to triplet. func (s *S) earlyLDFLAGS(static bool) string { @@ -447,7 +448,6 @@ func (t Toolchain) New( ) } env = fixupEnviron(env, []string{ - EnvTriple + "=" + t.triple(), lcMessages, "LDFLAGS=" + t.earlyLDFLAGS(true), }, "/system/bin", @@ -481,7 +481,6 @@ func (t Toolchain) New( toybox, ) env = fixupEnviron(env, []string{ - EnvTriple + "=" + t.triple(), lcMessages, }, "/system/bin", "/bin") |
