All:

I am writing and building my code on a mac. The code is a linux binary
though so its obviously a cross compilation. This works fine:

GOOS=linux GOARCH=amd64  go build .

This does not:

GOOS=linux GOARCH=amd64  go build -race .
go build: -race requires cgo; enable cgo by setting CGO_ENABLED=1

Nor does this:

 GOOS=linux GOARCH=amd64  CGO_ENABLED=1 go build -race .
# runtime/cgo
ld: unknown option: --build-id=none
clang: error: linker command failed with exit code 1 (use -v to see
invocation)



Go env below:

GOARCH="amd64"

GOBIN="/Users/jlorenzini/go/bin"

GOEXE=""

GOHOSTARCH="amd64"

GOHOSTOS="darwin"

GOOS="darwin"

GOPATH="/Users/jlorenzini/go"

GORACE=""

GOROOT="/usr/local/go"

GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"

CC="clang"

GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments
-fmessage-length=0
-fdebug-prefix-map=/var/folders/8w/7ndx_j6s36x9hm9dns67j21s3hynqn/T/go-build987997970=/tmp/go-build
-gno-record-gcc-switches -fno-common"

CXX="clang++"

CGO_ENABLED="1"

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to