<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="">I traced this down to the sourcecode after I posted here:&nbsp;<a href="https://bugs.swift.org/browse/SR-730" class="">https://bugs.swift.org/browse/SR-730</a><div class=""><br class=""></div><div class="">tll;dr the standard library is forcibly dynamically-linked on Linux, and we need a way to opt out of that from the swift frontend. &nbsp;I have not gone further with that since A) my C++-foo is not very excellent and B) core hasn't blessed any particular solution I proffered in that thread. &nbsp;If you can make progress there I would be grateful.</div><div class=""><br class=""></div><div class="">Then it is just a matter of getting the flags right; in practice, OSX wants -L path/to/swift_static -lc++ -framework Foundation -Xlinker -force_load_swift_libs, whereas Linux wants (I believe) -licuuc -licu18n -lbsd /path/to/swift_static/a.a /path/to/swift_static/b.a /path/to/swift_static/c.a ... &nbsp;There may be an equivalent to force_load_swift_libs that knows what libs to load, but I haven't found it yet.</div><div class=""><br class=""></div><div class="">However as long as the Swift frontend forcibly injects the dynamic link we are SOL, so some progress needs to be made in the frontend first.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On Feb 17, 2016, at 1:37 PM, Max Howell &lt;<a href="mailto:max.howell@apple.com" class="">max.howell@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="">We have a ticket open to implement static linking of swift libs.<div class=""><br class=""></div><div class="">If anyone on the Swift team knows how to do this and can comment here then I’m sure we can get it implemented pretty quickly.</div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 13, 2016, at 7:54 PM, Drew Crawford via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Whenever I update the installed Linux snapshot, my binaries break, with errors of the form:<div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">[programname]: symbol lookup error: [programname]: undefined symbol: _TFOs7Processau9argumentsGSaSS_</div></blockquote><br class=""><div class="">I assume this is the standard library symbol Process.arguments (which is used in my program).</div><div class=""><br class=""></div><div class="">I guess this is because the standard library is not statically linked/embedded in this executable. &nbsp;This happens by default on OSX, but I guess might not on Linux.</div><div class=""><br class=""></div><div class=""><ul class="MailOutline"><li class="">Is that a bug?</li><li class="">Is there a way to force statically link the standard library on Linux, so my binaries work without a recompile each new snapshot?</li></ul><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div><div class=""><br class=""></div></div>_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-users" class="">https://lists.swift.org/mailman/listinfo/swift-users</a><br class=""></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>