golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124.35k stars 17.71k forks source link

x/build/cmd/release: Go 1.14 on macOS 10.11 emits "ld: warning: object file was built for newer OSX version (10.12) than being linked (10.11)" #43546

Closed einthusan closed 2 years ago

einthusan commented 3 years ago

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

$ go version
go version go1.14.12 darwin/amd64

Does this issue reproduce with the latest release?

This is the latest support for my OS MacOSX 10.11.6 El Captain

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/usr/local/gopath/bin"
GOCACHE="/Users/einthusan/Library/Caches/go-build"
GOENV="/Users/einthusan/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY="github.com/paper"
GONOSUMDB="github.com/paper"
GOOS="darwin"
GOPATH="/usr/local/gopath"
GOPRIVATE="github.com/paper"
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=""
CGO_CFLAGS=""
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/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-build172560090=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go get Ebiten (2D Game Engine for Go) and run any of the examples.

go get github.com/hajimehoshi/ebiten
cd /usr/local/gopath/src/github.com/hajimehoshi/ebiten/examples/animation
go run main.go 

Additionally: I also tried my luck a second time with the flag CGO_CFLAGS="-mmacosx-version-min=10.11" but that didn't help either.

What did you expect to see?

Game run as intended without any warning messages on terminal.

What did you see instead?

Game did run as intended. But .... got the following messages on terminal.

# github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/metal/ca
warning: unknown warning option '-Wno-unguarded-availability-new'; did you mean '-Wno-partial-availability'? [-Wunknown-warning-option]
# github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/metal/ca
warning: unknown warning option '-Wno-unguarded-availability-new'; did you mean '-Wno-partial-availability'? [-Wunknown-warning-option]
# github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/metal/ca
warning: unknown warning option '-Wno-unguarded-availability-new'; did you mean '-Wno-partial-availability'? [-Wunknown-warning-option]
ca.m:66:11: warning: instance method '-setMaximumDrawableCount:' not found (return type defaults to 'id') [-Wobjc-method-access]
/System/Library/Frameworks/QuartzCore.framework/Headers/CAMetalLayer.h:44:12: note: receiver is instance of class declared here
ca.m:85:35: warning: instance method '-setDisplaySyncEnabled:' not found (return type defaults to 'id') [-Wobjc-method-access]
/System/Library/Frameworks/QuartzCore.framework/Headers/CAMetalLayer.h:44:12: note: receiver is instance of class declared here
# github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/metal/ca
warning: unknown warning option '-Wno-unguarded-availability-new'; did you mean '-Wno-partial-availability'? [-Wunknown-warning-option]
# command-line-arguments
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-073558009/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-073558009/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-073558009/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-073558009/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-073558009/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-073558009/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-073558009/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-073558009/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-073558009/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-073558009/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-073558009/000042.o) was built for newer OSX version (10.12) than being linked (10.11)

FYI: I had also mentioned this initially in this issue. I was asked to open a new issue. https://github.com/golang/go/issues/36025

Edit: I managed to prevent these warnings from showing when I used a build flag to bypass "Metal" on OSX and use OpenGL. e.g. go build -tags=ebitengl main.go

dmitshur commented 3 years ago

Thanks for reporting. To confirm, are those warnings reproducible for you, meaning they are emitted for each separate build operation?

As I said in https://github.com/golang/go/issues/36025#issuecomment-755412523, Go 1.14 should support macOS 10.11, so this is unexpected, and understanding why this happens can help us ensure it doesn't happen in future versions too.

CC @golang/release.

einthusan commented 3 years ago

@dmitshur its definitely reproducible for every single build operation. As dependable as the sun! 😄

Neal commented 3 years ago

I am experiencing the same issue as well and is reproducible for each build. Although I'm on 1.15.6:

$ go version
go version go1.15.6 darwin/amd64

$ sw_vers
ProductName:    macOS
ProductVersion: 11.1
BuildVersion:   20C69
dmitshur commented 3 years ago

@Neal The original issue was about Go 1.14 on macOS 10.11.6 El Captain. It looks like what you're running into may be similar or the same issue, but it's hard to be sure without more information. Can you please file a new issue and provide more information for how to reproduce it and include your go env input? I tried to reproduce it on macOS 11.1 (although with Go 1.16 beta) and 10.15, and couldn't reproduce it so far (CC @cagedmantis FYI, in case maybe you're able to reproduce it).

If it turns out it's the same issue, we can join them, but for now let's keep this issue focused on the original report. Thanks.

dmitshur commented 2 years ago

We haven't been able to find a way to reproduce this, and by now, Go 1.14 is unsupported, so I'll close this issue. If this problem occurs on supported releases of Go (1.17 and 1.16 at this time), please file a new bug report and provide detail. Thanks.

For asking questions, see https://go.dev/wiki/Questions.

soul-key commented 2 years ago

➜ ~ go version go version go1.17.3 darwin/arm64 ➜ ~ sw_vers ProductName: macOS ProductVersion: 12.0.1 BuildVersion: 21A559

After using brew update , go1.17.2 - > go1.17.3 appears

ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000002.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000003.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000004.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000005.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000006.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000007.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000008.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000009.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000010.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000011.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000012.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000013.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000014.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000015.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000016.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000017.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000018.o) was built for newer macOS version (12.0) than being linked (11.3) ld: warning: object file (/var/folders/bz/24z4nnp54w79c_m7256xgkbh0000gn/T/go-link-2328520267/000019.o) was built for newer macOS version (12.0) than being linked (11.3)

lxytSL commented 2 years ago

Our problem is similar, but my go test only appears, and it appears again and again