Howto: Building for Linux with musl libc

Justin Cormack edited this page Mar 24, 2014 · 4 revisions
Clone this wiki locally

The musl libc is an alternative libc for Linux. Some Linux distros, such as Sabotage, use it as a full-out replacement for glibc. On systems which use glibc by default, it is possible to "pseudo-crosscompile" binaries to use musl by using the musl-gcc wrapper. requires at least musl after 0.9.12. With a sufficiently new musl, native musl distros are expected to just work. The rest of this page documents using musl-gcc.

Set the following environment variables:


Then run That's it. Note that virtif will not be built unless your musl environment offers the Linux kernel headers.