aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/rosa.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/rosa/rosa.go')
-rw-r--r--internal/rosa/rosa.go21
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")