Skip to content

Commit

Permalink
Arm64 support on Linux (#1550)
Browse files Browse the repository at this point in the history
Fixes #1506
  • Loading branch information
ArielleA authored and jayconrod committed Sep 26, 2018
1 parent 21470cc commit be231c1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go/platform/list.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ GOARCH = {
"amd64": "@bazel_tools//platforms:x86_64",
"amd64p32": None,
"arm": "@bazel_tools//platforms:arm",
"arm64": None,
"arm64": "@bazel_tools//platforms:aarch64",
"mips": None,
"mips64": None,
"mips64le": None,
Expand Down
10 changes: 10 additions & 0 deletions go/private/sdk.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,16 @@ def _detect_host_platform(ctx):
host = "linux_ppc64le"
elif uname == "i686":
host = "linux_386"
# uname -p is not working on Aarch64 boards
res = ctx.execute(["uname", "-m"])
if res.return_code == 0:
uname = res.stdout.strip()
if uname == "aarch64":
host = "linux_arm64"
elif uname == "armv6l":
host = "linux_armv6l"
elif uname == "armv7l":
host = "linux_armv6l"

# Default to amd64 when uname doesn't return a known value.

Expand Down

0 comments on commit be231c1

Please sign in to comment.