This patch by Lynn A. Boger changes libgo to use ppc64le for
little-endian 64-bit PowerPC.  Bootstrapped and ran testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff -r 96de84075614 libgo/configure.ac
--- a/libgo/configure.ac        Tue Nov 18 09:28:24 2014 -0800
+++ b/libgo/configure.ac        Fri Nov 21 10:01:45 2014 -0800
@@ -194,6 +194,7 @@
 mips_abi=unknown
 is_ppc=no
 is_ppc64=no
+is_ppc64le=no
 is_s390=no
 is_s390x=no
 is_sparc=no
@@ -266,11 +267,18 @@
 #ifdef _ARCH_PPC64
 #error 64-bit
 #endif],
-[is_ppc=yes], [is_ppc64=yes])
+[is_ppc=yes],
+    [AC_COMPILE_IFELSE([
+#if defined(_BIG_ENDIAN) || defined(__BIG_ENDIAN__)
+#error 64be
+#endif],
+[is_ppc64le=yes],[is_ppc64=yes])])
     if test "$is_ppc" = "yes"; then
       GOARCH=ppc
+    elif test "$is_ppc64" = "yes"; then
+      GOARCH=ppc64
     else
-      GOARCH=ppc64
+      GOARCH=ppc64le
     fi
     ;;
   s390*-*-*)
@@ -310,6 +318,7 @@
 AM_CONDITIONAL(LIBGO_IS_MIPSO64, test $mips_abi = o64)
 AM_CONDITIONAL(LIBGO_IS_PPC, test $is_ppc = yes)
 AM_CONDITIONAL(LIBGO_IS_PPC64, test $is_ppc64 = yes)
+AM_CONDITIONAL(LIBGO_IS_PPC64LE, test $is_ppc64le = yes)
 AM_CONDITIONAL(LIBGO_IS_S390, test $is_s390 = yes)
 AM_CONDITIONAL(LIBGO_IS_S390X, test $is_s390x = yes)
 AM_CONDITIONAL(LIBGO_IS_SPARC, test $is_sparc = yes)
diff -r 96de84075614 libgo/go/go/build/syslist.go
--- a/libgo/go/go/build/syslist.go      Tue Nov 18 09:28:24 2014 -0800
+++ b/libgo/go/go/build/syslist.go      Fri Nov 21 10:01:45 2014 -0800
@@ -5,4 +5,4 @@
 package build
 
 const goosList = "darwin dragonfly freebsd linux nacl netbsd openbsd plan9 
solaris windows "
-const goarchList = "386 amd64 amd64p32 arm arm64 alpha m68k mipso32 mipsn32 
mipsn64 mipso64 ppc ppc64 s390 s390x sparc sparc64 "
+const goarchList = "386 amd64 amd64p32 arm arm64 alpha m68k mipso32 mipsn32 
mipsn64 mipso64 ppc ppc64 ppc64le s390 s390x sparc sparc64 "
diff -r 96de84075614 libgo/testsuite/gotest
--- a/libgo/testsuite/gotest    Tue Nov 18 09:28:24 2014 -0800
+++ b/libgo/testsuite/gotest    Fri Nov 21 10:01:45 2014 -0800
@@ -379,7 +379,7 @@
 {
        text="T"
        case "$GOARCH" in
-       ppc64) text="[TD]" ;;
+       ppc64*) text="[TD]" ;;
        esac
 
        symtogo='sed -e s/_test/XXXtest/ -e s/.*_\([^_]*\.\)/\1/ -e 
s/XXXtest/_test/'

Reply via email to