X
X
xotkot2015-08-02 18:29:00
linux
xotkot, 2015-08-02 18:29:00

How to start go (golang) on ​​old hardware?

There is an old ten-year-old hardware with a processor:

% cat /proc/cpuinfo                                                                                                     :(
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 6
model		: 6
model name	: AMD Athlon(tm) XP 2000+
stepping	: 2
cpu MHz		: 1666.576
cache size	: 256 KB
physical id	: 0
siblings	: 1
core id		: 0
cpu cores	: 1
apicid		: 0
initial apicid	: 0
fdiv_bug	: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 1
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow 3dnowprefetch vmmcall
bugs		: fxsave_leak sysret_ss_attrs
bogomips	: 3334.03
clflush size	: 32
cache_alignment	: 32
address sizes	: 34 bits physical, 32 bits virtual
power management: ts

32 bit Arch is spinning on it:
% uname -a
Linux nas 4.1.3-1-ARCH #1 SMP PREEMPT Wed Jul 22 20:52:17 CEST 2015 i686 GNU/Linux

The problem is that after installing the go package , the installation, by the way, went without problems, when you try to use it, it gives out:
% go
SIGILL: illegal instruction
PC=0x81f4ea9

goroutine 1 [running, locked to thread]:
math.init·1()
  /usr/lib/go/src/math/pow10.go:34 +0x19 fp=0x1872df4c sp=0x1872df48
math.init()
  /usr/lib/go/src/math/unsafe.go:21 +0x3f fp=0x1872df50 sp=0x1872df4c
strconv.init()
  /usr/lib/go/src/strconv/quote.go:455 +0x45 fp=0x1872df6c sp=0x1872df50
go/parser.init()
  /usr/lib/go/src/go/parser/parser.go:2462 +0x4a fp=0x1872df78 sp=0x1872df6c
main.init()
  /usr/lib/go/src/cmd/go/zdefaultcc.go:6 +0x45 fp=0x1872dfcc sp=0x1872df78
runtime.main()
  /usr/lib/go/src/runtime/proc.go:58 +0xbd fp=0x1872dff0 sp=0x1872dfcc
runtime.goexit()
  /usr/lib/go/src/runtime/asm_386.s:2287 +0x1 fp=0x1872dff4 sp=0x1872dff0

goroutine 2 [runnable]:
runtime.forcegchelper()
  /usr/lib/go/src/runtime/proc.go:90
runtime.goexit()
  /usr/lib/go/src/runtime/asm_386.s:2287 +0x1

goroutine 3 [runnable]:
runtime.bgsweep()
  /usr/lib/go/src/runtime/mgc0.go:82
runtime.goexit()
  /usr/lib/go/src/runtime/asm_386.s:2287 +0x1

eax     0x187360a0
ebx     0x856f650
ecx     0x187000a0
edx     0x308238f0
edi     0x7
esi     0x2b90
ebp     0x187360a0
esp     0x1872df48
eip     0x81f4ea9
eflags  0x10206
cs      0x73
fs      0x0
gs      0x33

By the way, binaries compiled on another machine for this platform after launch give a similar problem.
The problem with the binary is solved if, after building the toolchain on a new machine:
% cd $(go env GOROOT)/src
% sudo GOOS=linux GOARCH=386 CGO_ENABLED=0 ./make.bash --no-clean

compile the program with parameters:
% GOOS=linux GO386=387 GOARCH=386 go build
in general, after transferring the binary to the old machine, the program works fine.
But here's how to compile programs on the oldest machine so that it doesn't give the error described above?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xotkot, 2015-08-08
@xotkot

in principle, a solution was found, for this I had to change the go compiler to gccgo by installing the gcc-go package package .
The go and gcc-go packages conflict, so installing the latter will automatically remove the former.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question