Skip to content

Commit c458843

Browse files
andreybokhankocherrymui
authored andcommitted
GoArm, MinimumRequirements: add documentation on GOARM64
Go 1.23 introduced GOARM64 environment variable; this patch documents it. Related to golang/go#69124 Change-Id: I148b1295d8772041f2379771a2f2e682fd4bfdbe Reviewed-on: https://go-review.googlesource.com/c/wiki/+/609855 Reviewed-by: Cherry Mui <[email protected]>
1 parent 206fae2 commit c458843

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

GoArm.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Go supports the following ARM architectural families.
1717
| ARMv6 | supported | GOARM=6 | GOARCH=arm |
1818
| ARMv7 | supported | GOARM=7 | GOARCH=arm |
1919
| ARMv8 | supported | n/a | GOARCH=arm64 |
20+
| ARMv9 | supported | n/a | GOARCH=arm64 |
2021

2122
Starting from Go 1.1, the appropriate GOARM value will be chosen if you compile the program from source on the target machine. In cross compilation situations, it is recommended that you always set an appropriate GOARM value along with GOARCH.
2223

MinimumRequirements.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,15 @@ See https://go.dev/doc/install/source#environment
115115

116116
### arm64
117117

118-
All ARMv8-A processors.
118+
Until Go 1.23, the Go compiler always generated ARM64 binaries that could be executed by any ARMv8-A processor.
119+
120+
Go 1.23 introduced a new `GOARM64` environment variable, which specifies the minimum target version of the ARM64 architecture at compile time. Allowed values are `v8.{0-9}` and `v9.{0-5}`. This may be followed by an option specifying extensions implemented by target hardware. Valid options are `,lse` and `,crypto`.
121+
122+
Setting, for example, `GOARM64=v8.0,lse`, will allow the Go compiler to use LSE instructions in the generated binaries (which may improve performance in some cases); but these binaries will not run on older ARM64 processors that don’t support LSE.
123+
124+
The Go toolchain may also generate newer instructions, but guarded by dynamic checks to ensure they’re only executed on capable processors.
125+
126+
The `GOARM64` environment variable defaults to `v8.0`.
119127

120128
### ppc64 (big endian)
121129

0 commit comments

Comments
 (0)