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

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

Open
einthusan opened this issue Jan 6, 2021 · 4 comments

Comments

@einthusan
Copy link

@einthusan einthusan commented Jan 6, 2021

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.
#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
Copy link
Contributor

@dmitshur dmitshur commented Jan 6, 2021

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

As I said in #36025 (comment), 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.

@dmitshur dmitshur changed the title ld: warning: object file was built for newer OSX version (10.12) than being linked (10.11) 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)" Jan 6, 2021
@gopherbot gopherbot added this to the Unreleased milestone Jan 6, 2021
@einthusan
Copy link
Author

@einthusan einthusan commented Jan 7, 2021

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

@Neal
Copy link

@Neal Neal commented Jan 11, 2021

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
Copy link
Contributor

@dmitshur dmitshur commented Jan 21, 2021

@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.

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
4 participants