mirror of
https://github.com/golang/go
synced 2024-11-18 08:04:40 -07:00
cmd/go: remove GOAMD64 environment variable
This removes the GOAMD64 environment variable and its documentation. The value is instead supplied by a compiled-in constant. Note that function alignment is also dependent on the value of the (removed) flag; it is 32 for aligned jumps, 16 if not. When the flag-dependent logic is removed, it will be 32. Updates #35881. Change-Id: Ic41c0b9833d2e8a31fa3ce8067d92aa2f165bf72 Reviewed-on: https://go-review.googlesource.com/c/go/+/231600 Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
f7f9c8f2fb
commit
daf70d6c16
11
src/cmd/dist/build.go
vendored
11
src/cmd/dist/build.go
vendored
@ -31,7 +31,6 @@ var (
|
|||||||
goos string
|
goos string
|
||||||
goarm string
|
goarm string
|
||||||
go386 string
|
go386 string
|
||||||
goamd64 string
|
|
||||||
gomips string
|
gomips string
|
||||||
gomips64 string
|
gomips64 string
|
||||||
goppc64 string
|
goppc64 string
|
||||||
@ -152,12 +151,6 @@ func xinit() {
|
|||||||
}
|
}
|
||||||
go386 = b
|
go386 = b
|
||||||
|
|
||||||
b = os.Getenv("GOAMD64")
|
|
||||||
if b == "" {
|
|
||||||
b = "alignedjumps"
|
|
||||||
}
|
|
||||||
goamd64 = b
|
|
||||||
|
|
||||||
b = os.Getenv("GOMIPS")
|
b = os.Getenv("GOMIPS")
|
||||||
if b == "" {
|
if b == "" {
|
||||||
b = "hardfloat"
|
b = "hardfloat"
|
||||||
@ -230,7 +223,6 @@ func xinit() {
|
|||||||
|
|
||||||
// For tools being invoked but also for os.ExpandEnv.
|
// For tools being invoked but also for os.ExpandEnv.
|
||||||
os.Setenv("GO386", go386)
|
os.Setenv("GO386", go386)
|
||||||
os.Setenv("GOAMD64", goamd64)
|
|
||||||
os.Setenv("GOARCH", goarch)
|
os.Setenv("GOARCH", goarch)
|
||||||
os.Setenv("GOARM", goarm)
|
os.Setenv("GOARM", goarm)
|
||||||
os.Setenv("GOHOSTARCH", gohostarch)
|
os.Setenv("GOHOSTARCH", gohostarch)
|
||||||
@ -1171,9 +1163,6 @@ func cmdenv() {
|
|||||||
if goarch == "386" {
|
if goarch == "386" {
|
||||||
xprintf(format, "GO386", go386)
|
xprintf(format, "GO386", go386)
|
||||||
}
|
}
|
||||||
if goarch == "amd64" {
|
|
||||||
xprintf(format, "GOAMD64", goamd64)
|
|
||||||
}
|
|
||||||
if goarch == "mips" || goarch == "mipsle" {
|
if goarch == "mips" || goarch == "mipsle" {
|
||||||
xprintf(format, "GOMIPS", gomips)
|
xprintf(format, "GOMIPS", gomips)
|
||||||
}
|
}
|
||||||
|
2
src/cmd/dist/buildruntime.go
vendored
2
src/cmd/dist/buildruntime.go
vendored
@ -42,7 +42,6 @@ func mkzversion(dir, file string) {
|
|||||||
//
|
//
|
||||||
// const defaultGOROOT = <goroot>
|
// const defaultGOROOT = <goroot>
|
||||||
// const defaultGO386 = <go386>
|
// const defaultGO386 = <go386>
|
||||||
// const defaultGOAMD64 = <goamd64>
|
|
||||||
// const defaultGOARM = <goarm>
|
// const defaultGOARM = <goarm>
|
||||||
// const defaultGOMIPS = <gomips>
|
// const defaultGOMIPS = <gomips>
|
||||||
// const defaultGOMIPS64 = <gomips64>
|
// const defaultGOMIPS64 = <gomips64>
|
||||||
@ -72,7 +71,6 @@ func mkzbootstrap(file string) {
|
|||||||
fmt.Fprintf(&buf, "import \"runtime\"\n")
|
fmt.Fprintf(&buf, "import \"runtime\"\n")
|
||||||
fmt.Fprintln(&buf)
|
fmt.Fprintln(&buf)
|
||||||
fmt.Fprintf(&buf, "const defaultGO386 = `%s`\n", go386)
|
fmt.Fprintf(&buf, "const defaultGO386 = `%s`\n", go386)
|
||||||
fmt.Fprintf(&buf, "const defaultGOAMD64 = `%s`\n", goamd64)
|
|
||||||
fmt.Fprintf(&buf, "const defaultGOARM = `%s`\n", goarm)
|
fmt.Fprintf(&buf, "const defaultGOARM = `%s`\n", goarm)
|
||||||
fmt.Fprintf(&buf, "const defaultGOMIPS = `%s`\n", gomips)
|
fmt.Fprintf(&buf, "const defaultGOMIPS = `%s`\n", gomips)
|
||||||
fmt.Fprintf(&buf, "const defaultGOMIPS64 = `%s`\n", gomips64)
|
fmt.Fprintf(&buf, "const defaultGOMIPS64 = `%s`\n", gomips64)
|
||||||
|
@ -1754,9 +1754,6 @@
|
|||||||
// GO386
|
// GO386
|
||||||
// For GOARCH=386, the floating point instruction set.
|
// For GOARCH=386, the floating point instruction set.
|
||||||
// Valid values are 387, sse2.
|
// Valid values are 387, sse2.
|
||||||
// GOAMD64
|
|
||||||
// For GOARCH=amd64, jumps can be optionally be aligned such that they do not end on
|
|
||||||
// or cross 32 byte boundaries. Valid values are alignedjumps (default), normaljumps.
|
|
||||||
// GOMIPS
|
// GOMIPS
|
||||||
// For GOARCH=mips{,le}, whether to use floating point instructions.
|
// For GOARCH=mips{,le}, whether to use floating point instructions.
|
||||||
// Valid values are hardfloat (default), softfloat.
|
// Valid values are hardfloat (default), softfloat.
|
||||||
|
@ -241,7 +241,6 @@ var (
|
|||||||
// Used in envcmd.MkEnv and build ID computations.
|
// Used in envcmd.MkEnv and build ID computations.
|
||||||
GOARM = envOr("GOARM", fmt.Sprint(objabi.GOARM))
|
GOARM = envOr("GOARM", fmt.Sprint(objabi.GOARM))
|
||||||
GO386 = envOr("GO386", objabi.GO386)
|
GO386 = envOr("GO386", objabi.GO386)
|
||||||
GOAMD64 = envOr("GOAMD64", objabi.GOAMD64)
|
|
||||||
GOMIPS = envOr("GOMIPS", objabi.GOMIPS)
|
GOMIPS = envOr("GOMIPS", objabi.GOMIPS)
|
||||||
GOMIPS64 = envOr("GOMIPS64", objabi.GOMIPS64)
|
GOMIPS64 = envOr("GOMIPS64", objabi.GOMIPS64)
|
||||||
GOPPC64 = envOr("GOPPC64", fmt.Sprintf("%s%d", "power", objabi.GOPPC64))
|
GOPPC64 = envOr("GOPPC64", fmt.Sprintf("%s%d", "power", objabi.GOPPC64))
|
||||||
@ -267,8 +266,6 @@ func GetArchEnv() (key, val string) {
|
|||||||
return "GOARM", GOARM
|
return "GOARM", GOARM
|
||||||
case "386":
|
case "386":
|
||||||
return "GO386", GO386
|
return "GO386", GO386
|
||||||
case "amd64":
|
|
||||||
return "GOAMD64", GOAMD64
|
|
||||||
case "mips", "mipsle":
|
case "mips", "mipsle":
|
||||||
return "GOMIPS", GOMIPS
|
return "GOMIPS", GOMIPS
|
||||||
case "mips64", "mips64le":
|
case "mips64", "mips64le":
|
||||||
|
@ -582,9 +582,6 @@ Architecture-specific environment variables:
|
|||||||
GO386
|
GO386
|
||||||
For GOARCH=386, the floating point instruction set.
|
For GOARCH=386, the floating point instruction set.
|
||||||
Valid values are 387, sse2.
|
Valid values are 387, sse2.
|
||||||
GOAMD64
|
|
||||||
For GOARCH=amd64, jumps can be optionally be aligned such that they do not end on
|
|
||||||
or cross 32 byte boundaries. Valid values are alignedjumps (default), normaljumps.
|
|
||||||
GOMIPS
|
GOMIPS
|
||||||
For GOARCH=mips{,le}, whether to use floating point instructions.
|
For GOARCH=mips{,le}, whether to use floating point instructions.
|
||||||
Valid values are hardfloat (default), softfloat.
|
Valid values are hardfloat (default), softfloat.
|
||||||
|
@ -37,16 +37,13 @@ var (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
ElfRelocOffset = 256
|
ElfRelocOffset = 256
|
||||||
MachoRelocOffset = 2048 // reserve enough space for ELF relocations
|
MachoRelocOffset = 2048 // reserve enough space for ELF relocations
|
||||||
|
Go115AMD64 = "alignedjumps" // Should be "alignedjumps" or "normaljumps"; this replaces environment variable introduced in CL 219357.
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// TODO(1.16): assuming no issues in 1.15 release, remove this and related constant.
|
||||||
func goamd64() string {
|
func goamd64() string {
|
||||||
switch v := envOr("GOAMD64", defaultGOAMD64); v {
|
return Go115AMD64
|
||||||
case "normaljumps", "alignedjumps":
|
|
||||||
return v
|
|
||||||
}
|
|
||||||
log.Fatalf("Invalid GOAMD64 value. Must be normaljumps or alignedjumps.")
|
|
||||||
panic("unreachable")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func goarm() int {
|
func goarm() int {
|
||||||
|
@ -33,7 +33,6 @@ const KnownEnv = `
|
|||||||
GCCGO
|
GCCGO
|
||||||
GO111MODULE
|
GO111MODULE
|
||||||
GO386
|
GO386
|
||||||
GOAMD64
|
|
||||||
GOARCH
|
GOARCH
|
||||||
GOARM
|
GOARM
|
||||||
GOBIN
|
GOBIN
|
||||||
|
Loading…
Reference in New Issue
Block a user