diff options
author | Andrey Bokhanko <andreybokhanko@gmail.com> | 2024-01-30 19:18:24 +0300 |
---|---|---|
committer | M Zhuo <mengzhuo1203@gmail.com> | 2024-03-06 01:33:19 +0000 |
commit | e8b5bc63be22e2bebffabcfccaf54d4c19822fe6 (patch) | |
tree | c065761b361bc9edfd074f93edee2c5f61cc70a2 /src/cmd/dist | |
parent | 9e3b1d53a012e98cfd02de2de8b1bd53522464d4 (diff) | |
download | go-e8b5bc63be22e2bebffabcfccaf54d4c19822fe6.tar.gz go-e8b5bc63be22e2bebffabcfccaf54d4c19822fe6.zip |
cmd/dist,internal: add GOARM64 environment variable
Adds GOARM64 environment variable with accepted range of values "v8.{0-9}",
"v9.{0-5}" and optional ",lse" and ",crypto" suffixes.
Right now it doesn't affect anything, but can be used in the future to
selectively target specific versions of different ARM64 hardware.
For #60905
Change-Id: I6d530041b6931aa884e34f719f8ec41b1cb03ece
Reviewed-on: https://go-review.googlesource.com/c/go/+/559555
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Shu-Chun Weng <scw@google.com>
Reviewed-by: Fannie Zhang <Fannie.Zhang@arm.com>
Diffstat (limited to 'src/cmd/dist')
-rw-r--r-- | src/cmd/dist/build.go | 11 | ||||
-rw-r--r-- | src/cmd/dist/buildruntime.go | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index d4d1bd8f0b..64f8f53054 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -33,6 +33,7 @@ var ( gohostos string goos string goarm string + goarm64 string go386 string goamd64 string gomips string @@ -141,6 +142,12 @@ func xinit() { } goarm = b + b = os.Getenv("GOARM64") + if b == "" { + b = "v8.0" + } + goarm64 = b + b = os.Getenv("GO386") if b == "" { b = "sse2" @@ -230,6 +237,7 @@ func xinit() { os.Setenv("GOAMD64", goamd64) os.Setenv("GOARCH", goarch) os.Setenv("GOARM", goarm) + os.Setenv("GOARM64", goarm64) os.Setenv("GOHOSTARCH", gohostarch) os.Setenv("GOHOSTOS", gohostos) os.Setenv("GOOS", goos) @@ -1239,6 +1247,9 @@ func cmdenv() { if goarch == "arm" { xprintf(format, "GOARM", goarm) } + if goarch == "arm64" { + xprintf(format, "GOARM64", goarm64) + } if goarch == "386" { xprintf(format, "GO386", go386) } diff --git a/src/cmd/dist/buildruntime.go b/src/cmd/dist/buildruntime.go index b041183bdf..7095f43772 100644 --- a/src/cmd/dist/buildruntime.go +++ b/src/cmd/dist/buildruntime.go @@ -54,6 +54,7 @@ func mkbuildcfg(file string) { 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 defaultGOARM64 = `%s`\n", goarm64) fmt.Fprintf(&buf, "const defaultGOMIPS = `%s`\n", gomips) fmt.Fprintf(&buf, "const defaultGOMIPS64 = `%s`\n", gomips64) fmt.Fprintf(&buf, "const defaultGOPPC64 = `%s`\n", goppc64) |