Created
January 16, 2015 16:03
-
-
Save 4ad/c3799da7e486854e6655 to your computer and use it in GitHub Desktop.
Teach cmd/dist about GOARCH=arm64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/cmd/dist/build.c b/src/cmd/dist/build.c | |
index e4b8b58..04bf6cf 100644 | |
--- a/src/cmd/dist/build.c | |
+++ b/src/cmd/dist/build.c | |
@@ -39,7 +39,7 @@ static void dopack(char*, char*, char**, int); | |
static char *findgoversion(void); | |
// The known architecture letters. | |
-static char *gochars = "566899"; | |
+static char *gochars = "5667899"; | |
// The known architectures. | |
static char *okgoarch[] = { | |
@@ -47,6 +47,7 @@ static char *okgoarch[] = { | |
"arm", | |
"amd64", | |
"amd64p32", | |
+ "arm64", | |
"386", | |
"ppc64", | |
"ppc64le", | |
diff --git a/src/cmd/dist/buildgc.c b/src/cmd/dist/buildgc.c | |
index 64434d5..c0302eb 100644 | |
--- a/src/cmd/dist/buildgc.c | |
+++ b/src/cmd/dist/buildgc.c | |
@@ -73,7 +73,7 @@ xatoi(char *s, char **end) | |
return val; | |
} | |
-// mkanames reads [5689].out.h and writes anames[5689].c | |
+// mkanames reads [56789].out.h and writes anames[56789].c | |
// The format is much the same as the Go opcodes above. | |
// It also writes out cnames array for C_* constants and the dnames | |
// array for D_* constants. | |
diff --git a/src/cmd/dist/unix.c b/src/cmd/dist/unix.c | |
index 0fd17c1..6b2e675 100644 | |
--- a/src/cmd/dist/unix.c | |
+++ b/src/cmd/dist/unix.c | |
@@ -708,6 +708,8 @@ main(int argc, char **argv) | |
gohostarch = "386"; | |
else if(contains(u.machine, "arm")) | |
gohostarch = "arm"; | |
+ else if(contains(u.machine, "aarch64")) | |
+ gohostarch = "arm64"; | |
else if(contains(u.machine, "ppc64le")) | |
gohostarch = "ppc64le"; | |
else if(contains(u.machine, "ppc64")) | |
diff --git a/src/go/build/build.go b/src/go/build/build.go | |
index 12c20e5..c62425a 100644 | |
--- a/src/go/build/build.go | |
+++ b/src/go/build/build.go | |
@@ -1386,6 +1386,8 @@ func ArchChar(goarch string) (string, error) { | |
return "6", nil | |
case "arm": | |
return "5", nil | |
+ case "arm64": | |
+ return "7", nil | |
case "ppc64", "ppc64le": | |
return "9", nil | |
} | |
diff --git a/src/go/build/syslist.go b/src/go/build/syslist.go | |
index 9246cbf..e84a066 100644 | |
--- a/src/go/build/syslist.go | |
+++ b/src/go/build/syslist.go | |
@@ -5,4 +5,4 @@ | |
package build | |
const goosList = "android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows " | |
-const goarchList = "386 amd64 amd64p32 arm ppc64 ppc64le " | |
+const goarchList = "386 amd64 amd64p32 arm arm64 ppc64 ppc64le " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, thanks for posting this. I'm trying to build on iOS arm64 using Minux's goios fork. Building on armv7 (GOARCH=arm) works great, but I can't get arm64 working, even with your patch.
Any thoughts on what's going on? I'm pretty new to the Go build system / toolchain so I'm not sure what's failing or why.