What is it, and why would I be interested?
musl is an alternate libc (standard C library), with:
-a stable ABI
-strict full X/Open 2008 (SUS4), POSIX (latest version), and ISO C99 conformance.
-substantial _GNU_SOURCE compatability
-C++ compatability
-for a week or two, -fstack-protector compatability (I haven't tested)
-an MIT license (changed yesterday or so from LGPL 2.1)
-size competetive with uclibc (slightly larger than dietlibc)
-modular design that makes for small static binaries
-TCB shadow passwords
-supports i386, x86_64, and arm (mips is planned)
-fairly easy to port
-responsive developer
You might be interested if you...:
-Want to build static binaries for linux on supported architectures
-want a small libc that doesn't break the abi regularly (vs uclibc)
-want full standard conformance, rather than "we pick how much of the standard we follow"
Building it:
There are two options: as a cross-compiler, or migrating the system.
If you migrate, you'll want to read the documentation included. I can supply some details, but that's for a later post.
1. Compile and install musl, preferably from git head (a release is a tag, not a branch, so all fixes are in git).
Code: Select all
git clone git://git.etalabs.net/musl
You may want to disable the shared library.
(PREFIX defaults to /usr/local/musl, and should not be set to /, /usr, or /usr/local without following the documentation on migrating)
2. Get the linux kernel headers (linux-libc-dev, not the ones for building modules) and put them somewhere (I use /opt/musl/lin)
There should be a linux/ subdirectory in the directory you install the headers in.
3. export CC=musl-gcc; export CFLAGS="-Os -static -fno-stack-protector -I/opt/musl/lin -D_GNU_SOURCE"
Don't forget the -D_GNU_SOURCE - most stuff won't build without that, though some will. -I/... should point to the linux headers.
(Note-the linux headers are needed for OSS and a lot besides)
4. Now run configure and make.
If you want to discuss anything related to musl, feel free to use this thread.