ld warning: text-based stub file and library file out of sync after updating Command Line Tools

Originator:andybons
Number:rdar://45171575 Date Originated:10/08/2018
Status:New Resolved:
Product:CommandLineTools Product Version:10.0.0.0.1.1535735448
Classification:Bug Reproducible:Always
 
Summary:
When linking code against any framework, ld presents a warning that the tbd and library files for the framework are out of sync. This only seems to occur when command-line tools are installed (it does not reproduce when ONLY Xcode is installed).

Go users have found that downgrading the CLTs fixes this warning: https://github.com/golang/go/issues/26073#issuecomment-422823621

More instances are in the linked bug above.

Vim users have also run into this issue: https://github.com/vim/vim/issues/3445

Steps to Reproduce:
$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version
version: 10.0.0.0.1.1535735448
$ 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.
$ 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

Expected Results:
No warnings from ld

Actual Results:
Warnings from ld

Version/Build:
OS: macOS High Sierra, version 10.13.6 (17G65) and macOS Mojave, version 10.14 (18A391)
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)
Clang: Apple LLVM version 10.0.0 (clang-1000.10.44.2)

Configuration:
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!