-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/link: go build -race should fail if cgo is not enabled #12122
Comments
Thanks for the -x output. Please run GOOS=linux GOARCH=amd64 go build -race -x -ldflags=-v Thanks. |
/cc |
I'm not sure whether this can be expected to work. Either way, it did not work in Go 1.4 either, so it's not critical enough to hurry a fix for Go 1.5. |
@ianlancetaylor Here is the output you requested:
|
Does this work? GOOS=linux GOARCH=amd64 go build -race -ldflags=-linkmode=external |
No, that fails with yet another error:
|
Do you have a Darwin -> GNU/Linux C cross-compiler installed on your system? If not, this isn't going to work no matter what we do. The race detector is not written in pure Go, it requires some libc support. |
No, I don't have a cross-compiler installed and wasn't aware I needed to. Now it makes sense. |
Dup of #12844 (fixed Oct 6). |
I'm trying to cross-compile a trivial program on my Mac:
The above works fine and creates a valid Linux executable. However, doing the same thing with the
-race
flag fails:I have not set
GOROOT
, and the Go version is1.5beta3
built with Homebrew.The text was updated successfully, but these errors were encountered: