Skip to content

Commit

Permalink
cmd/dist: add windows/arm64 support
Browse files Browse the repository at this point in the history
- Add Windows SystemInfo constant for arm64
- Add windows/arm64 to GOOS/GOARCH list

This CL is part of a stack adding windows/arm64
support (#36439), intended to land in the Go 1.17 cycle.

Change-Id: I6109bd87512b5cb1d227d7a85fd0ac20eb2259e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/288819
Trust: Russ Cox <rsc@golang.org>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
rsc committed Feb 19, 2021
1 parent bb6efb9 commit 0c63312
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cmd/dist/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,7 @@ var cgoEnabled = map[string]bool{
"windows/386": true,
"windows/amd64": true,
"windows/arm": false,
"windows/arm64": false,
}

// List of platforms which are supported but not complete yet. These get
Expand Down
5 changes: 5 additions & 0 deletions src/cmd/dist/sys_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ type systeminfo struct {
wProcessorRevision uint16
}

// See https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info
const (
PROCESSOR_ARCHITECTURE_AMD64 = 9
PROCESSOR_ARCHITECTURE_INTEL = 0
PROCESSOR_ARCHITECTURE_ARM = 5
PROCESSOR_ARCHITECTURE_ARM64 = 12
PROCESSOR_ARCHITECTURE_IA64 = 6
)

var sysinfo systeminfo
Expand All @@ -46,6 +49,8 @@ func sysinit() {
gohostarch = "386"
case PROCESSOR_ARCHITECTURE_ARM:
gohostarch = "arm"
case PROCESSOR_ARCHITECTURE_ARM64:
gohostarch = "arm64"
default:
fatalf("unknown processor architecture")
}
Expand Down

0 comments on commit 0c63312

Please sign in to comment.