# インストール $ apt install musl musl-tools musl-dev # コンパイル $ vi main.c ``` #include int main() { printf("ハロー\n"); } ``` $ musl-gcc -o test main.c $ ./test ハロー $ ls -thal test -rwxr-xr-x 1 root root 18K May 31 12:39 test $ ldd test ./test: error while loading shared libraries: /lib/x86_64-linux-gnu/libc.so: invalid ELF header $ musl-ldd test /lib/ld-musl-x86_64.so.1 (0x7f402de6d000) libc.so => /lib/ld-musl-x86_64.so.1 (0x7f402de6d000) $ musl-gcc -o test main.c -static -lc $ ./test ハロー $ ls -thal test -rwxr-xr-x 1 root root 33K May 31 12:41 test $ musl-ldd test musl-ldd: test: Not a valid dynamic program