CPython uses glibc's getaddrinfo() to resolve hostnames. glibc tries to dynamically load the backend libs that implement the actual resolution, libnss_files.so and libnss_dns.so (as configured by staticx), which are unfortunately missing. When running staticx, it determines the libs to include by examining dependencies using ldd. For this reason, staticx adds a "fake" dependency on these two libs by linking libnssfix -- staticx's injected lib to configure nss to use only files and dns backends and ignore system configuration -- with nss_files and nss_dns. When building for ARM, we recompile staticx v0.13.6 with a patch that fixes some other static NSS issues (resolved in v0.13.7+) instead of using the prebuilt version from pypi.
The nss libs were never intended to be loaded by anything other than glibc itself, thus the lib.so -> lib.so.X symlinks for the linker are not installed. In turn, the linker complains that it cannot find -lnss_files and -lnss_dns. It appears that this was overcome by linking against fake static libraries, thus preventing the creation of dependencies for ldd to discover.
The solution is simply to replace these with the *.so symlinks ld expects.
CPython uses glibc's
getaddrinfo()
to resolve hostnames. glibc tries to dynamically load the backend libs that implement the actual resolution,libnss_files.so
andlibnss_dns.so
(as configured by staticx), which are unfortunately missing. When running staticx, it determines the libs to include by examining dependencies usingldd
. For this reason, staticx adds a "fake" dependency on these two libs by linkinglibnssfix
-- staticx's injected lib to configure nss to use onlyfiles
anddns
backends and ignore system configuration -- withnss_files
andnss_dns
. When building for ARM, we recompile staticx v0.13.6 with a patch that fixes some other static NSS issues (resolved in v0.13.7+) instead of using the prebuilt version from pypi.The nss libs were never intended to be loaded by anything other than glibc itself, thus the
lib.so -> lib.so.X
symlinks for the linker are not installed. In turn, the linker complains that it cannot find-lnss_files
and-lnss_dns
. It appears that this was overcome by linking against fake static libraries, thus preventing the creation of dependencies forldd
to discover.The solution is simply to replace these with the
*.so
symlinksld
expects.Related Issue
Motivation and Context
How Has This Been Tested?
Built and tested on graviton instance.
Screenshots
Checklist: