Linkage between toolchain and linux kernel

Yann E. MORIN yann.morin.1998@anciens.enib.fr
Sun Nov 15 00:23:00 GMT 2009


Zvi,
All,

On Saturday 14 November 2009 20:56:23 Zvi Vered wrote:
> In order to build a toolchain with ct-ng-1.5.1, one should specify the
> kernel version.
> The default for 1.5.1 is 2.6.31.1
> What is the linkage between the toolchain and the kerenl under which
> the application (built with new toolchain)) works ?

The kernel version used to build the toolchain are used by the C library
to know what the API exposed by the kernel is. The C library uses that
to decide whether or not to enable "workarounds" for missing features
in the kernel. For example (but this only an example that may not apply
to real world), if the kernel is missing AIO (Asynchronous Input/Output)
then the C library may enable its own implementation (in that case, using
threads, I guess).

> Example: Can I use a toolchain built with 2.6.31.1 headers to compile
> an application that will run under 2.6.29 ?

Short answer is: no you can't. glibc (and eglibc) check the running kernel
version, and if it is lower than the one it was configured with, then they
issues an error message, and the application terminates, not even reaching
main().

If your target will be running a 2.6.29 kernel, then you should configure
your toolchain with the 2.6.29 kernel headers. Or, you can still use the
2.6.31 headers, and tell glibc to enable "legacy" code by setting:
  C-library  --->
    Minimum supported kernel version  --->
      Specific kernel version
        Minimum kernel version to support = "2.6.29"

But the easiest way is to directly use the 2.6.29 headers.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'



--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list