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

Cannot sign darwin / arm64 binaries (dyld_info out of place) #42507

Closed
gjasny opened this issue Nov 11, 2020 · 6 comments
Closed

Cannot sign darwin / arm64 binaries (dyld_info out of place) #42507

gjasny opened this issue Nov 11, 2020 · 6 comments

Comments

@gjasny
Copy link

gjasny commented Nov 11, 2020

Hello,

Code-signing of Darwin arm64 binaries fails.

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

$ go version

go version devel +f2e186b877 Wed Nov 11 06:26:05 2020 +0000 darwin/amd64

Does this issue reproduce with the latest release?

N/A due to lacking arm64 support

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

go env Output
$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/gregorj/Library/Caches/go-build"
GOENV="/Users/gregorj/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/gregorj/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/gregorj/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/gregorj/src/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/gregorj/src/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="devel +f2e186b877 Wed Nov 11 06:26:05 2020 +0000"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/gregorj/Git/xcgopretty/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 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/2m/qlwtkgc92k50mntftntz0k3w0000gn/T/go-build070598418=/tmp/go-build -gno-record-gcc-switches -fno-common"

MacOS: 10.15.7
Xcode: 12.1

What did you do?

Created an empty main.go:

package main

func main() {


}
GOOS=darwin GOARCH=arm64 /Users/gregorj/src/go/bin/go build -o simple.arm64
codesign --sign MY_IDENTITY ./simple.arm64

codesign_allocate: fatal error: file not in an order that can be processed (dyld_info out of place): /Users/gregorj/Git/xcgopretty/simple.arm64

Signing an amd64 binary works as expected.

Do you have an idea what's going on?

Thanks,
Gregor

@cherrymui
Copy link
Member

Thanks for reporting. I don't know what the requirements for code-signing are, but I'll look into it.

@gopherbot
Copy link

Change https://golang.org/cl/269377 mentions this issue: cmd/link: put DYLD_INFO at beginning of LINKEDIT segment on darwin

@cherrymui
Copy link
Member

@gjasny does CL https://go-review.googlesource.com/c/go/+/269377 help? (I don't know how to run code signing myself locally to test.)

You can check out the CL by

git fetch https://go.googlesource.com/go refs/changes/77/269377/1 && git checkout FETCH_HEAD

and rebuild the Go toolchain.

Thanks.

@gjasny
Copy link
Author

gjasny commented Nov 12, 2020

Thank you for fixing this so fast. The codesign tool is now happy.

@gjasny
Copy link
Author

gjasny commented Nov 12, 2020

Once that change hits master, are there nightly builds of golang published somewhere so that I don't have to wait for an 1.16 release?

@cherrymui
Copy link
Member

Thanks for confirming!

No, we don't have nightly builds. Go 1.16 beta will be coming soonish, probably early December.

@golang golang locked and limited conversation to collaborators Nov 12, 2021
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