Before this,
clang empty.cc -target x86_64-apple-ios13.1-macabi \ -framework CoreServices -fuse-ld=lld
would error out with
ld64.lld: error: path/to/MacOSX.sdk/System/Library/Frameworks/ CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/ Versions/A/CarbonCore.tbd( /System/Library/Frameworks/ CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/ Versions/A/CarbonCore) is incompatible with x86_64 (macCatalyst)
Now it works, like with ld64.
Setting this on an already-loaded dylib is needed for the %t/foo_with_bar.dylib %t/bar.dylib case in line 29 in dead-strip-dylibs.s.
For tbd files, this means if a tbd file is loaded implicitly at first and then explicitly later on, we won't emit the diag. But I think at least once https://github.com/llvm/llvm-project/issues/55042 is fixed, you can't explicitly link a tbd's implicit exports?
In practice, I think this is probably fine as-is.