Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go appears to not support i386 CPUs lacking SSE #20009

Closed
he32 opened this issue Apr 17, 2017 · 7 comments
Closed

go appears to not support i386 CPUs lacking SSE #20009

he32 opened this issue Apr 17, 2017 · 7 comments

Comments

@he32
Copy link

he32 commented Apr 17, 2017

What version of Go are you using (go version)?

1.8 (or, rather, trying to run)
This is a pre-built binary package, i.e. it's not built from source on this host.

What operating system and processor architecture are you using (go env)?

NetBSD/i386 7.1

This is a true i386 CPU:

cpu0: Intel Celeron (Covington) (686-class), 331.13 MHz
cpu0: family 0x6 model 0x5 stepping 0x1 (id 0x651)
cpu0: features 0x183f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA>
cpu0: features 0x183f9ff<CMOV,PAT,PSE36,MMX,FXSR>

As such it has MMX but not SSE, as seen above.

What did you do?

Try to run / use go, e.g. "go version".
Watch it crash and burn with "Illegal instruction".

Examining the core dump reveals:
...
eip 0x807937b 0x807937b <runtime.check+27>
...
(gdb) x/i 0x807937b
=> 0x807937b <runtime.check+27>: xorps %xmm0,%xmm0
(gdb)

What did you expect to see?

1.8

What did you see instead?

Illegal instruction (core dumped)

Now, I realize I'm strictly in the minority here with such an old CPU, and it
may be that go insists on a newer CPU with SSE support.

@ALTree
Copy link
Member

ALTree commented Apr 17, 2017

Does this happen if you set GO386=387 ? I.e.

$ env GO386=387 go build ...

so after building something with 387 (if you have a working version of go on that machine). It shouldn't. If nothing crashes the problem is in your pre-build binary, you'll have to build from source with GO386=387 set to build with support for MMX cpus.

@he32
Copy link
Author

he32 commented Apr 17, 2017 via email

@ALTree
Copy link
Member

ALTree commented Apr 17, 2017

Sorry I edited that message but github sent the mail too fast.

We do support MMX cpus via the GO386 env variable. Doc says we auto-detect it, so if you downloaded a pre-build go toolchain that was build on a SSE2 machine it'll contain SSE2 instructions and the go version crash on your machine is expected.

You'll have to build the toolchain from source on your MMX machine.

@he32
Copy link
Author

he32 commented Apr 17, 2017

Hmm, ok., I'll try to build it on this host.
However, this looks like a missing separation of target and host/build information...

@ALTree
Copy link
Member

ALTree commented Apr 17, 2017

Not really: when cross-compiling you can tune everything you need with env variables. Your problem is that if nothing is set we have to default to something; and we default to what the building machine supports. I believe this is a sensible choice.

@ALTree
Copy link
Member

ALTree commented Apr 17, 2017

I'm closing this since it appears that the crash is caused by a toolchain that was not compiled for your 386 machine (so there's no bug). Please comment if you think you found a bug, and we'll reopen. Thanks.

@ALTree ALTree closed this as completed Apr 17, 2017
@he32
Copy link
Author

he32 commented Apr 17, 2017 via email

@golang golang locked and limited conversation to collaborators Apr 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants