AWS Lambda functions and the Linux Static SDK - works!

They do work, there has been quite some discussion on this previously. Eg in the original announcement thread here

The crux of it is: you can build a -static-executable but only if it does not use anything from libc because libc really does not want to be statically linked.

So, if you want a fully static executable AND you need something from libc, you can now use musl.

-static-stdlib has worked since a long time and allows you to only statically link the swift runtime libraries, but still dynamically link libc (and a few others). This brings the downside that the binary will not be as portable (mostly only runs reliably on the same distro and only if the libraries are present).

1 Like