cmd/go, cmd/dist: introduce GOMIPS environment variable

GOMIPS is a GOARCH=mips{,le} specific option, for a choice between
hard-float and soft-float. Valid values are 'hardfloat' (default) and
'softfloat'. It is passed to the assembler as
'GOMIPS_{hardfloat,softfloat}'.

Note: GOMIPS will later also be used for a choice of MIPS instruction
set (mips32/mips32r2).

Updates #18162

Change-Id: I35417db8625695f09d6ccc3042431dd2eaa756a6
Reviewed-on: https://go-review.googlesource.com/37954
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Vladimir Stefanovic 2017-05-22 18:23:31 +02:00 committed by Brad Fitzpatrick
parent 4f5018594d
commit 12abacb555
9 changed files with 51 additions and 2 deletions

View file

@ -24,6 +24,7 @@ var (
GOOS = envOr("GOOS", defaultGOOS)
GO386 = envOr("GO386", defaultGO386)
GOARM = goarm()
GOMIPS = gomips()
Version = version
)
@ -41,6 +42,15 @@ func goarm() int {
panic("unreachable")
}
func gomips() string {
switch v := envOr("GOMIPS", defaultGOMIPS); v {
case "hardfloat", "softfloat":
return v
}
log.Fatalf("Invalid GOMIPS value. Must be hardfloat or softfloat.")
panic("unreachable")
}
func Getgoextlinkenabled() string {
return envOr("GO_EXTLINK_ENABLED", defaultGO_EXTLINK_ENABLED)
}