Open
Description
What version of Go are you using (go version
)?
$ go version go1.12.7 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env
)?
Mac Mojave 10.14.5
Result of go env
:
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/avence12/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/avence12/.gvm/pkgsets/go1.12.7/global:/Users/avence12/devel/go"
GOPROXY=""
GORACE=""
GOROOT="/Users/avence12/.gvm/gos/go1.12.7"
GOTMPDIR=""
GOTOOLDIR="/Users/avence12/.gvm/gos/go1.12.7/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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/9n/_tfc4bt12ps45qjyzh40jt1h0000gn/T/go-build525129295=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
- Install and use go1.12.7 by GVM
- Get into my project and run
go build ./...
- The build is successful but seeing lots of ld warning. The same situation when I run
go test ./...
- When I setup
export CGO_ENABLED=0
, the warning is gone. However I would like to know how to resolve the issue.
What did you expect to see?
No ld warnings when CGO_ENABLED=1
What did you see instead?
$ go build ./cmd/...
# github.com/avence12/myproj/cmd/client
ld: warning: building for macOS, but linking in object file (/var/folders/9n/_tfc4bt12ps45qjyzh40jt1h0000gn/T/go-link-703159202/go.o) built for
# github.com/avence12/myproj/cmd/server
ld: warning: building for macOS, but linking in object file (/var/folders/9n/_tfc4bt12ps45qjyzh40jt1h0000gn/T/go-link-846047020/go.o) built for
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Triage Backlog