Re:Efficient string copying and concatenation in C
by BubRoss on Friday September 13, 2019 @10:36AM
(#20962540)
I know they are smaller, but why are they able to only pull in what you use when other libc implementations can't?
Re:Efficient string copying and concatenation in C
by dottrap on Saturday September 14, 2019 @12:54AM
(#20968986)
Any that allows static linking will get the same benefit.
For the three mentioned in the ancestor thread:
Apple doesn't ship a static libc, so developers must dynamically link.
glibc does allow static linking, but it is something they don't really go out of their way to promote and I recall some historic pains trying to get it to work right. Maybe that all works better today.
MSVC does allow static linking to msvcrt. MSVC is a little different than other platforms because they have permutations (and associated rules) you must be aware of: [debug | release], [static | dynamic], [single-threaded | multithreaded].
http://www.etalabs.net/compare_libcs.html
For the .a size:
musl: 426k
uClibc: 500k
dietlibc: 120k
If you statically link to these, your final binary will only pull what is actually needed and be smaller than this.