Illegal Instruction installing Go on older x86 embedded system

442 views
Skip to first unread message

Thorsten von Eicken

unread,
Sep 8, 2013, 11:05:07 AM9/8/13
to golan...@googlegroups.com
I'm failing to install Go 1.1.2 from source on an older Cyrix x86 embedded system and am hoping someone can point me in the right direction. The system runs Ubuntu 10.04. The installation fails in
# Building packages and commands for linux/386.
with:
# os/user
SIGILL: illegal instruction
PC=0x80f7b85

go/printer.(*printer).exprList(0x183f9280, 0x10be, 0x1833d880, 0x5, 0x8, ...)
        /usr/local/go/src/pkg/go/printer/nodes.go:206 +0xc75
go/printer.(*printer).expr1(0x183f9280, 0x18351c60, 0x18376f60, 0x0, 0x2, ...)
        /usr/local/go/src/pkg/go/printer/nodes.go:810 +0x15d9

Where would I start looking?
Would trying gccgo make any sense or am I going to hit the same problem anyway?
Thanks!

# cat /proc/cpuinfo
processor       : 0
vendor_id       : CentaurHauls
cpu family      : 6
model           : 7
model name      : VIA Samuel 2
stepping        : 3
cpu MHz         : 399.000
cache size      : 64 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu de tsc msr cx8 mtrr pge mmx 3dnow up
bogomips        : 800.56
clflush size    : 32
cache_alignment : 32
address sizes   : 32 bits physical, 32 bits virtual
power management:

Full stack trace:
# os/user
SIGILL: illegal instruction
PC=0x80f7b85

go/printer.(*printer).exprList(0x183f9280, 0x10be, 0x1833d880, 0x5, 0x8, ...)
        /usr/local/go/src/pkg/go/printer/nodes.go:206 +0xc75
go/printer.(*printer).expr1(0x183f9280, 0x18351c60, 0x18376f60, 0x0, 0x2, ...)
        /usr/local/go/src/pkg/go/printer/nodes.go:810 +0x15d9
go/printer.(*printer).expr(0x183f9280, 0x18351c60, 0x18376f60)
        /usr/local/go/src/pkg/go/printer/nodes.go:883 +0x49
go/printer.(*printer).printNode(0x183f9280, 0x8186200, 0x18376f60, 0x183f8380, 0x183f7600, ...)
        /usr/local/go/src/pkg/go/printer/printer.go:1002 +0x321
go/printer.(*Config).fprint(0xb72cd4f8, 0x18379bc0, 0x183f7600, 0x183550c0, 0x8186200, ...)
        /usr/local/go/src/pkg/go/printer/printer.go:1165 +0x7d
go/printer.(*printer).nodeSize(0x18372b40, 0x183f8820, 0x18376f60, 0xf4240, 0xf4241, ...)
        /usr/local/go/src/pkg/go/printer/nodes.go:1420 +0x11c
go/printer.(*printer).exprList(0x18372b40, 0x10b0, 0x18377530, 0x1, 0x1, ...)
        /usr/local/go/src/pkg/go/printer/nodes.go:183 +0x46c
go/printer.(*printer).stmt(0x18372b40, 0x18371040, 0x18376f80, 0x183f0000)
        /usr/local/go/src/pkg/go/printer/nodes.go:1090 +0x22b1
go/printer.(*printer).stmtList(0x18372b40, 0x1833d8c0, 0x5, 0x8, 0x1, ...)
        /usr/local/go/src/pkg/go/printer/nodes.go:908 +0x1b1
go/printer.(*printer).block(0x18372b40, 0x183791c0, 0x1)
        /usr/local/go/src/pkg/go/printer/nodes.go:921 +0xb2
go/printer.(*printer).stmt(0x18372b40, 0x18371060, 0x18379500, 0x183f0000)
        /usr/local/go/src/pkg/go/printer/nodes.go:1131 +0x2955
go/printer.(*printer).stmtList(0x18372b40, 0x1836f300, 0xb, 0x10, 0x1, ...)
        /usr/local/go/src/pkg/go/printer/nodes.go:908 +0x1b1
go/printer.(*printer).block(0x18372b40, 0x18379820, 0x1)
        /usr/local/go/src/pkg/go/printer/nodes.go:921 +0xb2
