3 ms·
It depends on the libc. glibc doesn't really "want" to be statically linked. It can be done sometimes, depending on how it's used, the phase of the moon and so
by thu2111 7y ago
It depends on the libc.
glibc doesn't really "want" to be statically linked. It can be done sometimes, depending on how it's used, the phase of the moon and so on, but breaks from time to time until it's repaired.
Some of the issues are fundamental. For instance the dynamic linker is a part of the C libraries. If you statically link libc and then dynamically load another shared library, you can end up with two copies of the C libraries loaded at once.
The C library expects various external files to be found on disk, in a format that isn't totally forwards/backwards compatible. That's reasonable when things are dynamically linked because the linker and C library abstract the developer from format changes. If you statically link you should really statically link the data files too, but the C toolchain has no provision for that.
- pjmlp 7y agoThe ISO C standard library has no such expectations regarding external files.