go/build: Set GOARCH on arm64 systems.
authorIan Lance Taylor <ian@gcc.gnu.org>
Mon, 6 Jan 2014 19:24:23 +0000 (19:24 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 6 Jan 2014 19:24:23 +0000 (19:24 +0000)
I am reliably informed that the architecture name and letter for the
plan9/inferno compilers for 64-bit ARM systems will be "arm64" and "7"
respectively, so let's get that bit in nice and early.

From Michael Hudson-Doyle.
https://codereview.appspot.com/34830045/

From-SVN: r206374

libgo/configure
libgo/configure.ac
libgo/go/go/build/build.go
libgo/go/go/build/deps_test.go
libgo/go/go/build/syslist.go
libgo/go/runtime/extern.go

index 46bb606..a5439eb 100755 (executable)
@@ -647,6 +647,8 @@ LIBGO_IS_MIPS_FALSE
 LIBGO_IS_MIPS_TRUE
 LIBGO_IS_M68K_FALSE
 LIBGO_IS_M68K_TRUE
+LIBGO_IS_ARM64_FALSE
+LIBGO_IS_ARM64_TRUE
 LIBGO_IS_ARM_FALSE
 LIBGO_IS_ARM_TRUE
 LIBGO_IS_ALPHA_FALSE
@@ -11113,7 +11115,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11116 "configure"
+#line 11118 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11219,7 +11221,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11222 "configure"
+#line 11224 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13592,6 +13594,7 @@ esac
 is_386=no
 is_alpha=no
 is_arm=no
+is_arm64=no
 is_m68k=no
 mips_abi=unknown
 is_ppc=no
@@ -13605,6 +13608,10 @@ case ${host} in
     is_alpha=yes
     GOARCH=alpha
     ;;
+  aarch64-*-*)
+    is_arm64=yes
+    GOARCH=arm64
+    ;;
   arm*-*-* | strongarm*-*-* | ep9312*-*-* | xscale-*-*)
     is_arm=yes
     GOARCH=arm
@@ -13756,6 +13763,14 @@ else
   LIBGO_IS_ARM_FALSE=
 fi
 
+ if test $is_arm64 = yes; then
+  LIBGO_IS_ARM64_TRUE=
+  LIBGO_IS_ARM64_FALSE='#'
+else
+  LIBGO_IS_ARM64_TRUE='#'
+  LIBGO_IS_ARM64_FALSE=
+fi
+
  if test $is_m68k = yes; then
   LIBGO_IS_M68K_TRUE=
   LIBGO_IS_M68K_FALSE='#'
@@ -15538,6 +15553,10 @@ if test -z "${LIBGO_IS_ARM_TRUE}" && test -z "${LIBGO_IS_ARM_FALSE}"; then
   as_fn_error "conditional \"LIBGO_IS_ARM\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${LIBGO_IS_ARM64_TRUE}" && test -z "${LIBGO_IS_ARM64_FALSE}"; then
+  as_fn_error "conditional \"LIBGO_IS_ARM64\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${LIBGO_IS_M68K_TRUE}" && test -z "${LIBGO_IS_M68K_FALSE}"; then
   as_fn_error "conditional \"LIBGO_IS_M68K\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
index b43a158..dc1f908 100644 (file)
@@ -174,6 +174,7 @@ dnl N.B. Keep in sync with gcc/testsuite/go.test/go-test.exp (go-set-goarch).
 is_386=no
 is_alpha=no
 is_arm=no
+is_arm64=no
 is_m68k=no
 mips_abi=unknown
 is_ppc=no
@@ -187,6 +188,10 @@ case ${host} in
     is_alpha=yes
     GOARCH=alpha
     ;;
+  aarch64-*-*)
+    is_arm64=yes
+    GOARCH=arm64
+    ;;
   arm*-*-* | strongarm*-*-* | ep9312*-*-* | xscale-*-*)
     is_arm=yes
     GOARCH=arm
@@ -267,6 +272,7 @@ esac
 AM_CONDITIONAL(LIBGO_IS_386, test $is_386 = yes)
 AM_CONDITIONAL(LIBGO_IS_ALPHA, test $is_alpha = yes)
 AM_CONDITIONAL(LIBGO_IS_ARM, test $is_arm = yes)
+AM_CONDITIONAL(LIBGO_IS_ARM64, test $is_arm64 = yes)
 AM_CONDITIONAL(LIBGO_IS_M68K, test $is_m68k = yes)
 AM_CONDITIONAL(LIBGO_IS_MIPS, test $mips_abi != unknown)
 AM_CONDITIONAL(LIBGO_IS_MIPSO32, test $mips_abi = o32)
index 50d2fb4..d06a9be 100644 (file)
@@ -1211,6 +1211,8 @@ func ArchChar(goarch string) (string, error) {
                return "6", nil
        case "arm":
                return "5", nil
+       case "arm64":
+               return "7", nil
        }
        return "", errors.New("unsupported GOARCH " + goarch)
 }
index dd162c7..88f3eca 100644 (file)
@@ -360,7 +360,7 @@ func allowed(pkg string) map[string]bool {
 
 var bools = []bool{false, true}
 var geese = []string{"darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "plan9", "windows"}
-var goarches = []string{"386", "amd64", "arm"}
+var goarches = []string{"386", "amd64", "arm", "arm64"}
 
 type osPkg struct {
        goos, pkg string
index a322c88..3580d82 100644 (file)
@@ -5,4 +5,4 @@
 package build
 
 const goosList = "darwin dragonfly freebsd linux netbsd openbsd plan9 windows solaris "
-const goarchList = "386 amd64 arm alpha m68k mipso32 mipsn32 mipsn64 mipso64 ppc ppc64 sparc sparc64 "
+const goarchList = "386 amd64 arm arm64 alpha m68k mipso32 mipsn32 mipsn64 mipso64 ppc ppc64 sparc sparc64 "
index 527e9cd..f45104f 100644 (file)
@@ -185,5 +185,5 @@ func Version() string {
 const GOOS string = theGoos
 
 // GOARCH is the running program's architecture target:
-// 386, amd64, or arm.
+// 386, amd64, arm or arm64.
 const GOARCH string = theGoarch