diff --git a/libgo/configure b/libgo/configure index 46bb6066fb3..a5439ebd848 100755 --- a/libgo/configure +++ b/libgo/configure @@ -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 diff --git a/libgo/configure.ac b/libgo/configure.ac index b43a1580749..dc1f9082a0a 100644 --- a/libgo/configure.ac +++ b/libgo/configure.ac @@ -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) diff --git a/libgo/go/go/build/build.go b/libgo/go/go/build/build.go index 50d2fb4aeba..d06a9be5312 100644 --- a/libgo/go/go/build/build.go +++ b/libgo/go/go/build/build.go @@ -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) } diff --git a/libgo/go/go/build/deps_test.go b/libgo/go/go/build/deps_test.go index dd162c7db7f..88f3eca4ed2 100644 --- a/libgo/go/go/build/deps_test.go +++ b/libgo/go/go/build/deps_test.go @@ -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 diff --git a/libgo/go/go/build/syslist.go b/libgo/go/go/build/syslist.go index a322c88c427..3580d823b08 100644 --- a/libgo/go/go/build/syslist.go +++ b/libgo/go/go/build/syslist.go @@ -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 " diff --git a/libgo/go/runtime/extern.go b/libgo/go/runtime/extern.go index 527e9cdf89c..f45104fcfc2 100644 --- a/libgo/go/runtime/extern.go +++ b/libgo/go/runtime/extern.go @@ -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