go/printer.(*printer).adjBlock(0x18372b40, 0x4b, 0xb, 0x18379820)
        /usr/local/go/src/pkg/go/printer/nodes.go:1490 +0x4a3
go/printer.(*printer).funcDecl(0x18372b40, 0x18379840)
        /usr/local/go/src/pkg/go/printer/nodes.go:1514 +0x1fe
go/printer.(*printer).decl(0x18372b40, 0x18351b20, 0x18379840)
        /usr/local/go/src/pkg/go/printer/nodes.go:1524 +0x87
go/printer.(*printer).declList(0x18372b40, 0x1833d800, 0x5, 0x8)
        /usr/local/go/src/pkg/go/printer/nodes.go:1565 +0x132
go/printer.(*printer).file(0x18372b40, 0x1833dac0)
        /usr/local/go/src/pkg/go/printer/nodes.go:1573 +0x116
go/printer.(*printer).printNode(0x18372b40, 0x8181200, 0x1833dac0, 0x183f8380, 0x8154da0, ...)
        /usr/local/go/src/pkg/go/printer/printer.go:1026 +0x601
go/printer.(*Config).fprint(0x8270190, 0x18379da0, 0x183f17c8, 0x183550c0, 0x8181200, ...)
        /usr/local/go/src/pkg/go/printer/printer.go:1165 +0x7d
go/printer.(*Config).Fprint(0x8270190, 0x18379da0, 0x183f17c8, 0x183550c0, 0x8181200, ...)
        /usr/local/go/src/pkg/go/printer/printer.go:1223 +0x75
main.(*Package).writeOutput(0x183412a0, 0x1833d100, 0xbfb43941, 0xe)
        /usr/local/go/src/cmd/cgo/out.go:449 +0x3da
main.main()
        /usr/local/go/src/cmd/cgo/main.go:278 +0xf51
eax     0x1
ebx     0x1
ecx     0xb72dc5ec
edx     0x4
edi     0xb72dc514
esi     0x8186d80
ebp     0x4a
esp     0xb72dc504
eip     0x80f7b85
eflags  0x10202
cs      0x73
fs      0x0
gs      0x57


andrey mirtchovski

unread,
Sep 8, 2013, 11:11:33 AM9/8/13
to Thorsten von Eicken, golang-nuts
see if building with GO386=387 helps:

https://groups.google.com/d/msg/golang-nuts/Pb3yVUpXIKQ/-iqM6vqqJ6AJ
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

minux

unread,
Sep 8, 2013, 11:17:33 AM9/8/13
to Thorsten von Eicken, golang-nuts
On Sun, Sep 8, 2013 at 11:05 AM, Thorsten von Eicken <t...@rightscale.com> wrote:
I'm failing to install Go 1.1.2 from source on an older Cyrix x86 embedded system and am hoping someone can point me in the right direction. The system runs Ubuntu 10.04. The installation fails in
# Building packages and commands for linux/386.
with:
# os/user
SIGILL: illegal instruction
PC=0x80f7b85

go/printer.(*printer).exprList(0x183f9280, 0x10be, 0x1833d880, 0x5, 0x8, ...)
        /usr/local/go/src/pkg/go/printer/nodes.go:206 +0xc75
go/printer.(*printer).expr1(0x183f9280, 0x18351c60, 0x18376f60, 0x0, 0x2, ...)
        /usr/local/go/src/pkg/go/printer/nodes.go:810 +0x15d9
this is strange, the GO386 setting should be automatically detected when doing native compilation.

what's the output of $GOROOT/pkg/tool/linux_386/dist env ?

Thorsten von Eicken

unread,
Sep 8, 2013, 12:07:30 PM9/8/13
to golan...@googlegroups.com, Thorsten von Eicken


On Sunday, September 8, 2013 8:17:33 AM UTC-7, minux wrote:
this is strange, the GO386 setting should be automatically detected when doing native compilation.

what's the output of $GOROOT/pkg/tool/linux_386/dist env ?
 
# ./pkg/tool/linux_386/dist env
GOROOT="/usr/local/go"
GOBIN="/usr/local/go/bin"
GOARCH="386"
GOOS="linux"
GOHOSTARCH="386"
GOHOSTOS="linux"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_386"
GOCHAR="8"
GO386="387"

Thorsten von Eicken

