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:
David Chase 2020-05-01 17:30:33 -04:00
parent f7f9c8f2fb
commit daf70d6c16
7 changed files with 4 additions and 30 deletions

View file

@ -37,16 +37,13 @@ var (
const (
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 {
switch v := envOr("GOAMD64", defaultGOAMD64); v {
case "normaljumps", "alignedjumps":
return v
}
log.Fatalf("Invalid GOAMD64 value. Must be normaljumps or alignedjumps.")
panic("unreachable")
return Go115AMD64
}
func goarm() int {