<div dir="ltr"><div style="font-size:13px">Gahh... yep, turns out I was using an old MacPorts version of ld. I thought I'd cleared out gcc, ld, etc. from /opt/local/bin a while ago, but I guess not. Should have been my first thought. Thanks! And sorry for bothering! <br></div><div style="font-size:13px"><br></div><div style="font-size:13px">-Alex</div><div class="" style="font-size:13px"></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 12:25 AM, Daniel Dunbar <span dir="ltr"><<a href="mailto:daniel_dunbar@apple.com" target="_blank">daniel_dunbar@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What version of ld are you using? (ld -v)
<div>
<br>
</div>
<div>
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.
</div>
<div>
<br>
</div>
<div>
If might help to run the command that is failing with "-v", and include the full command and its errors.
</div>
<div>
<br>
</div>
<div>
- Daniel
</div>
<div>
<br>
<div>
<div>
<blockquote type="cite"><div><div class="h5">
<div>
On Dec 9, 2015, at 9:10 PM, Alex Lew via swift-dev <
<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>> wrote:
</div>
<br>
</div></div><div><div><div class="h5">
<div dir="ltr">
Hi all,
<div>
<br>
</div>
<div>
Apologies if this is not the right place to ask this.
</div>
<div>
<br>
</div>
<div>
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:
</div>
<div>
<br>
</div>
<div>
-syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
</div>
<div>
<br>
</div>
<div>
The MacOSX10.11.sdk/usr/lib directory
<i>did</i> 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:
</div>
<div>
<br>
</div>
<div>
<div>
<br>
</div>
<div>
if (!context.OI.SDKPath.empty()) {
</div>
<div>
Arguments.push_back("-syslibroot");
</div>
<div>
Arguments.push_back(context.Args.MakeArgString(context.OI.SDKPath));
</div>
<div>
}
</div>
</div>
<div>
<br>
</div>
<div>
(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).
</div>
<div>
<br>
</div>
<div>
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.
</div>
<div>
<br>
</div>
<div>
Thank you!
</div>
<div>
<br>
</div>
<div>
-Alex
</div>
</div></div></div> _______________________________________________
<br>swift-dev mailing list
<br>
<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>
<br><a href="https://lists.swift.org/mailman/listinfo/swift-dev" target="_blank">https://lists.swift.org/mailman/listinfo/swift-dev</a>
<br>
</div>
</blockquote>
</div>
</div></div><div style="margin-top:10px;font-size:12px;font-family:Helvetica,Arial;color:#999"><br></div></blockquote></div><br></div></div>