Framework libs out of sync

This has been going on at least since Xcode 8 when apple replaced links to dylib with the text tbd files.


On travis, build image: xcode 9.2, osx 10.12, compiler: clang; when building any code that uses a framework and you are not using Xcode but from the command line witih makefile or ninja or whatever, there are always these


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


This is Xcode's linker, ld.


There are no other external compilers installed, this is a fresh travis build with no ccache. This is only a sample build which uses this framework but if i called other frameworks Accelerate, ************, OpenCL, OpenGL, they will all throw these warnings.


If you attempt to build with macports clang 4,5,6, the build build will bomb even with the latest ld installed.

Accepted Reply

You have to link directly to the library and not rely on -isysroot or -frameworks in your makefile. you need to link like -L /path/to/lib libstuff.dylib

Replies

I just started seeing similar errors, when building with Go.


# 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.

is someone find how to fix this issue?

Also seeing this when building with go.

Also seeing this warning when building with go.

You have to link directly to the library and not rely on -isysroot or -frameworks in your makefile. you need to link like -L /path/to/lib libstuff.dylib

This is due to an out-of-sync Xcode/command-line tools issue. Reinstalling the command-line tools seems to fix the issue 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

Andybons has the more accurate answer.

As of the update to XCode 10, this problem has resurfaced, and no amount of reinstalling will fix it.


Also, linking directly to the dylib is not an option with for example Cocoa.

It doesn't work anymore since MacOS 10.13.6.

Same on 10.14.

Even if it does not fail the build, the amount of noise it creates is pretty anoying 😟.

Just curious, has anyone reported this to Apple through bug reporter?

Does Apple ignore the bug?

It is really bad, the issue has existed for more than one year, but Apple havn't fixed the bug.


Really bad.

Really bad.

Really bad.

Really bad.

Really bad.

Really bad.

Really bad.

Really bad.

The message states that the CoreFoundation frameword is out of sync with the tbd file. Judging from the dates on these two files, the tbd file is much the older.


I deleted the tbd file (change the name to oldCoreFoundation.tbd) in both CoreFoundation and IOKit which I was using.


Problem gone. It seems that the tbd file is no longer needed at all.


John