Hi Michael

In general it is not wise for simple user space program to use files under
linux. musl-gcc was designed to compile simple C programs without the
hassle of installing a full cross compiler.

Since musl does, unlike glibc, NOT depend on any linux-headers, you are
free to use your own set of linux headers if needed.

The best way is to use sanitized kernel headers like the one provided by
sabotage linux as download able tarball.
https://github.com/sabotage-linux/kernel-headers Simply install it and add
-I<path_to_kernel_headers> to your program.

If you want to compile more complicated programs you should look at the
musl-cross project: https://bitbucket.org/GregorR/musl-cross . After
installation you will end up with a full gcc system including linux headers
and binutils. It may sound strange at first to do cross compile for same
arch you are sitting on, but that's the way to go.

I do not consider this a bug of mus-gcc since it is simply not designed and
intended to compile more sophisticated programs.

If I find some time, I will package a full musl cross gcc toolchain.

Reply via email to