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?

qantik
  • 1,067
  • 1
  • 10
  • 20
  • 1
    What about this solution: [apple developer forum](https://forums.developer.apple.com/thread/97850)? That worked for me. – Daniel Schütte Jul 14 '18 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. – qantik Jul 24 '18 at 07: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 – raisa_ Oct 31 '18 at 09:41
  • @raisa_ The link still works for me [https://forums.developer.apple.com/thread/97850](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). – Daniel Schütte Oct 31 '18 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 https://stackoverflow.com/questions/53079732/opengl-black-screen-and-gamma-correction-after-update-to-macos-mojave-10-14 – raisa_ Nov 01 '18 at 06:14

1 Answers1

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.

pauln
  • 598
  • 6
  • 19
  • 2
    LPT: Drop this in your .bashrc `export SDKROOT="$(xcrun --show-sdk-path)"`. It will automatically set the correct path. – HeroCC Aug 14 '19 at 14:04
  • This worked well for me. As suggested by HeroCC, I added it to my .bashrc. Thanks for the answer! – Gui Lima Aug 15 '19 at 20:57