gcc has no problem with static linking. glibc can be statically linked (with gcc or clang) except the pluggable parts, which is NSS. How would you reconcile static linking and plugins?
By making use of plugin selection at compile time, like we used to do when dynamic linking wasn't available in mainstream OSes.
The whole idea of NSS is to be pluggable to let the local administrator chooses what they need.
Back in the day when UNIX only had static linking that type of plugability was achieved via configuration files and UNIX IPC.
Dynamic linking just makes it easy to program for the same scenario.
As a result of that good intention glibc must now be compiled into each and every program that wants to allow a customization complicating life for anybody who writes system software in anything but C/C++. I would rather preferred for NSS to never happen and instead Linux defined a set of services available over unix sockets for things like DNS resolution or user/group databases.
i don't know if it counts, but there's musl-gcc, right?
curious, is there no glibc solution? Its just the libnss* that requires dynamic linking?
Re:GoBGP: BGP Implemented in Go
by steveklabnik on Monday April 18, 2016 @05:24PM
(#11523263)
Apparently gcc seems to be the only C compiler lacking this capability, thanks to glibc.
Also, you can use dynamic linking in Go since version 1.5.