3 ms·
You cannot really have static binary on modern linux with contemporary glibc. Unless you intend to break services NSS, that is. Even golang runtime checks for
by vetinari 6y ago
You cannot really have static binary on modern linux with contemporary glibc.
Unless you intend to break services NSS, that is. Even golang runtime checks for NSS config before ignoring glibc.
- enriquto 6y agoThis is indeed a major and shameful bug of GNU libc. There's no fundamental reason why NSS services cannot be statically linked. My pet conspiracy theory is that some glibc authors were anti-static linking fanatics (probably Drepper), and tried hard so that it was difficult to static link. Fortunately, we have musl libc where static linking works without trouble, and by the way produces smaller binaries.
- vetinari 6y agoNSS modules are actually plugins, so they have to be dynamic. They don't have to be shipped with glibc, other libs can ship their own, or even be standalone. For example, nss-mdns used to be standalone, or nss-resolve ships with systemd-resolved.
- yencabulator 6y agoNSS should have been a service spoken to over e.g. UNIX domain sockets.