-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: signal/illegal instruction running amd64 Golang compiler on Apple M3 Max #71434
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
Comments
Related: #71339 |
The workaround is to switch Docker's VMM setting to "Docker VMM" or "QEMU (Legacy)". |
1.20 isn't a supported version |
I'm getting this consistently on go 1.23 when using
I've tried it with and without mounting the build cache. It also only happens statistically on different packages, if I run the build a few times I eventually get to finish. I'm on an M4 Pro, here's my env when using
|
This sounds like a bug in the amd64->arm64 emulation on Macs. We never get illegal instruction faults from the toolchain on amd64 hardware. Not sure what we can do about that. Aside: why do lots of people run the amd64 toolchain on arm64 hardware? There's an arm64 toolchain, works just fine... |
That's a good point... we've been building binaries for remote amd64 VMs on Mac, but also through an amd64 docker build image on our Macs. I'm trying an arm64 docker build image, but setting GOOS and GOARCH and all seems to work fine? |
Setting |
Historically, because the amd64 version was the one you got by default on macos so it was way too easy to end up with an amd64 toolchain on apple silicon macs: #52487 (comment) Nowadays you are forced to choose between amd64 and arm64 but people might still sometimes pick the wrong one. See also #59010. |
Go version
go version go1.20.5 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I tried to build a Golang program inside Docker on an M4 MacBook Pro, using an
amd64
version of the Dockergolang
image.Code to reproduce: google-webrisk-amd64-docker.tar.gz
I'm using:
What did you see happen?
The Golang compiler crashed with
signal: illegal instruction
What did you expect to see?
I expected compilation to succeed.
The text was updated successfully, but these errors were encountered: