public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* New Kernel headers vs old Kernel headers
@ 2008-05-30 17:28 Marco
  2008-05-30 19:59 ` Willy Tarreau
  0 siblings, 1 reply; 2+ messages in thread
From: Marco @ 2008-05-30 17:28 UTC (permalink / raw)
  To: linux-kernel

Hello All,

I've come across a little discrepancy between the glibc docs and linux
kernel docs when I was trying to figure out what kernel headers I should
being using for my cross compiling.  The docs seem to say almost exactly
the opposite thing.

For a quick summary: linux docs(headers_install.txt) seem to indicate,
running glibc compiled against new kernel headers, on an older kernel
will possibly cause problems.  Where as glib docs(FAQ) indicate glibc
compiled against new kernel headers, will run fine on an older kernel.

Can someone shed some light on this (i.e. which is right)?

Thank you in advance

Marco Fonseca

(p.s. I've included the sections from both docs below for easy reference)


In linux-2.6.24/Documentation/make/headers_install.txt:
...
Kernel headers are backwards compatible, but not forwards compatible.  This
means that a program built against a C library using older kernel headers
should run on a newer kernel (although it may not have access to new
features), but a program built against newer kernel headers may not work
on an
older kernel.
...
------------------
In glibc-2.7/FAQ
...
1.8.    What version of the Linux kernel headers should be used?

{AJ,UD} The headers from the most recent Linux kernel should be used.  The
headers used while compiling the GNU C library and the kernel binary used
when using the library do not need to match.  The GNU C library runs without
problems on kernels that are older than the kernel headers used.  The other
way round (compiling the GNU C library with old kernel headers and running
on a recent kernel) does not necessarily work.  For example you can't use
new kernel features if you used old kernel headers to compile the GNU C
library.
...


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: New Kernel headers vs old Kernel headers
  2008-05-30 17:28 New Kernel headers vs old Kernel headers Marco
@ 2008-05-30 19:59 ` Willy Tarreau
  0 siblings, 0 replies; 2+ messages in thread
From: Willy Tarreau @ 2008-05-30 19:59 UTC (permalink / raw)
  To: Marco; +Cc: linux-kernel

On Fri, May 30, 2008 at 01:28:58PM -0400, Marco wrote:
> Hello All,
> 
> I've come across a little discrepancy between the glibc docs and linux
> kernel docs when I was trying to figure out what kernel headers I should
> being using for my cross compiling.  The docs seem to say almost exactly
> the opposite thing.
> 
> For a quick summary: linux docs(headers_install.txt) seem to indicate,
> running glibc compiled against new kernel headers, on an older kernel
> will possibly cause problems.  Where as glib docs(FAQ) indicate glibc
> compiled against new kernel headers, will run fine on an older kernel.
> 
> Can someone shed some light on this (i.e. which is right)?
> 
> Thank you in advance
> 
> Marco Fonseca
> 
> (p.s. I've included the sections from both docs below for easy reference)

IMHO and from experience, the kernel's version is the right one. Also,
it makes some sense, considering that even if you try to run an old
binary on a recent kernel, it generally works while the other way around
is not always true. Note however that what is said in glibc's doc mostly
talks about missing features. They may consider that the glibc offers an
abstraction between the application and the kernel, so that it should be
transparent to the application.

I think the right approach is to base your work on the oldest kernel you
intend to support. That way you'll get most features with the maximum
guarantee of backwards compatibility.

Willy


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-30 20:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-30 17:28 New Kernel headers vs old Kernel headers Marco
2008-05-30 19:59 ` Willy Tarreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox