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

Closed
einthusan opened this issue Jan 6, 2021 · 7 comments
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin
Milestone

Comments

@einthusan
Copy link

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 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 the Builders x/build issues (builders, bots, dashboards) label Jan 6, 2021
@gopherbot gopherbot added this to the Unreleased milestone Jan 6, 2021
@dmitshur dmitshur added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin Builders x/build issues (builders, bots, dashboards) and removed Builders x/build issues (builders, bots, dashboards) labels Jan 6, 2021
@einthusan
Copy link
Author

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

@Neal
Copy link

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

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

dmitshur commented Dec 6, 2021

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.

@dmitshur dmitshur closed this as completed Dec 6, 2021
@soul-key
Copy link

soul-key commented Dec 7, 2021

➜ ~ 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
Copy link

lxytSL commented Dec 9, 2021

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

@golang golang locked and limited conversation to collaborators Dec 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin
Projects
None yet
Development

No branches or pull requests

6 participants