hi @sspringer some of this was discussed in https://forums.swift.org/t/pitch-package-manager-statically-link-swift-runtime-libraries-by-default-on-supported-platforms/
a few tl;dr take aways:
- it is difficult to produce a fully statically linked binary in swift today due to system dependencies - especially glibc. there is a long term plan to make this easier.
- for now, you would probably get better milage using
-static-stdlib
and avoiding (or manually bringing over) system dependencies that are not handled by-static-stdlib
- need to investigate how
-enable-experimental-cxx-interop
interacts with-static-stdlib
, if we are actually using C++ interoperability here. that is an experimental feature so I am not sure the implications of it on static linking are fully taken care of - we should update the docs accordingly, and also the dependencies list.