[Aboriginal] [musl] Re: musl and kernel headers [was Re: system-images 1.4.2: od is broken; bzip2 is missing]
nsz at port70.net
Tue Oct 6 04:01:58 PDT 2015
* Rob Landley <rob at landley.net> [2015-10-05 21:24:01 -0500]:
> On 10/05/2015 08:44 PM, Rich Felker wrote:
> > On Mon, Oct 05, 2015 at 10:08:10AM -0500, Rob Landley wrote:
> > The cleaner approach is just avoiding including both the kernel
> > headers and libc/userspace headers for the same things in the same
> > file. In theory this may be hard in some cases, but I find that I can
> > almost always fix these sorts of errors during a build by commenting
> > out one or two #include lines.
> I am _deeply_ curious how you'd get linux/loop.h on a platform where you
> need the 32 bit loopback structure definition without including the
> kernel header. I struggled with that one a lot back in the busybox days.
in theory you can put all usage of the structure in a
separate translation unit where you don't include any
(if you need libc api you can declare prototypes e.g.
int ioctl(int, int,...); but if you need libc types
there then you are in trouble).
> (For the 64 bit version you can block copy the structure out of the
> header into your program, just like you can block copy everything out of
> headers and never actually #include anything, in the name of portability!)
> Sadly, the kernel headers are exported for a _reason_. If I need to
> syscall something you haven't wrapped, I need the _NR_ and it varies per
> target. It's a thing.
More information about the Aboriginal