[swift-users] Statically linked binaries on linux

Joel Hughes rudenoise at gmail.com
Thu Sep 1 11:13:58 CDT 2016


Hi,

I'm attempting to get a statically linked binary and am running into errors.

I'm using Swift 3 Preview 6 on Ubuntu.

Regular _swift build_ and _swift test_ are all running fine.

I can produce a static binary for a simple "hello world" using:

swift build -c release -Xswiftc -static-stdlib

(although I do get error while loading shared libraries: libicui18n.so.55
when running in a basic vm).

However I can't compile a more complicated project. It's only dependency is
Foundation (it uses NSUUID, and JSON) and can't seem to find them.

I get a stream of errors, examples:

Linking ./.build/release/joke
/usr/bin/ld.gold: error: cannot find -lFoundation
...
error: undefined reference to '_TMaC10Foundation6NSUUID'
...
error: undefined reference to
'_TFC10Foundation6NSUUIDCfT10uuidStringSS_GSqS0__'

Any pointers or advice much appreciated.

Thanks

Joel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160901/fecafdbb/attachment.html>


More information about the swift-users mailing list