which kernel headers where

Ryan.Oliver at pha.com.au Ryan.Oliver at pha.com.au
Sun Jan 11 23:37:10 PST 2004






> I'm having a problem understanding (more than) a couple things about the
> lfs5.0 placement of the (2.4.24 in my case) kernel headers in
> /usr/include.  The way I read the famous '_don't_use_symlinks_' post,
> Linus Torvalds has some kernel headers somewhere in /usr/src/linux.

/usr/src/linux was traditionally a symlink to your kernel source.
The whole thing about the "don't use symlinks" argument was that if
you created symlinks from /usr/include pointing into your kernel source
( for include/linux and asm ) when you swapped kernels and repointed
your /usr/src/linux symlink, /usr/include/asm and linux would be pointing
at a different set of kernel headers than what glibc was built against.

That is why they are copied out of the kernel source tree into
/usr/include,
so that the definitions don't change from what glibc and the rest of
userspace
expect and have been built against.

> Ok, maybe it's only because I can't read or think, or fat fingered my
> recent hunt 'n peck lfs5.0 that they wound up in /usr/include for me.
Yep, as it should be

> I've not noticed any problems (with 2.6.1, either) but I also deleted
> (or never created) /usr/src/linux and that got me to wondering how I can
> be sure that the 2.4.24 headers in /usr/include 'are the ones that [will]
> be used' when other packages are compiled.

Because you copied them there. Unless you specify CPPFLAGS of
-I/usr/src/linux/include (and you don't want to do that) the compiler will
never look in the kernel tree for headers, only

/usr/local/include
${prefix}/lib/gcc-lib/${target}/${gcc_version}/include (gcc's includes)
${prefix}/${target}/include (where you'd stick target system headers if
cross-compiling)
and /usr/include

> I haven't done adequate research on this, but I did do a quick 'n dirty
> check of the faq, some of the lfs archives, and I googled a bit.  I saw
> some references to kernel headers, symlinks, and things like
--with-linux-
> kernel-headers=/usr/include/linux (don't know if every package allows
> setting this or, if yes, how _I_ would remember to always do it).

We point at the copied kernel headers under /tools/include when building
glibc chapter 5 as we have placed them in a non-standard directory.
We don't want to use the hosts headers.
After the toolchain is built ch5 everything looks after itself.

 HTH
Ryan




More information about the lfs-dev mailing list