Go: x/build: system linker warnings on macOS 10.15 when using cgo

Created on 22 Sep 2020  路  6Comments  路  Source: golang/go

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

$ go version

go version go1.15.2 darwin/amd64

Does this issue reproduce with the latest release?

Yes.
It seems this issue is related to https://github.com/golang/go/issues/36025.

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

go env Output

$ go env

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/peterlai/Library/Caches/go-build"
GOENV="/Users/peterlai/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/peterlai/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/peterlai/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.15.2/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.15.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/peterlai/diode_go_client/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/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-build398699140=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Recently I upgraded golang from 1.14.4 to 1.15.2 with brew upgrade go.

After I upgraded, there are couple of warnings when I build our client, which we use cgo because of using openssl library, the source code: https://github.com/diodechain/diode_go_client/.

What did you expect to see?

No output on stdout/stderr.
This output was not shown with my system using go 1.14.4

What did you see instead?

When running the run command, or the go build command, I have the following output:

ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000000.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000001.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000002.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000003.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000004.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000005.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000006.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000007.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000008.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000009.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/go.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000010.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000011.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000012.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000013.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000048.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000049.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000050.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-116021407/000051.o) was built for newer OSX version (10.15) than being linked (10.14)

I can remove these warning with the CGO_CFLAGS=-mmacosx-version-min=10.12 (found in this commit: https://go-review.googlesource.com/c/build/+/216304/5/cmd/release/release.go#367)

Builders NeedsInvestigation OS-Darwin WaitingForInfo

Most helpful comment

Just chiming in, I encountered this same error after upgrading to go 1.15 with brew. Removing the version of go installed by brew and then installing the pkg from the golang site resolved my issue.

All 6 comments

Changed this to an x/build issue since I believe this is an issue with the packaging.

/cc @andybons @dmitshur @toothrot

@gopherbot add OS-Darwin

@sc0Vu Do you encounter the same error if you download and use the pkg from the golang site?

Just chiming in, I encountered this same error after upgrading to go 1.15 with brew. Removing the version of go installed by brew and then installing the pkg from the golang site resolved my issue.

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

Was this page helpful?
0 / 5 - 0 ratings