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

cmd/link: system linker warnings on macOS 10.14 when using cgo #36025

Closed
tjamet opened this issue Dec 6, 2019 · 47 comments
Closed

cmd/link: system linker warnings on macOS 10.14 when using cgo #36025

tjamet opened this issue Dec 6, 2019 · 47 comments
Assignees
Milestone

Comments

@tjamet
Copy link

@tjamet tjamet commented Dec 6, 2019

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

$ go version
go version go1.13.5 darwin/amd64

Does this issue reproduce with the latest release?

yes, in fact, is has been introduced by the latest release

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/thibault/Library/Caches/go-build"
GOENV="/Users/thibault/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY="[REDACTED]"
GONOSUMDB="[REDACTED]"
GOOS="darwin"
GOPATH="/Users/thibault/go/"
GOPRIVATE="[REDACTED]"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/thibault/go/src/github.com/tjamet/gotiff/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/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-build152848555=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Install go 1.13.5 from official release using the installer. This replaced my previously installed version

Then, I ran a program, I had previously run using go 1.13.1 using go run main.go, importing the sqlite package, using CGO

Here is the snippet that reproduces the problem:

package main

import (
	"database/sql"
	"log"

	_ "github.com/mattn/go-sqlite3"
)

func main() {
	db, err := sql.Open("sqlite3", "test.db")
	if err != nil {
		log.Fatalln("could not open database:", err)
	}
	defer db.Close()
}

What did you expect to see?

No output on stdout/stderr.
This output was not shown with my system (10.14.6 (18G95)) using go 1.13.1
I am unsure the issue is linked to go or to go-sqlite3

What did you see instead?

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

# command-line-arguments
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-937073420/000012.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-937073420/000013.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-937073420/000014.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-937073420/000015.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-937073420/000016.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-937073420/000017.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-937073420/000018.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-937073420/000019.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-937073420/000020.o) was built for newer OSX version (10.15) than being linked (10.14)
@ianlancetaylor ianlancetaylor changed the title CGO: ld warnings on OSX 1.14 cmd/link: system linker warnings on OSX 1.14 when using cgo Dec 6, 2019
@ianlancetaylor ianlancetaylor added this to the Go1.14 milestone Dec 6, 2019
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Dec 6, 2019

CC @andybons @dmitshur

Is anybody else seeing this? Did we build the 1.13.5 release on macOS 10.15?

@tjamet Do you see this problem with other Go programs?

@andybons
Copy link
Member

@andybons andybons commented Dec 6, 2019

@ianlancetaylor the release is built on 10.15, yes. It may be that we need to explicitly set a target of macOS when building. See #35459.

@cagedmantis @toothrot

@andybons
Copy link
Member

@andybons andybons commented Dec 6, 2019

@tjamet can you provide the output of go build -x?

@networkimprov
Copy link

@networkimprov networkimprov commented Dec 7, 2019

Looks like a dup of #22281 & #35193 & #33968

@eliasnaur @odeke-em

@tjamet
Copy link
Author

@tjamet tjamet commented Dec 8, 2019

indeed, it looks very much like a duplicate of those tickets. Sorry about that!
I didn't see the problem with other programs @ianlancetaylor I am not using CGO for any other program though.

here is the output of go build -x

