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

building <go-1.16 fails with SIGKILL on M1/arm64 chipset #44977

Closed
rbcrwd opened this issue Mar 12, 2021 · 3 comments
Closed

building <go-1.16 fails with SIGKILL on M1/arm64 chipset #44977

rbcrwd opened this issue Mar 12, 2021 · 3 comments

Comments

@rbcrwd
Copy link

rbcrwd commented Mar 12, 2021

NB: this originated in trying to use moovweb/gvm to install older versions of Go on an M1 mac. If earlier versions of Go are not expected to build for GOOS=darwin GOARCH=arm64, please disregard.

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

$ go version
go version go1.16.2 darwin/arm64

Does this issue reproduce with the latest release?

No.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/spaetzle/Library/Caches/go-build"
GOENV="/Users/spaetzle/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/spaetzle/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/spaetzle/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/spaetzle/sdk/go1.16.2"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/spaetzle/sdk/go1.16.2/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.16.2"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/spaetzle/src/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/xw/3_r56yvs1fx3b7d4wrwqsrrw0000gn/T/go-build679719235=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

  1. bone-stock M1 Mac, v11.2.3
  2. Install brew.sh + go Go (brew install go)
  3. go get golang.org/dl/go1.16.2
  4. go1.16.2 download
  5. export PATH="$HOME/sdk/go1.16.2/bin:$PATH"
  6. mkdir ~/src && cd ~/src && git clone https://github.com/golang/go.git
  7. cd ~/src/go/src && git checkout go1.15.10
  8. ./all.bash

What did you expect to see?

Completed build of go1.15.10

What did you see instead?

Building Go cmd/dist using /Users/spaetzle/sdk/go1.16.2. (go1.16.2 darwin/arm64)
Building Go toolchain1 using /Users/spaetzle/sdk/go1.16.2.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
warning: unable to find runtime/cgo.a
Building Go toolchain2 using go_bootstrap and Go toolchain1.
# cmd/cgo
ld: warning: -no_pie ignored for arm64
# cmd/asm
ld: warning: -no_pie ignored for arm64
# cmd/link
ld: warning: -no_pie ignored for arm64
# cmd/compile
ld: warning: -no_pie ignored for arm64
Building Go toolchain3 using go_bootstrap and Go toolchain2.
go tool compile: signal: killed
go tool compile: signal: killed
go tool compile: signal: killed
go tool compile: signal: killed
go tool dist: FAILED: /Users/spaetzle/src/go/pkg/tool/darwin_arm64/go_bootstrap install -gcflags=all= -ldflags=all= -a -i cmd/asm cmd/cgo cmd/compile cmd/link: exit status 1

Each failure produces a similar (albeit opaque) log in Console.app:
Mar 12 16:15:27 spaetzle com.apple.xpc.launchd[1] (com.apple.mdworker.shared.0E000000-0100-0000-0000-000000000000[57775]) <Notice>: Service exited due to SIGKILL | sent by mds[514]

@rbcrwd
Copy link
Author

rbcrwd commented Mar 12, 2021

This does seem similar to some of the details published in #42684, but that seemed to go in a different direction.

@rbcrwd rbcrwd changed the title building <go-1.16.1 fails with SIGKILL on M1/arm64 chipset building <go-1.16 fails with SIGKILL on M1/arm64 chipset Mar 12, 2021
@dmitshur
Copy link
Contributor

If earlier versions of Go are not expected to build for GOOS=darwin GOARCH=arm64, please disregard.

Go 1.16 is the first version of Go that adds support for Apple silicon. Go 1.15 and older versions don’t support it. Back then, GOOS=darwin GOARCH=arm64 was a way of targeting iOS. See https://golang.org/doc/go1.16#ports.

CC @cherrymui, @golang/release.

@rbcrwd
Copy link
Author

rbcrwd commented Mar 13, 2021

Thanks for the response. That's going to create increasing tension for developers buying or replacing equipment and still supporting non-bleeding-edge toolchains or libraries with native library CGO dependencies.

This is enough of a compatibility break that I would have expected to see some sort of documentation. Unfortunately, while the 1.16 release notes do mention the darwin->ios shift, they do not indicate that 1.15 and below will not be supported on the chipset, nor does the MinimumRequirements doc in this project's wiki reflect anything post-1.15.

@golang golang locked and limited conversation to collaborators Mar 13, 2022
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