1

For a few days now whenever gcc or go are invoked the following warning is thrown by the system (macOS High Sierra 10.13.5):

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 the feeling that the installation of some go packages via go get may have changed some files in the above directory but I have no means to verify this.

Is there a way to properly determine the cause of the message?

5
  • 1
    What about this solution: apple developer forum? That worked for me. Commented Jul 14, 2018 at 21:14
  • 2
    This helps for gcc but for go the issue persists. Actually, it gets worse by the day. Now if I run a simple go program dozens of the above warning are thrown. Commented Jul 24, 2018 at 7:33
  • @DanielSchuette Hi, i'm facing the same issue. And the Apple Developer Link you provided doesn't exist anymore. Would you please let me know what was the solution ? Thanks Commented Oct 31, 2018 at 9:41
  • @raisa_ The link still works for me https://forums.developer.apple.com/thread/97850. Let me know if that solved your problem. There are several other things you might want to try (e.g. a fresh installation of go and upgrading to MacOS 10.14). Commented Oct 31, 2018 at 17:41
  • @DanielSchuette Hi, thanks for replying. The link works but unfortunately the solution doesn't work on me. When I try to install Xcode, I get the warning "Can't install the software because it is not currently available form the Software Update Server". So I'm still having the same ld error. I'm already on Mojave, and have installed the latest Xcode command for terminal (in Beta). Currently I'm having so many terminal issues after upgrade to Mojave, I posted my question here stackoverflow.com/questions/53079732/… Commented Nov 1, 2018 at 6:14

1 Answer 1

1

I had been seeing those warnings spewing from my make process for a few weeks. I recently made a Xcode project to build using make (via an External Build System project) and noticed those warnings weren't present when make was being run from Xcode. The only difference is that Xcode exports a series of build setting environment variables prior to running make.

After some experimentation it turned out to be the SDKROOT variable which, in hindsight, makes perfect sense. I added this variable to my makefile and the warnings disappeared:

export SDKROOT = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk 

Note: That path can change with different versions of Xcode. It may be wise to reference the current SDK version instead:

export SDKROOT = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk 

Of course, assumes you have Xcode installed.

Sign up to request clarification or add additional context in comments.

2 Comments

LPT: Drop this in your .bashrc export SDKROOT="$(xcrun --show-sdk-path)". It will automatically set the correct path.
This worked well for me. As suggested by HeroCC, I added it to my .bashrc. Thanks for the answer!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.