[swift-dev] problems with linking .tbd frameworks in test suite

Daniel Dunbar daniel_dunbar at apple.com
Wed Dec 9 23:25:57 CST 2015

What version of ld are you using? (ld -v)

If you have .tbd files in your SDK, then the ld that shipped with that version of Xcode should be capable of using them to link. The tools should be using that version of ld by default, but it is possible something is going wrong.

If might help to run the command that is failing with "-v", and include the full command and its errors.

 - Daniel

> On Dec 9, 2015, at 9:10 PM, Alex Lew via swift-dev <swift-dev at swift.org> wrote:
> Hi all,
> Apologies if this is not the right place to ask this.
> I built Swift successfully today, but was failing lots of tests because the linker couldn't find CoreFoundation (or other frameworks, including libsystem and libobjc). It looks like  ld was invoked with the arguments:
>  -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
> The MacOSX10.11.sdk/usr/lib directory did have the desired libraries/frameworks in it, but they had the extension .tbd, not .dylib, and I think that confused the linker. I commented out the following lines from swift/lib/Driver/ToolChains.cpp:
>   if (!context.OI.SDKPath.empty()) {
>     Arguments.push_back("-syslibroot");
>     Arguments.push_back(context.Args.MakeArgString(context.OI.SDKPath));
>   }
> (lines 915-918), reran util/build-script -t, and everything started working (presumably because the linker was now searching in /usr/lib, where the dylib files are).
> I'm curious to understand what was going on here. Should I have been using a different version of ld? Configured something else differently? I'm in a little over my head.
> Thank you!
> -Alex
>  _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20151209/6ee9742c/attachment.html>

More information about the swift-dev mailing list