2 A quick-and-simple guide to installing musl:
7 Edit config.mak to override installation prefix, compiler options,
8 etc. as needed. The defaults should be okay for trying out musl with
9 static linking only. The only arch supported at present is i386. If
10 you're on an x86_64 machine, you can add -m32 to the compiler options
11 to build a working 32bit musl. In this case you will also need to add
12 -m32 in two locations in the generated tools/musl-gcc script if you
15 DO NOT set the prefix to /, /usr, or even /usr/local unless you really
16 know what you're doing! You'll probably break your system such that
17 you'll no longer be able to compile and link programs against glibc!
18 This kind of setup should only be used if you're building a system
19 where musl is the default/primary/only libc.
21 The default prefix is /usr/local/musl for a reason, but some people
22 may prefer /opt/musl or $HOME/musl.
27 Run "make". (GNU make is required.)
32 With appropriate privileges, run "make install".
35 STEP 4: Using the gcc wrapper.
37 musl comes with a script "musl-gcc" (installed in /usr/local/bin by
38 default) that can be used to compile and link C programs against musl.
39 It requires a version of gcc with the -wrapper option (gcc 4.x should
46 printf("hello, world!\n");
53 For compiling programs that use autoconf, you'll need to configure
54 them with a command like this:
56 CC=musl-gcc ./configure
58 Be aware that (at present) libraries linked against glibc are unlikely
59 to be usable, and the musl-gcc wrapper inhibits search of the system
60 library paths in any case. You'll need to compile any prerequisite
61 libraries (like ncurses, glib, etc.) yourself.