unread,
Sep 8, 2013, 12:29:17 PM9/8/13
to golan...@googlegroups.com, Thorsten von Eicken
On Sunday, September 8, 2013 8:11:33 AM UTC-7, andrey mirtchovski wrote:
see if building with GO386=387 helps:

# export GO386=387
# ./all.bash
ends in the same failure...

Rémy Oudompheng

unread,
Sep 8, 2013, 12:34:23 PM9/8/13
to Thorsten von Eicken, golang-nuts
2013/9/8 Thorsten von Eicken <t...@rightscale.com>:
Dissassemble the binary ($GOROOT/pkg/tool/linux_386/cgo) and show what
instruction is found at address "PC=0x80f7b85".

Rémy.

Thorsten von Eicken

unread,
Sep 8, 2013, 4:48:51 PM9/8/13
to golan...@googlegroups.com, Thorsten von Eicken
Exception: SIGILL: illegal instruction  PC=0x80f7b85
go/printer.(*printer).exprList(0x183f8280, 0x10be, 0x1833d880, 0x5, 0x8, ...)
        /usr/local/go/src/pkg/go/printer/nodes.go:206 +0xc75

Dump of assembler code for function go/printer.(*printer).exprList:
   0x080f6f10 <+0>:     mov    %gs:0x0,%ecx
   0x080f6f17 <+7>:     mov    -0x8(%ecx),%ecx
[...]
   0x080f7b6f <+3167>:  fdivrp %st,%st(1)
   0x080f7b71 <+3169>:  fstpl  0x170(%esp)
   0x080f7b78 <+3176>:  fldl   0x170(%esp)
   0x080f7b7f <+3183>:  fldl   0x81d17d8
-->0x080f7b85 <+3189>:  fucomip %st(1),%st
   0x080f7b87 <+3191>:  fstp   %st(0)
   0x080f7b89 <+3193>:  jae    0x80f7ba8 <go/printer.(*printer).exprList+3224>
   0x080f7b8b <+3195>:  fldl   0x81d17e8
   0x080f7b91 <+3201>:  fldl   0x170(%esp)
   0x080f7b98 <+3208>:  fucomip %st(1),%st

Ian Lance Taylor

unread,
Sep 8, 2013, 5:40:13 PM9/8/13
to Thorsten von Eicken, golang-nuts
On Sun, Sep 8, 2013 at 1:48 PM, Thorsten von Eicken <t...@rightscale.com> wrote:
> Exception: SIGILL: illegal instruction PC=0x80f7b85
> go/printer.(*printer).exprList(0x183f8280, 0x10be, 0x1833d880, 0x5, 0x8,
> ...)
> /usr/local/go/src/pkg/go/printer/nodes.go:206 +0xc75
>
> Dump of assembler code for function go/printer.(*printer).exprList:
> 0x080f6f10 <+0>: mov %gs:0x0,%ecx
> 0x080f6f17 <+7>: mov -0x8(%ecx),%ecx
> [...]
> 0x080f7b6f <+3167>: fdivrp %st,%st(1)
> 0x080f7b71 <+3169>: fstpl 0x170(%esp)
> 0x080f7b78 <+3176>: fldl 0x170(%esp)
> 0x080f7b7f <+3183>: fldl 0x81d17d8
> -->0x080f7b85 <+3189>: fucomip %st(1),%st

The fucomip instruction was introduced in the Pentium Pro. You are
using an original version VIA C3, whch is only 486 compatible, not
even Pentium compatible (thanks for providing the /proc/cpuinfo
contents). The current 8g compiler assumes that it is always OK to
generate Pentium Pro instructions. There isn't going to be any simple
workaround here.

Ian

Thorsten von Eicken

unread,
Sep 8, 2013, 5:52:00 PM9/8/13
to golan...@googlegroups.com, Thorsten von Eicken
Drats! But thank you for the help. Do I assume correctly that gccgo should work?

Ian Lance Taylor

unread,
Sep 8, 2013, 6:07:22 PM9/8/13
to Thorsten von Eicken, golang-nuts
On Sun, Sep 8, 2013 at 2:52 PM, Thorsten von Eicken <t...@rightscale.com> wrote:
> Drats! But thank you for the help. Do I assume correctly that gccgo should
> work?

Yes, gccgo should work.

Ian
Reply all
Reply to author
Forward
0 new messages