Search code examples
goinstallationelfpowerpc

Go: Not running on powerpc64 (big-endian)


I have downloaded the GO package(ppc64) for the PowerPC 64 machine.When I run the go it throws the following error:

./go: line 1:ELF▒9@p@8: not found
./go: line 2: syntax error: unexpected ")"

Machine information is like below,

uname -a
Linux 0005B9427C4C 3.12.19-rt30 #1 SMP Sun Jul 2 16:21:28 IST 2017 ppc64 GNU/Linux

From /proc/cpuinfo: processor : 0 cpu : e6500, altivec supported clock : 1599.999984MHz revision : 2.0 (pvr 8040 0120)

processor       : 1
cpu             : e6500, altivec supported
clock           : 1599.999984MHz
revision        : 2.0 (pvr 8040 0120)

processor       : 2
cpu             : e6500, altivec supported
clock           : 1599.999984MHz
revision        : 2.0 (pvr 8040 0120)

processor       : 3
cpu             : e6500, altivec supported
clock           : 1599.999984MHz
revision        : 2.0 (pvr 8040 0120)

processor       : 4
cpu             : e6500, altivec supported
clock           : 1599.999984MHz
revision        : 2.0 (pvr 8040 0120)

processor       : 5
cpu             : e6500, altivec supported
clock           : 1599.999984MHz
revision        : 2.0 (pvr 8040 0120)

processor       : 6
cpu             : e6500, altivec supported
clock           : 1599.999984MHz
revision        : 2.0 (pvr 8040 0120)

processor       : 7
cpu             : e6500, altivec supported
clock           : 1599.999984MHz
revision        : 2.0 (pvr 8040 0120)

timebase        : 41666666
platform        : CoreNet Generic
model           : fsl,B4860QDS

I have downloaded the go1.8.3.linux-ppc64le.tar.gz package from https://golang.org/dl/.

I have searched a lot but could not find any solution. Can you tell me what is going wrong?How to fix it?


Solution

  • Your kernel reports the ppc64 architecture. This means it is 64-bit POWER in big endian mode. The Go project only publishes ppc64le (64-bit POWER in little endian mode) builds: Go stable downloads only offers a go1.8.3.linux-ppc64le.tar.gz download.

    The Go sources contain a 64-bit POWER big-endian port, but you need to compile it yourself. (But this is definitely off the beaten path, so you might run into issues.) Note that Go 1.9 will require POWER8 even in big-endian mode, so depending on the hardware you have, even a self-compiled version could be a dead-end. (e6500 in the /proc/cpuinfo output suggests that this platform is not POWER8-compatibile.)

    Another option is the GCC Go compiler (gccgo). This Go compiler will work with many GCC targets, and the chances are good that it will remain supported to some degree in the foreseeable future. However, few Go programmers care about gccgo, so you might encounter packages which do not work with it.