<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 30, 2015, at 17:49, Luke Howard via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 31 Dec 2015, at 12:33 PM, Joe Groff &lt;<a href="mailto:jgroff@apple.com" class="">jgroff@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 30, 2015, at 1:24 AM, Luke Howard via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Per [SR-404], anything that consumed libFoundation could not dynamically cast to a Foundation protocol because the build script was missing the magic swift.ld linker script to advertise the start of the protocol conformances table. </div></div></div></blockquote><div class=""><br class=""></div><div class="">Is it possible that the library is getting linked by clang instead of swiftc? I would expect the swiftc driver to pass the linker script down to ld (but maybe it's not).</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">You’re right, clang is being called to link. Changing to swiftc will be a bit more intrusive to the Foundation build scripts (at given my mediocre knowledge of Python) but is probably the right answer.</div></div></div></div></blockquote><br class=""></div><div>I have a longstanding desire to do this, but then we have the opposite problem: clang++ knows what extra libraries need to be added in order to link C++ code correctly, and swiftc knows what flags to use to link Swift code correctly. Of course, the libraries with Swift source have little-to-no C++ in them, so maybe it's okay.</div><div><br class=""></div><div>Jordan</div><br class=""></body></html>