[RFC] What should go into /usr/include/linux? (was) Re: 2.4.0-test2 requires gcc-2.95, and /usr/include/linux

From: ferret@phonewave.net
Date: Sun Jun 25 2000 - 23:19:49 EST


And I thought this was resolved some years ago... But...

<RFC>

Which kernel's header files should go into /usr/include/linux for the C
library's use?

So far we have seen two options:

0) The kernel headers the C library was compiled against.
1) The kernel headers from the "current" kernel.

And we have one major GNU/Linux distribution doing each: Debian using
option 0, and Red Hat using option 1.

Which option is the best, and why?

</RFC>

<IMO>

I reccomend option 0:

For applications, compiling with the same headers the C library was
compiled with will prevent a possible point of failure.

I'm going completely from memory here, but I believe Linus used this type
of example around two or so years ago when complaining about Red Hat using
symlinks into the kernel source.

Somewhere in your headers you have a struct foo { }; which is part of
kernel subsystem bar.

Your C library is compiled against kernel version N.

Now come along and upgrade to kernel verson P, where our struct foo { };
has several extra fields in it for some new subfeature in subsystem bar.

I do not remember the exact technical details of the argument, but the
gist was that anything using foo/bar has an extra point of subtle
breakage.

Also, con to option 1:

In a case like my system I use to compile kernels for all different
machines, which of these is the current kernel? I could see where I might
end up with a program compiling for Alpha might try to compile against
Sparc kernel headers, for instance.

i believe the cross-compiling packages use static kernel headers per arch.

</IMO>

On Sun, 25 Jun 2000 ferret@phonewave.net wrote:

>
>
> On Sun, 25 Jun 2000, Matthew Vanecek wrote:
>
> > Steve Dodd wrote:
> > >
> > > On Sat, Jun 24, 2000 at 01:04:47PM +0100, Adam Sampson wrote:
> > >
> > > > Also, what's the official stance on what headers should be in
> > > > /usr/include/linux? The glibc 2.1.3 documentation says that
> > > > /usr/include/linux and usr/include/asm should be symlinks into the source
> > > > tree, but this hasn't been true for a long time now. Where should we get
> > > > the "new" headers from?
> > >
> > > $ dpkg -S /usr/include/linux
> > > libc6-dev: /usr/include/linux
> > >
> > > IOW, your libc headers package should include the kernel headers it was
> > > built against, I think.
> >
> > Are we trying to have a strict demarcation between Linux kernel headers,
> > and glibc headers? So that /usr/included/linux should come from glibc?
> > My /usr/include/asm and /usr/include/linux have been links into the
> > source tree for the last 5 years. Whenever someone complains about
> > missing headers, the de facto answer is "Do you have these symlinks?".
> > Look it up in the archives of almost any linux help list or newsgroup.
> > The simple fact of the matter is that for most people, the current
> > source tree contains the directories to which the links in /usr/include
> > point. The leaders of Linux kernel development may think they know
> > better, but according to common convention, and to glibc documentation,
> > /usr/include/linux, /usr/include/asm, etc., point to the current source
> > tree.
> [major snippage]
>
> What is considered the "current" source tree?
>
> Sometimes I use one machine to compile kernels and software for other
> machines, and I keep several different kernel versions around, under
> /usr/src/linux-<kernel version>. I even occationally cross-compile for
> Sparc linux.
>
> Perhaps this needs to become a kernel/glibc RFC?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jun 26 2000 - 21:00:08 EST