Required dependencies for Ubuntu 22.04; error when compiling with -Xswiftc -static-executable

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:

  1. 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.
  2. 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
  3. 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
  4. we should update the docs accordingly, and also the dependencies list.

cc @Max_Desiatov @drexin @mishal_shah

1 Like