[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Cleaning up kernel's headers for userspace



The Linux kernel makes a complete abortion of exporting stuff to
userspace in its headers. I'm trying to clean this up -- I've
implemented a 'make headers_install' in the kernel tree which copies out
selected headers which are supposed to be user-visible, and runs them
through unifdef if appropriate.

I've also added a 'make headers_check' which currently only does a
primitive check that the exported headers don't try to include anything
which _wasn't_ selected for inclusion, but hopefully can be extended to
check that each header is compilable on its own, and check for namespace
pollution, etc. 

I've also committed a few fixes so that the PowerPC kernel actually
passes the 'make headers_check'. This is all in a git tree at
git://git.infradead.org/~dwmw2/headers-2.6.git -- browsable at
http://git.infradead.org/?p=users/dwmw2/headers-2.6.git 

As maintainers for glibc and/or kernel headers in various distributions,
I'd like to solicit your feedback, and possibly also your assistance.
Does this look like it's going to address your needs and give you
something which you can just drop into /usr/include/ and use as it is?
If not, what's wrong with it and what can we do about it?

If all is well with the approach, I'd like to get it merged upstream and
then get started on actually cleaning up the crap which is exported, now
that 'make headers_install' actually puts it somewhere we can see it in
context.

Note that I'd rather not have a discussion about moving user-visible
headers into a separate directory right now. As long as we mark them for
export as we do at the moment, that's the interesting part. Linus has
already vetoed a suggestion that we move the public headers into a kabi/
directory, and I'd like to go back to him with that suggestion _after_
we've cleaned it all up and hopefully abolished the use of '#ifdef
__KERNEL__', in the hope that he'll change his mind. We'll have a
clearer idea of how we might want to organise things under kabi/ once
we've cleaned it all up and we know what we have left, anyway.

-- 
dwmw2



Reply to: