</ul>
+<p>
+The value of <code>GOMIPS</code> environment variable (<code>hardfloat</code> or
+<code>softfloat</code>) is made available to assembly code by predefining either
+<code>GOMIPS_hardfloat</code> or <code>GOMIPS_softfloat</code>.
+</p>
+
<h3 id="unsupported_opcodes">Unsupported opcodes</h3>
<p>
goos string
goarm string
go386 string
+ gomips string
goroot string
goroot_final string
goextlinkenabled string
}
go386 = b
+ b = os.Getenv("GOMIPS")
+ if b == "" {
+ b = "hardfloat"
+ }
+ gomips = b
+
if p := pathf("%s/src/all.bash", goroot); !isfile(p) {
fatalf("$GOROOT is not set correctly or not exported\n"+
"\tGOROOT=%s\n"+
os.Setenv("GOHOSTARCH", gohostarch)
os.Setenv("GOHOSTOS", gohostos)
os.Setenv("GOOS", goos)
+ os.Setenv("GOMIPS", gomips)
os.Setenv("GOROOT", goroot)
os.Setenv("GOROOT_FINAL", goroot_final)
"-D", "GOOS_GOARCH_" + goos + "_" + goarch,
}
+ if goarch == "mips" || goarch == "mipsle" {
+ // Define GOMIPS_value from gomips.
+ compile = append(compile, "-D", "GOMIPS_"+gomips)
+ }
+
doclean := true
b := pathf("%s/%s", workdir, filepath.Base(p))
if goarch == "386" {
xprintf(format, "GO386", go386)
}
+ if goarch == "mips" || goarch == "mipsle" {
+ xprintf(format, "GOMIPS", gomips)
+ }
if *path {
sep := ":"
// const defaultGOROOT = <goroot>
// const defaultGO386 = <go386>
// const defaultGOARM = <goarm>
+// const defaultGOMIPS = <gomips>
// const defaultGOOS = runtime.GOOS
// const defaultGOARCH = runtime.GOARCH
// const defaultGO_EXTLINK_ENABLED = <goextlinkenabled>
fmt.Fprintf(&buf, "const defaultGOROOT = `%s`\n", goroot_final)
fmt.Fprintf(&buf, "const defaultGO386 = `%s`\n", go386)
fmt.Fprintf(&buf, "const defaultGOARM = `%s`\n", goarm)
+ fmt.Fprintf(&buf, "const defaultGOMIPS = `%s`\n", gomips)
fmt.Fprintf(&buf, "const defaultGOOS = runtime.GOOS\n")
fmt.Fprintf(&buf, "const defaultGOARCH = runtime.GOARCH\n")
fmt.Fprintf(&buf, "const defaultGO_EXTLINK_ENABLED = `%s`\n", goextlinkenabled)
// GO386
// For GOARCH=386, the floating point instruction set.
// Valid values are 387, sse2.
+// GOMIPS
+// For GOARCH=mips{,le}, whether to use floating point instructions.
+// Valid values are hardfloat (default), softfloat.
//
// Special-purpose environment variables:
//
GOROOTsrc = filepath.Join(GOROOT, "src")
// Used in envcmd.MkEnv and build ID computations.
- GOARM = fmt.Sprint(objabi.GOARM)
- GO386 = objabi.GO386
+ GOARM = fmt.Sprint(objabi.GOARM)
+ GO386 = objabi.GO386
+ GOMIPS = objabi.GOMIPS
)
// Update build context to use our computed GOROOT.
env = append(env, cfg.EnvVar{Name: "GOARM", Value: cfg.GOARM})
case "386":
env = append(env, cfg.EnvVar{Name: "GO386", Value: cfg.GO386})
+ case "mips", "mipsle":
+ env = append(env, cfg.EnvVar{Name: "GOMIPS", Value: cfg.GOMIPS})
}
cc := cfg.DefaultCC(cfg.Goos, cfg.Goarch)
GO386
For GOARCH=386, the floating point instruction set.
Valid values are 387, sse2.
+ GOMIPS
+ For GOARCH=mips{,le}, whether to use floating point instructions.
+ Valid values are hardfloat (default), softfloat.
Special-purpose environment variables:
}
}
}
+
+ if cfg.Goarch == "mips" || cfg.Goarch == "mipsle" {
+ // Define GOMIPS_value from cfg.GOMIPS.
+ args = append(args, "-D", "GOMIPS_"+cfg.GOMIPS)
+ }
+
var ofiles []string
for _, sfile := range sfiles {
ofile := a.Objdir + sfile[:len(sfile)-len(".s")] + ".o"
GOOS = envOr("GOOS", defaultGOOS)
GO386 = envOr("GO386", defaultGO386)
GOARM = goarm()
+ GOMIPS = gomips()
Version = version
)
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)
}