Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 27636 - Kernel headers should match the kernel that compiled glibc
Summary: Kernel headers should match the kernel that compiled glibc
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: x86-kernel@gentoo.org (DEPRECATED)
URL:
Whiteboard:
Keywords:
Depends on: 10922
Blocks: 25836
  Show dependency tree
 
Reported: 2003-08-31 01:30 UTC by Alexander Winston
Modified: 2004-01-04 10:54 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Winston 2003-08-31 01:30:15 UTC
The version of the kernel headers is supposed to match the version of the kernel
that compiled glibc.
Comment 1 Tim Yamin (RETIRED) gentoo-dev 2003-08-31 10:38:55 UTC
I don't exactly see the problem here. The kernel headers in your /usr/src/... directory should match the kernel you are building, and the headers in /usr/include should ideally match those you built glibc with. There is no link between the two.
Comment 2 Spider (RETIRED) gentoo-dev 2003-08-31 11:14:15 UTC
perhaps he's asking about the fact that the headers were updated with -r1 that added a virtual/os-headers to the build?
Comment 3 Tim Yamin (RETIRED) gentoo-dev 2003-08-31 12:18:22 UTC
AFAIK [according to Seemant], os-headers is _currently_ just a meta definition of linux-headers. It was brought in from the GNU/Herd stuff, where os-headers would be used for OS headers, and not linux headers. Currently, it's just a meta definition.
Comment 4 Matt Taylor 2003-08-31 15:24:02 UTC
I've been wondering about the headers for a little while too.  I have linux-headers-2.4.18 installed and emerge -pu world shows linux-headers-2.4.19-r1 to be installed.  Is this safe?  Everyone says not to change the headers that glibc was compiled with but this will change mine.  If my headers shouldn't be updated then the default-1.0 profile should be changed.
Comment 5 Alexander Winston 2003-09-01 22:38:54 UTC
Say you compile glibc using 2.4.22. The 2.4.22 kernel headers should then be
installed for the remainder of the time that glibc is installed. If you upgrade
to a 2.4.23 kernel in the future, you shouldn't update your kernel headers. It
may cause problems, even unexplainable bugs. However, if you decide to recompile
your glibc while using 2.4.23, the 2.4.23 kernel headers should be installed.
Linus Torvalds has stressed this repeatedly in the past.
Comment 6 Matt Taylor 2003-09-02 12:34:44 UTC
Thats all well and good but portage wants to update my headers, not me.  I don't do blind emerge -pu worlds but many people do and could be in trouble with this.  Maybe the linux-headers ebuild should remerge glibc, or at least have an einfo that says you should.
Comment 7 Alexander Winston 2003-09-06 16:28:31 UTC
Not quite, but close.

When one emerges libc, the kernel headers should be remerged if the installed
version does not match the running kernel version.
Comment 8 Matt Taylor 2003-09-07 22:09:50 UTC
Oh I see what you're saying...I'm using gentoo-sources-2.4.20-r6, and if I emerge glibc I should be using linux-headers-2.4-20, but the newest x86 headers is 2.4.19, so it's not right.  But if I leave my glibc that I installed when I was running a 2.4.19 kernel then it's fine with mismatched headers/kernel.

I thought that the kernel and headers didn't have to match at all, just that the headers shouldn't change underneath glibc.
Comment 9 Joshua Kinard gentoo-dev 2003-10-30 15:09:32 UTC
AFAIK, this is incorrect.  It is apparently considered safe to run any version
of a kernel with a glibc compiled against headers older than the version
of the kernel running.  That glibc just won't make use of any new features
the newer kernel may implement.  Thus, if you're glibc is built against liunux-headers-2.4.21,
and you run a 2.4.22 or 2.4.23 kernel, you should be fine.

These are the *exact* circumstances many users are going to be using once
the 2.6 kernel goes final -- that is running 2.6.x with a glibc built against
2.4 headers.  I believe the only time the issue becomes an issue is when
glibc is compiled against headers that are newer than the version of kernel
being run.  However, I ran linux-2.4.20 on my sparc64 machine for near 6
months, with about half that time using 2.4.21 headers and noticed no odd
side effects of doing so.

I'll also add that gentoo is likely to be stuck on linux-headers-2.4.21 for
awhile, as a core package, iputils, attempts to use linux header files, and
files miserably on 2.4.22 headers.  iputils is that huggable little package
that provides utilities like ping and all, making it a bit annoying.  The
same issue also occurs with 2.6 headers.

Anyways, from my understanding, part of what allows this odd mix of kernel
versions and header versions is the fact that /usr/include/linux and /usr/include/asm
are not symlinks to their respective directories in /usr/src/linux/include*,
but that /usr/include/{linux,asm} are real directories with copies of the
headers in them.  I believe we are one of the few distributions to implement
this specific setup (correct me if wrong), so it's safe to have any random
version of a kernel in /usr/src/linux, or not even have a /usr/src/linux
symlink, as glibc will readily find it's desired header files already in
/usr/include.
Comment 10 Martin Schlemmer (RETIRED) gentoo-dev 2003-11-01 11:44:05 UTC
Ditto Joshua.  I am pretty sure I did comment on this before bugzilla went
down, and If there are any other issues left explaining, let me know.
Comment 11 Martin Schlemmer (RETIRED) gentoo-dev 2003-11-03 14:32:21 UTC
An solution is the CDEPEND (or was that PDEPEND) that was supposed to remerge
whatever even if it was already merged ...  Anybody can remember the status
of this ?
Comment 12 Tim Yamin (RETIRED) gentoo-dev 2004-01-04 10:54:20 UTC
I'm closing this as INVALID, I think we have a good explanation in comment #9 and many other bugs - if you do actually come across into trouble when using a non-matched glibc, please reopen this bug.