3 ms·
I have been using Musl for various purposes for quite some time. I think my favourite things are: * The team are very helpful, and fix things fast and correctl
by justincormack 13y ago
I have been using Musl for various purposes for quite some time. I think my favourite things are:
* The team are very helpful, and fix things fast and correctly. You can see some of the detail in this post on race conditions in glibc http://ewontfix.com/16/ http://ewontfix.com/16/
* It is very standards compliant, so it is a good portability test for your code. It is a bit like using a BSD libc, except it does have Linux specific syscalls etc.
* Static linking works, which it doesnt properly in glibc. If you want to be like those trendy Go people and provide simple statically linked single file binaries, for running in containers etc then you can. And they will be small: the glibc shared library is 1.8MB (not including rt, pthread etc), while a Musl statically linked copy of Lua for example is only 160k. Static linking is very useful for all sorts of things, my most recent use was cross compiling bianries to run under qemu-user for testing.
* It is BSD licensed so you can use it in completely different projects however you want, eg OSv uses it http://osv.io/ http://osv.io/
* The code is small and readable. If you want to know how things work you can just take a look, quickly find the code and understand it. Just finding the code in glibc takes ages. I keep a reference copy just for this purpose.
You can use the "cross compiler" musl-gcc that ships with it to build if your code is happy being cross compiled (should be, most things just work). If you have a lot of dependencies it might be easier to use a distro, I use Sabotage in a chroot usually https://github.com/sabotage-linux/sabotage https://github.com/sabotage-linux/sabotage
- pascal_cuoq 13y agoNot to offend any secondary Musl contributor, but I think that your first favorite thing is all the more impressive that “The team” is essentially one person.
- dalias 13y agoIt started out that way, but these days we have several other developers who are pretty active. You can see from our stats on ohloh: https://www.ohloh.net/p/musl/contributors?query=&sort=commits https://www.ohloh.net/p/musl/contributors?query=&sort=commit... Also, without the work of the entire community testing and reporting issues getting various packages to work with musl, it would have taken forever to get this far. Testers and bug reporters are seriously under-appreciated!
- anonemouscoward 13y ago> Static linking works False. It doesn't. At the very least, VDSO support on Linux for static builds is broken. I.e., calls to time() and gettimeofday() and friends will be orders of magnitude slower when linking statically. Looking at the code I think nobody on the team was even aware that this is an important corner case. I'll stick to glibc, they at least do proper testing.