Originally posted by NobodyXu
View Post
Announcement
Collapse
No announcement yet.
GNU C Library 2.36 Released With New Functions, More Optimizations
Collapse
X
-
Actually did not bootstrap, needed a showstopper hot fix, but updated now: https://www.youtube.com/watch?v=9L3hAWNdZsk
Comment
-
Originally posted by bobbie424242 View Post
You can if you do not make use of dlopen and NSS functionality.
Comment
-
Originally posted by mlau View Postsure you can.
You'd have to avoid using dlopen, NSS and iconv (locale, used in stdio), as mentioned here, https://stackoverflow.com/questions/...bc-discouraged , which means that you cannot use stdio.h.
Originally posted by mlau View Postit also supports a LOT of functions. Besides, on modern systems most of it is shared by all processes using it, and ram has become plentiful.
Outside of memory-constrained embedded systems this is not an issue, and these tend to use libraries better suited
for their use case (I remember qnx6 allowed to trim the libc of the final image to contain only the functions that were
actually used by any process of that image, saved a few kilobytes).
Most of the time, musl libc is more than enough.
Originally posted by mlau View PostAnd yet almost everyone outside of embedded uses it, and and noone has stepped up to rectify these differences. They must be doing something right or the incompatibility with posix is not as grave as you think.
With musl libc, I can create a statically linked executable that works on anywhere.
Comment
-
Originally posted by PerformanceExpert View Post
Of course you can statically link with GLIBC. GLIBC is large because it has lots of features and supports lots of targets and many optimizations. But how does its size matter given it is shared across many binaries? I don't see any non-standard behaviour in your link, it's not a bug if you support additional floating point formats or printf specifiers. It's funny you mention MUSL, they seem religiously against optimization - even today many MUSL string functions simply process one byte at a time without any optimization whatsoever. Good luck with that!
Regarding the optimization, yeah they are not as good as glibc, but that also means their implementation is more robust.
You don't always need that much micro-optimization and often other tools already provide that functionalities.
Since I mostly program in rust, its std library is powerful enough and llvm is already pretty good at optimization.
Comment
-
Originally posted by NobodyXu View Post
Yes you can in theory, but no in reality.
You'd have to avoid using dlopen, NSS and iconv (locale, used in stdio), as mentioned here, https://stackoverflow.com/questions/...bc-discouraged , which means that you cannot use stdio.h.
As to iconv/nss/ I trust you know more about that than me.
Originally posted by NobodyXu View PostI didn't investigate into the improvement of glibc, but I use musl libc where portability is needed
Comment
-
Originally posted by mlau View PostI can't quite understand why you'd want to statically link the libc but then dlopen() other dependencies.
I never tried statically linked with Glibc myself because of its notorious fame and on the other hand, linking with musl libc is really easy and generates a small nice binary.
Originally posted by mlau View Postwhat does "portability" here mean exactly?
I remember that ubuntu 16/18 changes the Glibc, and anything compiles on these mew ubuntu cannot run on the old ones.
I didn't look into it, but this is sth you need to handle when using dynamic linking.
Comment
-
Originally posted by NobodyXu View PostNah, I don't need to dlopen other lib, but stdio.h seems to require iconv according to the link.
I never tried statically linked with Glibc myself because of its notorious fame and on the other hand, linking with musl libc is really easy and generates a small nice binary.
You don't have to care about the version of Glibc on your target.
I remember that ubuntu 16/18 changes the Glibc, and anything compiles on these mew ubuntu cannot run on the old ones.
That said, my guess is the value of static linking glibc is that you depend less on the version of glibc in the target, rather than not depending on the libc at all. Less surface for their "oh this symbol is too old" shenanigans.
Originally posted by NobodyXu View PostRegarding the optimization, yeah they are not as good as glibc, but that also means their implementation is more robust.
Originally posted by mlau View PostAnd yet almost everyone outside of embedded uses it, and and noone has stepped up to rectify these differences. They must be doing something right or the incompatibility with posix is not as grave as you think.
- Likes 3
Comment
Comment