mkdir -p $WORK/b001/
cat >$WORK/b001/importcfg.link << 'EOF' # internal
packagefile command-line-arguments=/Users/thibault/Library/Caches/go-build/8b/8b55a428107aaee0aeb04dbd587b78f8591105cf4efaadbbfdd8ea1e47ebbc0d-d
packagefile database/sql=/usr/local/go/pkg/darwin_amd64/database/sql.a
packagefile github.com/mattn/go-sqlite3=/Users/thibault/Library/Caches/go-build/62/625d875525aa67b6968cdde27e0b741576d49506c84aa2445d2b46695be60ef7-d
packagefile log=/usr/local/go/pkg/darwin_amd64/log.a
packagefile runtime=/usr/local/go/pkg/darwin_amd64/runtime.a
packagefile context=/usr/local/go/pkg/darwin_amd64/context.a
packagefile database/sql/driver=/usr/local/go/pkg/darwin_amd64/database/sql/driver.a
packagefile errors=/usr/local/go/pkg/darwin_amd64/errors.a
packagefile fmt=/usr/local/go/pkg/darwin_amd64/fmt.a
packagefile io=/usr/local/go/pkg/darwin_amd64/io.a
packagefile reflect=/usr/local/go/pkg/darwin_amd64/reflect.a
packagefile sort=/usr/local/go/pkg/darwin_amd64/sort.a
packagefile strconv=/usr/local/go/pkg/darwin_amd64/strconv.a
packagefile sync=/usr/local/go/pkg/darwin_amd64/sync.a
packagefile sync/atomic=/usr/local/go/pkg/darwin_amd64/sync/atomic.a
packagefile time=/usr/local/go/pkg/darwin_amd64/time.a
packagefile unicode=/usr/local/go/pkg/darwin_amd64/unicode.a
packagefile unicode/utf8=/usr/local/go/pkg/darwin_amd64/unicode/utf8.a
packagefile crypto/sha1=/usr/local/go/pkg/darwin_amd64/crypto/sha1.a
packagefile crypto/sha256=/usr/local/go/pkg/darwin_amd64/crypto/sha256.a
packagefile crypto/sha512=/usr/local/go/pkg/darwin_amd64/crypto/sha512.a
packagefile math=/usr/local/go/pkg/darwin_amd64/math.a
packagefile net/url=/usr/local/go/pkg/darwin_amd64/net/url.a
packagefile strings=/usr/local/go/pkg/darwin_amd64/strings.a
packagefile runtime/cgo=/usr/local/go/pkg/darwin_amd64/runtime/cgo.a
packagefile syscall=/usr/local/go/pkg/darwin_amd64/syscall.a
packagefile os=/usr/local/go/pkg/darwin_amd64/os.a
packagefile internal/bytealg=/usr/local/go/pkg/darwin_amd64/internal/bytealg.a
packagefile internal/cpu=/usr/local/go/pkg/darwin_amd64/internal/cpu.a
packagefile runtime/internal/atomic=/usr/local/go/pkg/darwin_amd64/runtime/internal/atomic.a
packagefile runtime/internal/math=/usr/local/go/pkg/darwin_amd64/runtime/internal/math.a
packagefile runtime/internal/sys=/usr/local/go/pkg/darwin_amd64/runtime/internal/sys.a
packagefile internal/reflectlite=/usr/local/go/pkg/darwin_amd64/internal/reflectlite.a
packagefile internal/fmtsort=/usr/local/go/pkg/darwin_amd64/internal/fmtsort.a
packagefile math/bits=/usr/local/go/pkg/darwin_amd64/math/bits.a
packagefile internal/race=/usr/local/go/pkg/darwin_amd64/internal/race.a
packagefile crypto=/usr/local/go/pkg/darwin_amd64/crypto.a
packagefile encoding/binary=/usr/local/go/pkg/darwin_amd64/encoding/binary.a
packagefile hash=/usr/local/go/pkg/darwin_amd64/hash.a
packagefile internal/oserror=/usr/local/go/pkg/darwin_amd64/internal/oserror.a
packagefile internal/poll=/usr/local/go/pkg/darwin_amd64/internal/poll.a
packagefile internal/syscall/unix=/usr/local/go/pkg/darwin_amd64/internal/syscall/unix.a
packagefile internal/testlog=/usr/local/go/pkg/darwin_amd64/internal/testlog.a
EOF
mkdir -p $WORK/b001/exe/
cd .
/usr/local/go/pkg/tool/darwin_amd64/link -o $WORK/b001/exe/a.out -importcfg $WORK/b001/importcfg.link -buildmode=exe -buildid=wEANusrRlE4PWCHXqU7k/6MHzcFQa7XackiClGHR7/zuSDETUaEJrB7Vx2l-Qq/wEANusrRlE4PWCHXqU7k -extld=clang /Users/thibault/Library/Caches/go-build/8b/8b55a428107aaee0aeb04dbd587b78f8591105cf4efaadbbfdd8ea1e47ebbc0d-d
/usr/local/go/pkg/tool/darwin_amd64/buildid -w $WORK/b001/exe/a.out # internal
# command-line-arguments
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-168878093/000012.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-168878093/000013.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-168878093/000014.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-168878093/000015.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-168878093/000016.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-168878093/000017.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-168878093/000018.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-168878093/000019.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/dt/lz9gptg91vzchq7zp5grt85h0000gn/T/go-link-168878093/000020.o) was built for newer OSX version (10.15) than being linked (10.14)
mv $WORK/b001/exe/a.out main
rm -r $WORK/b001/
@toothrot
Copy link
Contributor

