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: minimum macOS version changed going from 1.12.5 to 1.12.9 #33968

Open
bep opened this issue Aug 30, 2019 · 12 comments

Comments

@bep
Copy link
Contributor

commented Aug 30, 2019

I guess this relates to 4cd6c3b

  • Reading the error message below (was built for newer OSX version (10.10) than being linked (10.9)) vs 4cd6c3b#diff-f44dab9aab3c3c3aaff916e6bb1fb763R418 does not line up.
  • Upping the min OSX version in my build script to 10.10 removes the warning (but the build still fails, I need to investigate more on that).

Note that I did not open up this issue to fix my particular problem (I will eventually figure that out), but more of a "heads up" issue. Reading the issues surrounding 4cd6c3b I see a lot of the same guesswork that I'm doing in this area and my own guessing tells me that this change was unintentionally a little too big for a patch release.

  • building                  binary=dist/hugo_extended_darwin_darwin_amd64/hugo
   ⨯ release failed after 329.09s error=failed to build for darwin_amd64: # crypto/x509
ld: warning: object file (/tmp/go-build936638053/b091/_cgo_main.o) was built for newer OSX version (10.10) than being linked (10.9)
ld: warning: object file (/tmp/go-build936638053/b091/_x001.o) was built for newer OSX version (10.10) than being linked (10.9)
ld: warning: object file (/tmp/go-build936638053/b091/_x002.o) was built for newer OSX version (10.10) than being linked (10.9)
# github.com/wellington/go-libsass/libs
In file included from unity.cpp:4:
In file included from /go/pkg/mod/github.com/wellington/go-libsass@v0.9.3-0.20181113175235-c63644206701/libs/../libsass-build/ast.cpp:2:
In file included from /go/pkg/mod/github.com/wellington/go-libsass@v0.9.3-0.20181113175235-c63644206701/libsass-build/ast.hpp:14:
In file included from /go/pkg/mod/github.com/wellington/go-libsass@v0.9.3-0.20181113175235-c63644206701/libsass-build/ast_fwd_decl.hpp:11:
In file included from /usr/local/osx-ndk-x86/bin/../SDK/MacOSX10.11.sdk/usr/include/c++/v1/unordered_map:369:
@ianlancetaylor ianlancetaylor changed the title Hugo release build fails when going from Go 1.12.5 go 1.12.9 cmd/link: minimum macOS version changed going from 1.12.5 to 1.12.9 Aug 30, 2019
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Aug 30, 2019

In the discussion on #30448 people requested the the minimum version be increased on the 1.12 branch. Here you are suggesting that that should not have happened. I don't know what is best.

CC @eliasnaur @pieterclaerhout @networkimprov @macetw : discuss.

@bep

This comment has been minimized.

Copy link
Contributor Author

commented Aug 30, 2019

people requested the minimum version be increased on the 1.12 branch. Here you are suggesting that that should not have happened.

To be accurate, I suggest two things:

  1. You got the numbering wrong and increased it one version too far up somewhere. I know a little too little about this to state any absolute.
  2. Given that this has prevented real projects (I'm still working on it) to update to Go 1.12.9 (a security patch), in retrospect I think that commit should not have been backported. But this relates to 1).
@eliasnaur

This comment has been minimized.

Copy link
Contributor

commented Aug 30, 2019

@iant, I believe you mean issue #30488.

The fix for #30488 bumped the minimum version to 10.9, not 10.10. What is setting the 10.10 minimum?

@networkimprov

This comment has been minimized.

Copy link

commented Aug 30, 2019

That change was necessary for binaries to be acceptable in the Mac App Store, which is why it landed in a bugfix release. There is a reminder issue for future reference at #31918.

@bep can you give steps to reproduce (and fix) your problem?

@cherrymui

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2019

I'm not sure CL https://go-review.googlesource.com/c/go/+/175918 (commit 4cd6c3b) is related. It seems that CL only affects internal linking mode, i.e. using the Go linker, instead of the system linker. But the warning in this issue is from ld, the system linker, which suggests it is using external linking mode.

@pieterclaerhout

This comment has been minimized.

Copy link

commented Sep 2, 2019

Isn't this actually an issue on the CGO side? My wild guess is that CGO is linking against 10.10 while the normal Go builds are linking against 10.9 hence the error message…

@pieterclaerhout

This comment has been minimized.

Copy link

commented Sep 2, 2019

The system linker on macOS has the following option to define this from whjat I can find:

-compatibility_version number
            Specifies the compatibility version number of the library.  When a library is loaded by dyld, the compatibility version is checked and if
            the program's version is greater that the library's version, it is an error.  The format of number is X[.Y[.Z]] where X must be a posi-
            tive non-zero number less than or equal to 65535, and .Y and .Z are optional and if present must be non-negative numbers less than or
            equal to 255.  If the compatibility version number is not specified, it has a value of 0 and no checking is done when the library is
            used.  This option is also called -dylib_compatibility_version for compatibility.
@FiloSottile FiloSottile modified the milestones: Go1.12.10, Go1.12.11 Sep 25, 2019
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Oct 8, 2019

I don't understand this issue. When linking a Go program that uses cgo, the Go linker will generate a Macho-O object file that is marked as requiring macOS release version 10.9. The error that you are reporting says that the C linker wants to generate code for macOS 10.9, but is seeing C code that was marked as requiring macOS 10.10.

But this seems to be entirely a problem with the C toolchain: the compiler says it needs 10.10, the linker says that it expects 10.9. I don't understand what Go has to do with it. I particularly don't understand what https://golang.org/cl/175918 has to do with it; that CL changes the minimum requirement from 10.7 to 10.9. The problem you are seeing is that the C toolchain is requiring 10.10, so both 10.7 and 10.9 should be fine.

How sure are you that https://golang.org/cl/175918 is the problem?

Is there a way that we can reproduce the problem ourselves?

Thanks.

@dmitshur

This comment has been minimized.

Copy link
Member

commented Oct 8, 2019

I'll move this issue to WaitingForInfo state, because we can't proceed with investigating it without more information. I'll also remove release-blocker, as it doesn't need to block the release of Go 1.12.11 in the current state.

@macetw

This comment has been minimized.

Copy link

commented Oct 8, 2019

@networkimprov

This comment has been minimized.

Copy link

commented Oct 8, 2019

@macetw the issue is waiting for info from @bep. Are you writing on his behalf?

We established that this issue is probably unrelated to #30488, which you filed, and is fixed.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Oct 9, 2019

@macetw Thanks. The error reported in the original bug report here was pretty clearly from a cgo build. Are you sure you are seeing the same problem? Do you have instructions for how to recreate it?

@katiehockman katiehockman modified the milestones: Go1.12.11, Go1.12.12 Oct 17, 2019
@toothrot toothrot modified the milestones: Go1.12.12, Go1.12.13 Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.