Building Static Binaries and Libs

Hello,

I hope that this is the right channel for this type of question?

I've previously asked in swift-users about building a static binary, on
Linux, using:

swift build -Xswiftc -static-stdlib

It works for simple programs but fails on those importing Foundation.

I was pointed at this bug/feature-request and was thinking of taking it on
but might not have the time/skills to complete it:

I've pulled and built swift from master on the main repo and am going
through the steps to compile static lib (.a) files from the relevant
_corelibs_ and then adding them to my tool-chain.

Once I can do this I'll try and add them to the build process.

I'm getting there wit libFoundation but have been having more difficulty
with libDispatch.

Are there any docs or example projects I could look at for this?

Thanks

Joel

Hello,

I hope that this is the right channel for this type of question?

I've previously asked in swift-users about building a static binary, on Linux, using:

swift build -Xswiftc -static-stdlib

It works for simple programs but fails on those importing Foundation.

I was pointed at this bug/feature-request and was thinking of taking it on but might not have the time/skills to complete it: [SR-648] swift package manager should have the option to produce statically linked binaries · Issue #5432 · apple/swift-package-manager · GitHub

I've pulled and built swift from master on the main repo and am going through the steps to compile static lib (.a) files from the relevant _corelibs_ and then adding them to my tool-chain.

Once I can do this I'll try and add them to the build process.

I'm getting there wit libFoundation but have been having more difficulty with libDispatch.

Are there any docs or example projects I could look at for this?

I'm not sure that we have any better docs than the source, unfortunately.

If you have specific questions you can always try asking those in the bug or on the appropriate mailing lists.

- Daniel

···

On Sep 5, 2016, at 4:13 AM, Joel Hughes via swift-dev <swift-dev@swift.org> wrote:

Thanks

Joel
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev