4 ms·
Glibc is a nasty piece of software full of nonstandard GNUisms that basically implements a separate standard. I've fought for years against the fact they've got
by qalmakka 3y ago
Glibc is a nasty piece of software full of nonstandard GNUisms that basically implements a separate standard. I've fought for years against the fact they've got functions that are not found in any other libc and have different behaviours depending on macros, often conflicting with POSIX or BSD variants.
The fact the project was run for almost 20 years by a guy that managed it in a dictatorial style was a huge reason why so many alternative libc existed (that, and the licensing). Few people here remember about EGLIBC I guess.
Glibc is also such a mess that it still does not compile with Clang, after _decades_, due to all the crazy GCC extensions they rely on. An attempt is cyclically started and then promptly aborted when some new crazy nonsense is found. For instance, last time I checked they not only used the completely insane folly that GCC nested functions are, but they also relied on GCC attributes so nasty that LLVM never bothered implemented them (like renaming functions at code generation). Using these extensions are not really necessary, and I've a strong suspicious it was more of an attempt by the GNU authors to prevent distributions to ever consider not using GCC as their main compiler.
Also how name resolution is implemented in Glibc means you can't really statically link with it. If you've ever noticed, most "statically linked executables" are not in fact statically linked, but require ld.so just for libc. There are good reasons to disallow statically linking libc, but this is not one of them. Especially since the only stable API on Linux is the kernel interface, so the only way to not have to worry about future Glibc breakage is to either link with Musl or live with the risk.
- physicsguy 3y agoI get where you’re coming from but it’s impractical for many use cases to switch. I work in Python; pretty much no extension packages have a pre-compiled Musl version so you end up spending a ton of time compiling things!
- ftaghn 3y agohttps://pythonspeed.com/articles/alpine-docker-python/ https://pythonspeed.com/articles/alpine-docker-python/ >Using Alpine can make Python Docker builds 50× slower Musl is a dire mistake.
- CHY872 3y agoMy experience with musl has been that while it’ll most probably work, you’re severely at risk of a 30%+ perf degradation, and that means the juice is really not worth the squeeze. glibc shouldn’t be statically compiled in because it’s lgpl and so immediately infects your code if you do. The zig linker is quite nice here because it lets you pick what glibc you want to be compatible with.
- CodesInChaos 3y ago> you’re severely at risk of a 30%+ perf degradation Do you know if that's mainly due to the inefficient malloc, or if there are other important performance bottlenecks?
- Conscat 3y agoThe `[[gnu::optimize()]]` attribute is a fantastic feature that clang really should have some day.
- guilhas 3y agoBetter GNUisms than muslisms glibc has been more wildly tested, and fixed what was not working, while musl choices were mostly ideological