@toothrot toothrot commented Dec 9, 2019

I don't have a mac machine handy (and am just learning the x/build/cmd/release code), but is setting MACOSX_DEPLOYMENT_TARGET in x/build/dashboard/builders.go#L528 sufficient?

Edit: I'll work on answering this question

@mariusgrigoriu
Copy link

@mariusgrigoriu mariusgrigoriu commented Dec 16, 2019

Also experiencing this on MacOS 10.14 with Go 1.13.5 with cgo on a different project. Downgrading to Go 1.13.4 makes the warnings go away.

@richard-mauri
Copy link

@richard-mauri richard-mauri commented Dec 16, 2019

I also am experiencing this on MaxOS 10.14.6 with go1.13.5
Downgrading to go1.13.4 makes the warnings go away

$ go version
go version go1.13.5 darwin/amd64

$ go build -o ./bin/darwin/encompassbeat -x  main.go
WORK=/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-build282330584
cat /Users/rmauri/Library/Caches/go-build/e8/e8bbe37f80f74a7fd8d266dcbdc46a831422aa01c21cb85e9bb3f6ff9e1af029-d  # internal
# command-line-arguments
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000000.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000001.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000002.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000003.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000004.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000009.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000010.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000015.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000016.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000017.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000018.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000019.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000020.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000021.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000022.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000023.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000024.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000025.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000026.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/000027.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/s0/g6ny6y0d5ss2fcspmcfhzfxn41wtqr/T/go-link-812475010/go.o) was built for newer OSX version (10.15) than being linked (10.14)```
@cagedmantis cagedmantis self-assigned this Dec 17, 2019
@medyagh
Copy link

@medyagh medyagh commented Dec 21, 2019

I have the same problem

$ go version
go version go1.13.5 darwin/amd64
@JasonZhang95
Copy link

@JasonZhang95 JasonZhang95 commented Jan 9, 2020

also met this problem

# command-line-arguments ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000000.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000001.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000002.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000003.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000004.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/go.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000005.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000006.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000007.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000008.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000009.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000010.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000011.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000012.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000013.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/sw/lgrvgk450ld5bvskc749btb80000gp/T/go-link-242272134/000014.o) was built for newer OSX version (10.15) than being linked (10.14)

@toothrot
Copy link
Contributor

@toothrot toothrot commented Jan 9, 2020

@cagedmantis has been working on this all week, and it's a bit more involved than we first expected. We're still working on it, and will keep this thread updated.

@sourav1547
Copy link

@sourav1547 sourav1547 commented Jan 13, 2020

This issue got resolved with go version go1.13.6 darwin/amd64. Thanks a lot.

@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Jan 13, 2020

@sourav1547 Would you mind sharing what version of macOS you are using?

@sourav1547
Copy link

@sourav1547 sourav1547 commented Jan 13, 2020

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.14.6
BuildVersion:	18G103
@mariusgrigoriu
Copy link

@mariusgrigoriu mariusgrigoriu commented Jan 13, 2020

Still experiencing this issue with go1.13.6.

@NeonDodongo
Copy link

@NeonDodongo NeonDodongo commented Jan 15, 2020

I am also experiencing this problem with go1.13.6
On Mac OS X v10.14.6

@tinybit
Copy link

@tinybit tinybit commented Jan 16, 2020

Still experiencing the same problem with 1.13.6

ld: warning: object file (/var/folders/lv/99xc89057771b7ldn6vtgg5rgd57nj/T/go-link-599844632/000000.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/lv/99xc89057771b7ldn6vtgg5rgd57nj/T/go-link-599844632/000001.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/lv/99xc89057771b7ldn6vtgg5rgd57nj/T/go-link-599844632/000002.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/lv/99xc89057771b7ldn6vtgg5rgd57nj/T/go-link-599844632/go.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/lv/99xc89057771b7ldn6vtgg5rgd57nj/T/go-link-599844632/000003.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/lv/99xc89057771b7ldn6vtgg5rgd57nj/T/go-link-599844632/000004.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/lv/99xc89057771b7ldn6vtgg5rgd57nj/T/go-link-599844632/000005.o) was built for newer OSX version (10.15) than being linked (10.14) ld: warning: object file (/var/folders/lv/99xc89057771b7ldn6vtgg5rgd57nj/T/go-link-599844632/000006.o) was built for newer OSX version (10.15) than being linked (10.14)

Mac OS X version: 10.14.6

@ibrt
Copy link
Contributor

@ibrt ibrt commented Jan 19, 2020

Also experiencing this with go1.13.6:

ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000006.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000007.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000008.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000009.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000010.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000011.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000012.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000013.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000014.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000015.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000016.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000017.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000018.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000019.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000022.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000023.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000024.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/rv/_jh1r0892_v7cq6l377lwbh80000gn/T/go-link-482883828/000025.o) was built for newer OSX version (10.15) than being linked (10.14)

@gopherbot
Copy link

@gopherbot gopherbot commented Jan 24, 2020

Change https://golang.org/cl/216304 mentions this issue: cmd/release: set the minimum macOS version supported by releases

@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Jan 27, 2020

I've been able to reproduce this issue using the go1.12.15 release.

@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Jan 28, 2020

@gopherbot please open a backport for 1.12 and 1.13 since the linker warnings are appearing in both versions.

gopherbot pushed a commit to golang/build that referenced this issue Jan 31, 2020
When the macOS releases were moved over to the macOS 10.15 (Catalina)
builders, the macOS SDK version was set in the resulting
binaries Mach-O commands. When a cgo application was built using
a macOS version earlier than the macOS version (and macOS SDK version)
that Go was built on, the external linker would log warnings about the
version mismatch. Setting the version to the earliest version of macOS
supported by the release eliminates the external linker warnings.

Fixes golang/go#36900
Updates golang/go#36025
Updates golang/go#35459

Change-Id: Ie2ef7216af1ddd2afaffea53eca064bfe5c52d63
Reviewed-on: https://go-review.googlesource.com/c/build/+/216304
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
@thinkall
Copy link

@thinkall thinkall commented Feb 10, 2020

I meet the same issue with:

$ go version
go version go1.13.7 darwin/amd64

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.14.5
BuildVersion:	18F203
@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Feb 10, 2020

This issue has been resolved in go1.14. It will be resolved in the next go1.13 release as well.

@itsmontoya
Copy link

@itsmontoya itsmontoya commented Feb 11, 2020

Experienced this issue as well:

$ go version
go version go1.13.7 darwin/amd64
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.3
BuildVersion:   19D76

Looking forward to the next release. @cagedmantis - do we have a rough ETA?

@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Feb 12, 2020

@itsmontoya Correction, it will be the 13.9 release (estimated release month is March).

@itsmontoya
Copy link

@itsmontoya itsmontoya commented Feb 13, 2020

That's a bummer, but I appreciate the updated @cagedmantis! I'll probably revert my version down in the meantime.

@toothrot
Copy link
Contributor

@toothrot toothrot commented Feb 18, 2020

@cagedmantis should we close this issue and #35459, and use the backports (#36846 and #36845) for tracking the 1.13 and 1.12 releases?

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Feb 18, 2020

Closing this issue, since it has been resolved in 1.14, makes sense to me. 👍

@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Feb 18, 2020

Makes sense to me. I was keeping it open until the backports were in.

@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Feb 18, 2020

Although I'm not sure about #35459. The Mach-o headers have not been changed by the changes we made. I'm not sure that issue should be closed.

@dmitshur dmitshur changed the title cmd/link: system linker warnings on OSX 1.14 when using cgo cmd/link: system linker warnings on macOS 10.14 when using cgo Feb 26, 2020
@Anjali-Saha
Copy link

@Anjali-Saha Anjali-Saha commented May 8, 2020

hey so ive been reading through this now closed issue. I was seeing the same issue initially with macos 10.15.4 and golang 1.12.17. So I updated to the latest 1.14.2 and am now seeing:

dyld: Library not loaded: iclis09b.dylib
Referenced from: /var/folders/w6/kzlc3_4n7f19wyl7r11mwk1r0000gq/T/go-build077157396/b001/exe/main
Reason: image not found
signal: abort trap

Any idea what is causing this and how to resolve this?

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented May 8, 2020

@Anjali-Saha As you say, this issue is closed, and the problem you mention doesn't seem to have anything to do with this issue. Please open a new issue or use a forum (see https://golang.org/wiki/Questions). Thanks.

@ConradIrwin
Copy link
Contributor

@ConradIrwin ConradIrwin commented May 21, 2020

I just upgraded to go1.14.3 (using brew upgrade go) and I see the same warning when running the test suite for my project as I did before. I have also tried cleaning the build cache with go clean -cache -modcache -testcache, but that seemed to have no effect. I am still seeing:

...
ld: warning: object file (/var/folders/w3/qgblwzwn55x4k_dj39r85jym0000gn/T/go-link-888110593/000019.o) was built for newer OSX version (10.15) than being linked (10.14)
ld: warning: object file (/var/folders/w3/qgblwzwn55x4k_dj39r85jym0000gn/T/go-link-888110593/go.o) was built for newer OSX version (10.15) than being linked (10.14)
...

Is there something I have to do more than upgrade go to get the fix for this?

@sc0Vu
Copy link

@sc0Vu sc0Vu commented Sep 22, 2020

I also see the same warning after upgraded to go1.15.2 and mac os to 10.15.

ld: warning: object file (/var/folders/sw/qywtwldj7vj9wh26cry0cngm0000gn/T/go-link-011568665/000041.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-011568665/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-011568665/000049.o) was built for newer OSX version (10.15) than being linked (10.14)

Any idea about how to fix this?

@networkimprov
Copy link

@networkimprov networkimprov commented Sep 22, 2020

@sc0Vu could you file a new issue to report that, and describe how you upgraded Go and any other applicable config of your machine?

@sc0Vu
Copy link

@sc0Vu sc0Vu commented Sep 22, 2020

It seems go version was hardcoded in https://go-review.googlesource.com/c/build/+/216304/5/cmd/release/release.go#367, which is prefixed with 1.14.

And I can remove these warning with the CGO_CFLAGS=-mmacosx-version-min=10.12 (found in the commit)

@leaanthony leaanthony mentioned this issue Nov 30, 2020
1 of 1 task complete
@gopherbot
Copy link

@gopherbot gopherbot commented Dec 15, 2020

Change https://golang.org/cl/278435 mentions this issue: cmd/release: set macOS deployment target for darwin/arm64 too

@einthusan
Copy link

@einthusan einthusan commented Jan 6, 2021

I am on MacOSX 10.11.6 and I still see these errors with go version go1.14.12 darwin/amd64

ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-218678783/000014.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-218678783/000015.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-218678783/000016.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-218678783/000017.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-218678783/000018.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-218678783/000037.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-218678783/000038.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-218678783/000039.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-218678783/000040.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-218678783/000041.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-218678783/000042.o) was built for newer OSX version (10.12) than being linked (10.11)

Maybe this issue should be re-opened?

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Jan 6, 2021

@einthusan It'll be better to file a new issue, fill in the relevant information, and also mention this issue number. Thanks.

@networkimprov
Copy link

@networkimprov networkimprov commented Jan 6, 2021

@einthusan how did you install Go on your Mac? This has been an issue when installing via homebrew.

@einthusan
Copy link

@einthusan einthusan commented Jan 6, 2021

I downloaded it from https://golang.org/dl/ site itself. I was building a simple Ebiten (2D game engine in Go) game. I managed to prevent these warnings from showing when I used a flag to bypass "Metal" on OSX and use OpenGL. e.g. go build -tags=ebitengl main.go

@dmitshur I think we can forgo a fix for this... I am a few of the last on 10.11.6 ... El Captain.

@Anjali-Saha
Copy link

@Anjali-Saha Anjali-Saha commented Jan 6, 2021

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Jan 6, 2021

I think we can forgo a fix for this... I am a few of the last on 10.11.6 ... El Captain.

@einthusan Go 1.14 is supposed to require macOS 10.11 as the oldest version, not 10.12. (See here.) You're right that this is not very high priority by now, as it'll stop being supported when Go 1.16 is out. However, if this is reproducible for you and if you don't mind, it can still be helpful to file an issue in case it helps us understand this better and ensure it doesn't happen in the future for newer versions.

@einthusan
Copy link

@einthusan einthusan commented Jan 6, 2021

@dmitshur okay, in that case, I will.
#43546

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.