[klibc] [PATCH] build: Define __EXPORTED_HEADER__

Sam Ravnborg sam at ravnborg.org
Fri Feb 25 04:41:54 PST 2011


On Fri, Feb 25, 2011 at 11:40:46AM +0100, Arnd Bergmann wrote:
> On Friday 25 February 2011, Mike Waychison wrote:
> > On Thu, Feb 24, 2011 at 6:19 AM, Arnd Bergmann <arnd at arndb.de> wrote:
> > > On Thursday 24 February 2011, Mike Waychison wrote:
> > >> The kernel header guard to ensure that headers aren't included from
> > >> userland moved in commit 69c8f52b.  This causes the following message to
> > >> be emitted when building klibc (which is designed to use kernel headers
> > >> explicitly):
> > >>
> > >> /usr/local/src/git/linux-2.6//include/linux/types.h:13:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
> > >>
> > >> In order to silence this warning, make sure we define
> > >> __EXPORTED_HEADERS__ when building klibc userland.
> > >>
> > >> Signed-off-by: Mike Waychison <mikew at google.com>
> > >
> > > Well, klibc uses the kernel headers, but I don't think it's a good idea
> > > to use them directly without make headers_install. Since klibc also
> > > doesn't set -D__KERNEL__, the result should be the same, except that
> > > it makes sure not to use any headers that are meant to be internal.
> > 
> > I'm not sure I follow.  The warning happens when __KERNEL__ isn't set.
> > 
> > Also, the build for klibc explicitly supports using kernel headers
> > without installing them first via setting KLIBCKERNELSRC.
> 
> My point was that klibc should perhaps no longer support this. When klibc
> was initially written, we did not have a way to install kernel headers and
> distros shipped a set of hand-crafter modified kernel headers. This is no
> longer the case since the kernel headers now work for all other libc
> implementations after installing.

I second this. It is confusing to have two different methods to deal with kernel headers.

	Sam



More information about the klibc mailing list