Go: crypto/x509: macOS -framework Security produces link warning

Created on 27 Jun 2018  ·  56Comments  ·  Source: golang/go

See https://forums.developer.apple.com/thread/97850 for a bunch of people hitting a new link error in Xcode due to crypto/x509's use of the (apparently now deprecated?) -framework linker flag.

We could just take Merchant.Of.Satire's word for it, but it would be nice to have confirmation that we're not supposed to use -framework anymore, as opposed to some Xcode just being buggy/misconfigured/something else.

/cc @robpike who just hit this too.

NeedsInvestigation OS-Darwin release-blocker

Most helpful comment

Upgrading to macOS Mojave, which came out today, seems to fix the issue for me. I can no longer reproduce it on the following configuration:

OS: macOS Mojave, version 10.14 (18A391)
Go versions: current tip at 2018-09-25 01:17 (0ee8a559e5778b4dbfa20c524867112693ba607f), tip at 2018-09-18 21:34 (d24ec86e4f64302e91d8062eabfcd21296bb9b04)
Xcode: version 10.0 (10A255) (installed, but haven't done the "install additional required components" yet; version via xcodebuild -version)
Xcode CLI tools: seemingly no longer installed, getting No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'., although git and others are available in CLI (via pkgutil --pkg-info=com.apple.pkg.CLTools_Executables)

However, it's not conclusive if the issue is completely resolved, because it seems upgrading to Mojave caused the Xcode CLI tools to no longer be installed by default, and running Xcode 10 asks to "install additional required components" again. I haven't done those steps yet.

Unlocking for now, but please keep https://golang.org/wiki/NoPlusOne in mind. Posting new comments is okay if there's new helpful information that hasn't been covered before; otherwise please use 👍 reactions.

Specifically, it'd be helpful to know if anyone can still reproduce this on macOS Mojave. If so, please include your exact configuration (macOS version/build number, Go version, Xcode version, Xcode CLI version, whether or not you've run Xcode and done the "install additional required components" step).

All 56 comments

This is what the full build looks like:

% ./make.bash
Building Go cmd/dist using /usr/local/go.
Building Go toolchain1 using /usr/local/go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for darwin/amd64.
# crypto/x509
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.
---
Installed Go for darwin/amd64 in /Users/r/go
Installed commands in /Users/r/go/bin
% 

The offending invocation is in src/crypto/x509/root_cgo_darwin.go:

/*
#cgo CFLAGS: -mmacosx-version-min=10.10 -D__MAC_OS_X_VERSION_MAX_ALLOWED=101300
#cgo LDFLAGS: -framework CoreFoundation -framework Security

...

FYI: I get this also with Go 1.10.3 and the macOS 10.13.6 (17G65).

% go version
go version go1.10.3 darwin/amd64
% go build
# github.com/autograde/aguis
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.
% uname -a
Darwin blast.local 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64

The -framework linker flag isn’t deprecated from what I can tell.

This is due to an out-of-sync Xcode/command line tools installation. You can try updating Xcode (if you’re running an outdated version) and then launch it to install the latest command-line tools.

If you already have the latest Xcode (or the above doesn’t solve your issue), you can re-install the command-line tools forcibly per http://sd.jtimothyking.com/2018/07/26/stub-file-and-library-file-out-of-sync/:

$ sudo mv /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools.old
$ xcode-select --install
$ sudo rm -rf /Library/Developer/CommandLineTools.old

If this doesn’t work please re-open this bug and I’ll do more investigating.

Verified that those instructions resolved it for me.

This morning, I just upgraded the XCode and Command Line Tools (see the attached screen shot: sorry for Japanese), and then this problem appears again when I run all.bash for the tip version to rebuild everything.

2018-09-18 8 35 08

# crypto/x509
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.

While attempting to build my project (which relies on sqlite3) from macOS High Sierra (10.13.6), for use in a Linux Docker container, I set the environment variable CGO_ENABLED=0 and built the project. It turns out that this was not what I needed to do. Now (even after updating XCode & reinstalling XCode Command Line Tools) I get the warnings mentioned above.

__Output from go build -v:__

...

# crypto/x509
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.

...

# github.com/cneill/project
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.

update the Command Line Tools Just now, and similar issue

# command-line-arguments
ld: warning: text-based stub file /System/Library/Frameworks//Foundation.framework/Foundation.tbd and library file /System/Library/Frameworks//Foundation.framework/Foundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//IOKit.framework/IOKit.tbd and library file /System/Library/Frameworks//IOKit.framework/IOKit are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//DiskArbitration.framework/Versions/A/DiskArbitration.tbd and library file /System/Library/Frameworks//DiskArbitration.framework/Versions/A/DiskArbitration are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CFNetwork.framework/Versions/A/CFNetwork.tbd and library file /System/Library/Frameworks//CFNetwork.framework/Versions/A/CFNetwork are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreServices.framework/Versions/A/CoreServices.tbd and library file /System/Library/Frameworks//CoreServices.framework/Versions/A/CoreServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ServiceManagement.framework/Versions/A/ServiceManagement.tbd and library file /System/Library/Frameworks//ServiceManagement.framework/Versions/A/ServiceManagement are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory.tbd and library file /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS.tbd and library file /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS are out of sync. Falling back to library file for linking.
/private/var/folders/x4/qr3r88l91y960q88lyh7vlg80000gn/T/___go_build_main_go #gosetup

macOS 10.13.6 (17G65)
go version go1.10.4 darwin/amd64
After upgrade command line tools to 10.0, and upgrade xcode to 10.0:

go build a program (with CGO), got errors:

_ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking._

===

Tried fix with xcode-select --install, but the command line tools was installed as version 9.4.
Go build still those errors. Restart machine does not work.

10.13.6(17G65)
go version go1.11 darwin/amd64

I have the same error

# crypto/x509
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.

Re-opening as per @andybons' comment

If this doesn’t work please re-open this bug and I’ll do more investigating.

Can new reporters please confirm that reinstalling the command-line tools via

$ sudo mv /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools.old
$ xcode-select --install
$ sudo rm -rf /Library/Developer/CommandLineTools.old

Does NOT solve your issue?

One notable thing I do _not_ see in my App Store update list is the command-line tools as a separate item. I updated to Xcode 10.0, launched Xcode, then said yes when it asked to install additional components.

It might be OS dependent. My Mojave laptop acted exactly as you described above (Xcode 10, nothing specific about command line tools) and Go works fine there. My High Sierra desktop offers Xcode and a new Command Line Tools. (I've not accepted that upgrade there.)

OS: macOS 10.13.6 (17G65) (High Sierra)
XCode version 10.0 (10A255)
go version go1.11 darwin/amd64

Solution with delete and reinstall CommandLineTools don't work!!!

I has disabled the warnings with environment variables:

export CGO_LDFLAGS="-g -O2 -w"
export WARNING_LDFLAGS=-w
export OTHER_LDFLAGS=-w

But this is not a solution, it's just postponing the problem "for later"!

After Updating I experienced same problem
GO: go1.10.4 darwin/amd64
CLT: 10.0
XCODE: 10.0

ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are outof sync. Falling back to library file for linking.

OS: 10.13.6
golang version go1.9.2 darwin/amd64
XCode NOT currently installed, only the command-line tools

I'm seeing the same error; reinstalling command line tools had no effect.

As another data point, I am not seeing any ld warnings on the following configuration:

OS: macOS High Sierra, version 10.13.6 (17G65)
Go version: current tip at 2018-09-18 21:34 (d24ec86e4f64302e91d8062eabfcd21296bb9b04)
Xcode: not installed
Xcode CLI tools: version 9.4.1.0.1.1528165917 (via pkgutil --pkg-info=com.apple.pkg.CLTools_Executables)

I have another MacBook with Xcode 10 an latest CLI at home, will try on it later and edit in the result.

Edit: Second data point, I am seeing ld warnings on the following configuration:

OS: macOS High Sierra, version 10.13.6 (17G65)
Go version: current tip at 2018-09-18 21:34 (d24ec86e4f64302e91d8062eabfcd21296bb9b04)
Xcode: version 10.0 (10A255) (installed, but haven't done the "install additional required components" yet)
Xcode CLI tools: version 10.0.0.0.1.1535735448 (via pkgutil --pkg-info=com.apple.pkg.CLTools_Executables)

They are:

# crypto/x509
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.

I have then tried to run Xcode 10.0 and do the "install additional required components" step, the ld warnings persistent.

Then I tried sudo mv /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools.old; xcode-select --install. It installed an older version of CLI tools 9.4.0.0.1.1526532315. The ld warnings persisted.

Then I got an update for CLI tools in App Store, installed it, and they were back to 10.0.0.0.1.1535735448. The ld warnings still persisted.

So, I can confirm this is a real issue, and it's reproducible with Xcode 10 and CLI tools installed.

Edit 2: macOS Mojave is due to be released on Monday. Updating to it _may_ have an effect (i.e., in turn making this a High Siera-only issue).

@andybons confirmed: errors started after System Update updated CommandLineTools this morning and that fix doesn't fix.

same problem after mac system updated

so, sad......T_____________T

crypto/x509

ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.

image
me too

Same issue
go version go1.9.5 darwin/amd64
Mac OS 10.13.6 (17G65)

Also the fix doesn't work .

ld: warning: text-based stub file 
/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.

same issue for me with go 1.11

go version go1.11 darwin/amd64
Mac OS 10.13.6 17G65

I've downgraded the version of Command Line Tools (macOS 10.13). This worked for me:

  1. sudo rm -rf /Library/Developer/CommandLineTools
  2. Install June 12th version, from here: https://developer.apple.com/download/more/

OS: macOS 10.13.6 (High Sierra)
XCode version 10.0
go version go1.11 darwin/amd64

Solution with delete and reinstall CommandLineTools don't work!!!

Any new findings??

@Quesomora I tried your solution but didn't work for me. I even tried the version from may but still getting the same warnings.

This started happening for me today. One thing that I haven't seen mentioned by anyone, might be unrelated: I had a prompt a few times when I plugged my iPhone asking to update tools (didn't say what exactly was updated). I'm assuming it's related to the release of iOS 12. I said "not now" a couple of times, but after accepting the linking error appeared.

@andybons @agnivade is there any specific debugging information you'd like us to get to help troubleshooting?

Solution from @Quesomora is the only thing that worked for me.

I also tried @Quesomora's solution to no avail, however, I have colleagues that had not upgraded yet and have the version from June 12th, version: 9.4.1.0.1.1528165917, and it works for them.

I opened a support ticket at Apple to fix this for future updates yesterday... not sure if/when they will fix it.. it is annoying to having to uninstall then reinstall the CLI tools every time there's a Mac dev tools update just to remove these warnings.

Ultimately, to get rid of those nasty ld warnings I had to apply @Quesomora workaround:
https://github.com/golang/go/issues/26073#issuecomment-422823621

This has indeed returned:

# crypto/x509
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.

MacOS 10.13.6 after updating command-line tools. Re-install does not fix.

Locking due to the number of “me too” comments. https://golang.org/wiki/NoPlusOne

Thanks everyone. We’re aware this is an issue and are actively investigating.

The warnings are benign. They should not affect your day-to-day development work.

Developers of vim are also experiencing the same issue. Cross-linking for posterity.

https://github.com/vim/vim/issues/3445

Upgrading to macOS Mojave, which came out today, seems to fix the issue for me. I can no longer reproduce it on the following configuration:

OS: macOS Mojave, version 10.14 (18A391)
Go versions: current tip at 2018-09-25 01:17 (0ee8a559e5778b4dbfa20c524867112693ba607f), tip at 2018-09-18 21:34 (d24ec86e4f64302e91d8062eabfcd21296bb9b04)
Xcode: version 10.0 (10A255) (installed, but haven't done the "install additional required components" yet; version via xcodebuild -version)
Xcode CLI tools: seemingly no longer installed, getting No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'., although git and others are available in CLI (via pkgutil --pkg-info=com.apple.pkg.CLTools_Executables)

However, it's not conclusive if the issue is completely resolved, because it seems upgrading to Mojave caused the Xcode CLI tools to no longer be installed by default, and running Xcode 10 asks to "install additional required components" again. I haven't done those steps yet.

Unlocking for now, but please keep https://golang.org/wiki/NoPlusOne in mind. Posting new comments is okay if there's new helpful information that hasn't been covered before; otherwise please use 👍 reactions.

Specifically, it'd be helpful to know if anyone can still reproduce this on macOS Mojave. If so, please include your exact configuration (macOS version/build number, Go version, Xcode version, Xcode CLI version, whether or not you've run Xcode and done the "install additional required components" step).

I've just upgraded to macos Mojave and the issue remains.

OS: macOS Mojave, version 10.14
Go: go1.11 darwin/amd64

I don't have Xcode installed, only Xcode CLI tools. I've tried to reinstall Xcode CLI tools with no success.

@zdebra Thanks. What version of Xcode CLI tools? You should be able to find out by running pkgutil --pkg-info=com.apple.pkg.CLTools_Executables or so.

@dmitshur

package-id: com.apple.pkg.CLTools_Executables
version: 10.0.0.0.1.1535735448
volume: /
location: /
install-time: 1537947903
groups: com.apple.FindSystemFiles.pkg-group

I've also tried installing an older version of xcode, tried moving, installing, and removing xcode per commands above, and reinstalled it. I get the warnings still. I'm on mac OS High Sierra, 10.13.6.

@Quesomora's solution works for me (thanks! the linker errors break godog, so this is a great help)

OSX 10.13.6
go version go1.10.4 darwin/amd64 (but the problem occurs for go 1.11 as well).

xcode command line utils before applying Quesomora's suggestion, problem exists:

$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 10.0.0.0.1.1535735448

xcode command line tools after applying the suggestion, problem gone:

$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 9.4.1.0.1.1528165917

Unfortunately I guess this is going to mean turning off auto-update on packages, until Apple fix this.

Confirmed @Quesomora's solution, exactly same environment and before/after as @geomacy with the excepton of go version go1.11 darwin/amd64.

@Quesomora solution was not working for me until I downgraded go 1.11 to go 1.9.2 (i did not try 1.10)
Currently running with:

go version 
go1.9.2 darwin/amd64
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 9.4.0.0.1.1526532315
volume: /
location: /
install-time: 1538486245
groups: com.apple.FindSystemFiles.pkg-group
macOS 10.13.6

I am working in a cgo project, using goconvey regularly during development, and goconvey interprets the ld errors as build failure indications.

macOS 10.13.6
go version
go version go1.11 darwin/amd64



md5-2fac17937f0706062aa0072644b2b2ad



pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 10.0.0.0.1.1535735448
volume: /
location: /
install-time: 1538487003
groups: com.apple.FindSystemFiles.pkg-group 

@requaos you have version: 10.0.0.0.1.1535735448 which if you search the comments above all point to it being a/the problematic version. Have you tried @Quesomora solution getting you to version: 9.4.1.0.1.1528165917? That seems to solve it for everyone that reported that version, including me.

hi @Baha-sk, regarding

I opened a support ticket at Apple to fix this for future updates yesterday... not sure if/when they will fix it.. it is annoying to having to uninstall then reinstall the CLI tools every time there's a Mac dev tools update just to remove these warnings.

could you post a link to the ticket here so we could keep an eye on whether there appears to be any action on fixing this?

followed @Quesomora 's fix but still getting the warning.

$  pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 9.4.1.0.1.1528165917
volume: /
location: /
install-time: 1538424576
groups: com.apple.FindSystemFiles.pkg-group

$ go version
go version go1.11 darwin/amd64

macOS 10.13.6

9.4.1 seems to be applied, too.. Hmm.

This issue is no longer detected on my machine after updating to macOS 10.14 Mojave

❯ xcodebuild -version
Xcode 10.0
Build version 10A255

❯ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14
BuildVersion:   18A391

❯ go version
go version go1.9.7 darwin/amd64

@gabolaev I don't think that the issue reproduces with go 1.9 under any hardware configuration - it's Go 1.10 and above.

Deleting the Xcode, the Xcode command line tools, and then reinstalling macOS 10.14 from macOS Recovery fixed the link warning problem for me. A bit drastic - but does this fix it for anyone else? Reinstalled the latest Xcode and Xcode command line tools after the OS reinstall.

Note: I had also reinstalled go version go1.11.1 darwin/amd64 after trying go1.9 and go.10. Also used go clean -cache.

Historical Note: the link warning issue started happening for my go projects after updating to macOS 10.14. Various combinations of reinstalling Xcode command line tools and Xcode did not fix the issue.
At one point the link warnings were happening even when using clang command line to compile a c-test program that used frameworks (no go involved).

@requaos you have version: 10.0.0.0.1.1535735448 which if you search the comments above all point to it being a/the problematic version. Have you tried @Quesomora solution getting you to version: 9.4.1.0.1.1528165917? That seems to solve it for everyone that reported that version, including me.

Nope, I don't think that is the issue because I have the exact same problem and this is my version:

$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 8.2.0.0.1.1480973914
volume: /
location: /
install-time: 1539050324
groups: com.apple.FindSystemFiles.pkg-group 

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.6
BuildVersion:   17G65

$ xcodebuild -version
Xcode 10.0
Build version 10A255

$ go version
go version go1.9.1 darwin/amd64

TBH this nothing to do with go either...

@kevinburke, i had that issue on the same go version (1.9.7) on High Sierra. it's gone just after system update.

After upgrade to Mojave and update of command line tools, linker warning is
gone for me.

On Tue, Oct 9, 2018, 6:23 AM George Gabolaev notifications@github.com
wrote:

@kevinburke https://github.com/kevinburke, i had that issue on the same
go version (1.9.7) on High Sierra. it's gone just after system update.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/golang/go/issues/26073#issuecomment-428139803, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ANlVUswx5ppkMNea_2eFu-XCPenKfYG0ks5ujHk9gaJpZM4U5BGw
.

Thanks everyone. We've filed a Radar (bug) with Apple and are awaiting their response.

This is not a Go-specific issue and is not dependent on the version of Go installed. We've provided the following reproduction steps to Apple:

Steps to Reproduce:
$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version
version: 10.0.0.0.1.1535735448
$ clang --version
Apple LLVM version 10.0.0 (clang-1000.10.44.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
$ cat > issue.c 
int main() { return 0; }
^D
$ clang issue.c -framework CoreFoundation
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.

Locking for now while we wait for Apple's response. Thanks again, everyone.

Change https://golang.org/cl/144112 mentions this issue: cmd/go, cmd/link: silence bogus Apple Xcode warning

I sent a CL to filter out the warning in our tools. There's no point in continuing to have people hit what looks like a real problem when we know it's a harmless bug on Apple's end. We should probably have done this months ago, and probably the CL should be backported to Go 1.11.

Change https://golang.org/cl/145458 mentions this issue: [release-branch.go1.11] cmd/go, cmd/link: silence bogus Apple Xcode warning

Change https://golang.org/cl/227037 mentions this issue: crypto/x509: use Security.framework without cgo for roots on macOS

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bbodenmiller picture bbodenmiller  ·  3Comments

natefinch picture natefinch  ·  3Comments

enoodle picture enoodle  ·  3Comments

longzhizhi picture longzhizhi  ·  3Comments

OneOfOne picture OneOfOne  ·  3Comments