linux-libc-headers version (reloaded)
While doing some maintenance for our hipox machine i hit a problem which was discussed controversially a few months before on this ML[1] but was not solved completely in my opinion.
The basic question was if it is valid to use PREFERRED_VERSION_linux-libc-headers higher than the kernel version (like e.g angstrom-2008.1 does).
After some research on that topic i really believe this is not allowed. My strongest argument is the kernel docu itself:
"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."[2]
Also i did not found a linux distribution providing kernel headers newer than the kernel (whilst there are some with kernel headers older than the used kernel, e.g. openSUSE 11.3 with latest updates).
So i think the way the Ångström distribution handles this is wrong. If PREFERRED_VERSION_linux-libc-headers is set to 2.6.31 no kernel older than 2.6.31 should be allowed to guarantee the full functionality of all programs!
[1] <http://thread.gmane.org/gmane.comp.handhelds.openembedded/32375>
[2] Documentation/make/headers_install.txt
Steffen
Signature · 7 lines
DResearch Fahrzeugelektronik GmbH Otto-Schmirgal-Str. 3, 10319 Berlin, Germany Tel: +49 30 515932-237 mailto:[email protected] Fax: +49 30 515932-299 Geschäftsführer: Dr. Michael Weber, Werner Mögle; Amtsgericht Berlin Charlottenburg; HRB 130120 B; Ust.-IDNr. DE273952058
Quoted 5 lines · Steffen Sledz
"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."[2]
Isn't this what the variable OLDEST_KERNEL is good for, when compiling glibc?
Regards,
Andreas
Quoted 9 lines · Andreas Oberritter
Quoted 5 lines · Steffen Sledz
"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."[2]
Isn't this what the variable
OLDEST_KERNELis good for, when compiling glibc?
Right. But other things can start to rely on the kernel interfaces (where it's allowed to) as well, and often don't do the various hoops to be forwards compatible at run time.
Signature · 2 lines
Tom Rini Mentor Graphics Corporation
Am 15.02.2011 15:12, schrieb Andreas Oberritter:
Quoted 9 lines · Steffen Sledz
Quoted 5 lines
"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."[2]
Isn't this what the variable
OLDEST_KERNELis good for, when compiling glibc?
If i'm right this goes to the --enable-kernel=VERSION configure option of glibc just to optimize the library.
"the configure option --enable-kernel=X.Y.Z allows to strip out compatibility for kernel versions before X.Y.Z."
Imho it is not legitimately to follow that glibc has compatibility code for all kernels greater or equal X.Y.Z.
Another question is the handling in other libc implementations.
And finally there are a lot of programs using userland kernel headers directly.
Steffen
Signature · 7 lines
DResearch Fahrzeugelektronik GmbH Otto-Schmirgal-Str. 3, 10319 Berlin, Germany Tel: +49 30 515932-237 mailto:[email protected] Fax: +49 30 515932-299 Geschäftsführer: Dr. Michael Weber, Werner Mögle; Amtsgericht Berlin Charlottenburg; HRB 130120 B; Ust.-IDNr. DE273952058
Am 15.02.2011 15:50, schrieb Steffen Sledz:
Quoted 13 lines
Am 15.02.2011 15:12, schrieb Andreas Oberritter:
Quoted 9 lines · Steffen Sledz
Quoted 5 lines
"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."[2]
Isn't this what the variable
OLDEST_KERNELis good for, when compiling glibc?If i'm right this goes to the --enable-kernel=VERSION configure option of glibc just to optimize the library.
Quoted 7 lines
"the configure option --enable-kernel=X.Y.Z allows to strip out compatibility for kernel versions before X.Y.Z."
Imho it is not legitimately to follow that glibc has compatibility code for all kernels greater or equal X.Y.Z.
Another question is the handling in other libc implementations.
And finally there are a lot of programs using userland kernel headers directly.
Ping!
If i interpret responses from Tom and Phil right they agree with me (or at least do not disagree). ;-)
But i miss reactions from the distro maintainers (especially Ångström).
Regards,
Steffen
Signature · 7 lines
DResearch Fahrzeugelektronik GmbH Otto-Schmirgal-Str. 3, 10319 Berlin, Germany Tel: +49 30 515932-237 mailto:[email protected] Fax: +49 30 515932-299 Geschäftsführer: Dr. Michael Weber, Werner Mögle; Amtsgericht Berlin Charlottenburg; HRB 130120 B; Ust.-IDNr. DE273952058
Quoted 20 lines · Steffen Sledz
Am 15.02.2011 15:50, schrieb Steffen Sledz:
Quoted 19 lines
Am 15.02.2011 15:12, schrieb Andreas Oberritter:
Quoted 9 lines · Steffen Sledz
Quoted 5 lines
"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."[2]
Isn't this what the variable
OLDEST_KERNELis good for, when compiling glibc?If i'm right this goes to the --enable-kernel=VERSION configure option of glibc just to optimize the library.
"the configure option --enable-kernel=X.Y.Z allows to strip out compatibility for kernel versions before X.Y.Z."
Imho it is not legitimately to follow that glibc has compatibility code for all kernels greater or equal X.Y.Z.
Another question is the handling in other libc implementations.
Quoted 8 lines
Quoted 1 line
And finally there are a lot of programs using userland kernel headers directly.
Ping!
If i interpret responses from Tom and Phil right they agree with me (or at least do not disagree). ;-)
But i miss reactions from the distro maintainers (especially Ångström).
I think we should make sure that linux version chosen for a build is equal or newer than linux-libc-headers for that build. Another option is that linux-libc-headers are driven out
of selected virtual/kernel too but this may be a bit clunky since it would mean that
every machine will have them different and we share sysroots e.g. two armv5te may use
same sysroot
Quoted 30 lines · Khem Raj
Quoted 20 lines · Steffen Sledz
Am 15.02.2011 15:50, schrieb Steffen Sledz:
Quoted 19 lines
Am 15.02.2011 15:12, schrieb Andreas Oberritter:
Quoted 9 lines · Steffen Sledz
Quoted 5 lines
"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."[2]
Isn't this what the variable
OLDEST_KERNELis good for, when compiling glibc?If i'm right this goes to the --enable-kernel=VERSION configure option of glibc just to optimize the library.
"the configure option --enable-kernel=X.Y.Z allows to strip out compatibility for kernel versions before X.Y.Z."
Imho it is not legitimately to follow that glibc has compatibility code for all kernels greater or equal X.Y.Z.
Another question is the handling in other libc implementations.
Quoted 8 lines
Quoted 1 line
And finally there are a lot of programs using userland kernel headers directly.
Ping!
If i interpret responses from Tom and Phil right they agree with me (or at least do not disagree). ;-)
But i miss reactions from the distro maintainers (especially Ångström).
Quoted 8 lines
I think we should make sure that linux version chosen for a build is equal or newer than linux-libc-headers for that build. Another option is that linux-libc-headers are driven out
of selected virtual/kernel too but this may be a bit clunky since it would mean that
every machine will have them different and we share sysroots e.g. two armv5te may use
same sysroot
I like to force the discussion/work/decision on this problem because we're one of the mourners (we're forced to use 2.6.24 kernel by out hardware vendor :( ).
I also see the multi-machine problem (the shared sysroot at build time and the feed problem too).
So what options do we (our Ångström) have?
(1) Do not support kernel older than 2.6.31 (which is the current LINUX_LIBC_HEADERS_VERSION).
(2) Set LINUX_LIBC_HEADERS_VERSION to 2.6.16 (which is the current OLDEST_KERNEL).
(3) Support machine specific distro incarnations (incl. special feeds).
May be some more. Option (1) would be really bad for us. I believe (2) would be bad for a lot of users because of a potential loss of functionality.
Steffen
Signature · 7 lines
DResearch Fahrzeugelektronik GmbH Otto-Schmirgal-Str. 3, 10319 Berlin, Germany Tel: +49 30 515932-237 mailto:[email protected] Fax: +49 30 515932-299 Geschäftsführer: Dr. Michael Weber, Werner Mögle; Amtsgericht Berlin Charlottenburg; HRB 130120 B; Ust.-IDNr. DE273952058
Quoted 46 lines · Steffen Sledz
Quoted 30 lines · Khem Raj
Quoted 20 lines · Steffen Sledz
Am 15.02.2011 15:50, schrieb Steffen Sledz:
Quoted 19 lines
Am 15.02.2011 15:12, schrieb Andreas Oberritter:
Quoted 9 lines · Steffen Sledz
Quoted 5 lines
"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."[2]
Isn't this what the variable
OLDEST_KERNELis good for, when compiling glibc?If i'm right this goes to the --enable-kernel=VERSION configure option of glibc just to optimize the library.
"the configure option --enable-kernel=X.Y.Z allows to strip out compatibility for kernel versions before X.Y.Z."
Imho it is not legitimately to follow that glibc has compatibility code for all kernels greater or equal X.Y.Z.
Another question is the handling in other libc implementations.
Quoted 8 lines
Quoted 1 line
And finally there are a lot of programs using userland kernel headers directly.
Ping!
If i interpret responses from Tom and Phil right they agree with me (or at least do not disagree). ;-)
But i miss reactions from the distro maintainers (especially Ångström).
Quoted 8 lines
I think we should make sure that linux version chosen for a build is equal or newer than linux-libc-headers for that build. Another option is that linux-libc-headers are driven out
of selected virtual/kernel too but this may be a bit clunky since it would mean that
every machine will have them different and we share sysroots e.g. two armv5te may use
same sysrootI like to force the discussion/work/decision on this problem because we're one of the mourners (we're forced to use 2.6.24 kernel by out hardware vendor :( ).
I also see the multi-machine problem (the shared sysroot at build time and the feed problem too).
So what options do we (our Ångström) have?
Quoted 7 lines
(1) Do not support kernel older than 2.6.31 (which is the current
LINUX_LIBC_HEADERS_VERSION).(2) Set
LINUX_LIBC_HEADERS_VERSIONto 2.6.16 (which is the currentOLDEST_KERNEL).(3) Support machine specific distro incarnations (incl. special feeds).
May be some more. Option (1) would be really bad for us. I believe (2) would be bad for a lot of users because of a potential loss of functionality.
I'm still not convinced that requiring older headers is a good way to go. If applications are using new syscalls directly, they need to handle ENOSYS. If the applications already contain code to be compatible across various kernel versions at compile time, then it won't be that hard to change those applications to detect available interfaces at runtime.
IIRC, the kernel policy is to disallow incompatible changes to user interfaces, so applications compiled against new headers generally don't magically start to use new interfaces, unless their code gets adapted to them.
Can you please shed some light on which kernel interfaces are actually causing problems?
Btw.: The availability of syscalls not only depends on the kernel version but on the kernel configuration, too. For example, if you compile a kernel without CONFIG_EPOLL, epoll will still be available in the kernel headers and will be found by autotools etc. But it will alwyas return ENOSYS. We certainly can't provide matching linux-libc-headers to avoid that.
Regards,
Andreas
Quoted 53 lines · Andreas Oberritter
Quoted 52 lines · Steffen Sledz
Quoted 30 lines · Khem Raj
Quoted 20 lines · Steffen Sledz
Am 15.02.2011 15:50, schrieb Steffen Sledz:
Quoted 19 lines
Am 15.02.2011 15:12, schrieb Andreas Oberritter:
Quoted 9 lines · Steffen Sledz
Quoted 5 lines
"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."[2]
Isn't this what the variable
OLDEST_KERNELis good for, when compiling glibc?If i'm right this goes to the --enable-kernel=VERSION configure option of glibc just to optimize the library.
"the configure option --enable-kernel=X.Y.Z allows to strip out compatibility for kernel versions before X.Y.Z."
Imho it is not legitimately to follow that glibc has compatibility code for all kernels greater or equal X.Y.Z.
Another question is the handling in other libc implementations.
Quoted 8 lines
Quoted 1 line
And finally there are a lot of programs using userland kernel headers directly.
Ping!
If i interpret responses from Tom and Phil right they agree with me (or at least do not disagree). ;-)
But i miss reactions from the distro maintainers (especially Ångström).
Quoted 8 lines
I think we should make sure that linux version chosen for a build is equal or newer than linux-libc-headers for that build. Another option is that linux-libc-headers are driven out
of selected virtual/kernel too but this may be a bit clunky since it would mean that
every machine will have them different and we share sysroots e.g. two armv5te may use
same sysrootI like to force the discussion/work/decision on this problem because we're one of the mourners (we're forced to use 2.6.24 kernel by out hardware vendor :( ).
I also see the multi-machine problem (the shared sysroot at build time and the feed problem too).
So what options do we (our Ångström) have?
(1) Do not support kernel older than 2.6.31 (which is the current
LINUX_LIBC_HEADERS_VERSION).(2) Set
LINUX_LIBC_HEADERS_VERSIONto 2.6.16 (which is the currentOLDEST_KERNEL).(3) Support machine specific distro incarnations (incl. special feeds).
Quoted 7 lines
Quoted 1 line
May be some more. Option (1) would be really bad for us. I believe (2) would be bad for a lot of users because of a potential loss of functionality.
I'm still not convinced that requiring older headers is a good way to go. If applications are using new syscalls directly, they need to handle ENOSYS. If the applications already contain code to be compatible across various kernel versions at compile time, then it won't be that hard to change those applications to detect available interfaces at runtime.
At first i believe that practically it is not possible for us to guarantee that all apps do this in the right way. But second i'm not sure if this is the only problem.
The kernel docu (what's the primary docu for me) itself says "but a program built against newer kernel headers may not work on an older kernel." (see top of this post).
This should be reason enough to avoid newer kernel headers (like all other linux distros do)!
Steffen
Signature · 7 lines
DResearch Fahrzeugelektronik GmbH Otto-Schmirgal-Str. 3, 10319 Berlin, Germany Tel: +49 30 515932-237 mailto:[email protected] Fax: +49 30 515932-299 Geschäftsführer: Dr. Michael Weber, Werner Mögle; Amtsgericht Berlin Charlottenburg; HRB 130120 B; Ust.-IDNr. DE273952058
Quoted 62 lines · Steffen Sledz
Quoted 53 lines · Andreas Oberritter
Quoted 52 lines · Steffen Sledz
Quoted 30 lines · Khem Raj
Quoted 20 lines · Steffen Sledz
Am 15.02.2011 15:50, schrieb Steffen Sledz:
Quoted 19 lines
Am 15.02.2011 15:12, schrieb Andreas Oberritter:
Quoted 9 lines · Steffen Sledz
Quoted 5 lines
"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."[2]
Isn't this what the variable
OLDEST_KERNELis good for, when compiling glibc?If i'm right this goes to the --enable-kernel=VERSION configure option of glibc just to optimize the library.
"the configure option --enable-kernel=X.Y.Z allows to strip out compatibility for kernel versions before X.Y.Z."
Imho it is not legitimately to follow that glibc has compatibility code for all kernels greater or equal X.Y.Z.
Another question is the handling in other libc implementations.
Quoted 8 lines
Quoted 1 line
And finally there are a lot of programs using userland kernel headers directly.
Ping!
If i interpret responses from Tom and Phil right they agree with me (or at least do not disagree). ;-)
But i miss reactions from the distro maintainers (especially Ångström).
Quoted 8 lines
I think we should make sure that linux version chosen for a build is equal or newer than linux-libc-headers for that build. Another option is that linux-libc-headers are driven out
of selected virtual/kernel too but this may be a bit clunky since it would mean that
every machine will have them different and we share sysroots e.g. two armv5te may use
same sysrootI like to force the discussion/work/decision on this problem because we're one of the mourners (we're forced to use 2.6.24 kernel by out hardware vendor :( ).
I also see the multi-machine problem (the shared sysroot at build time and the feed problem too).
So what options do we (our Ångström) have?
(1) Do not support kernel older than 2.6.31 (which is the current
LINUX_LIBC_HEADERS_VERSION).(2) Set
LINUX_LIBC_HEADERS_VERSIONto 2.6.16 (which is the currentOLDEST_KERNEL).(3) Support machine specific distro incarnations (incl. special feeds).
Quoted 7 lines
Quoted 1 line
May be some more. Option (1) would be really bad for us. I believe (2) would be bad for a lot of users because of a potential loss of functionality.
I'm still not convinced that requiring older headers is a good way to go. If applications are using new syscalls directly, they need to handle ENOSYS. If the applications already contain code to be compatible across various kernel versions at compile time, then it won't be that hard to change those applications to detect available interfaces at runtime.
Quoted 5 lines
At first i believe that practically it is not possible for us to guarantee that all apps do this in the right way. But second i'm not sure if this is the only problem.
The kernel docu (what's the primary docu for me) itself says "but a program built against newer kernel headers may not work on an older kernel." (see top of this post).
This should be reason enough to avoid newer kernel headers (like all other linux distros do)!
Well one way is to have kernel headers per machine which means you can not share target packages anymore since they have to build per machine but it would be much integrated solution and we could generate the kernel headers from the kernel recipe itself so we are sure that the .config of kernel headers match the .config of kernel itself downside is it will defeat the multimachine sharing packages a bit.
Second solution is to use the older or equal to oldest kernel of all multimachines for kernel headers. the problem Andreas described of differen defconfigs will still be there
but it will work *mostly*
Quoted 17 lines
Steffen
--
DResearch Fahrzeugelektronik GmbH Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
Tel: +49 30 515932-237 mailto:[email protected]
Fax: +49 30 515932-299
Geschäftsführer: Dr. Michael Weber, Werner Mögle; Amtsgericht Berlin Charlottenburg; HRB 130120 B; Ust.-IDNr. DE273952058_______________________________________________
Openembedded-devel mailing list [email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Am 25.02.2011 08:51, schrieb Khem Raj:
Quoted 67 lines · Steffen Sledz
Quoted 66 lines · Andreas Oberritter
Quoted 53 lines · Steffen Sledz
Quoted 52 lines · Khem Raj
Quoted 30 lines · Steffen Sledz
Quoted 20 lines
Am 15.02.2011 15:50, schrieb Steffen Sledz:
Quoted 19 lines
Am 15.02.2011 15:12, schrieb Andreas Oberritter:
Quoted 9 lines · Steffen Sledz
Quoted 5 lines
"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."[2]
Isn't this what the variable
OLDEST_KERNELis good for, when compiling glibc?If i'm right this goes to the --enable-kernel=VERSION configure option of glibc just to optimize the library.
"the configure option --enable-kernel=X.Y.Z allows to strip out compatibility for kernel versions before X.Y.Z."
Imho it is not legitimately to follow that glibc has compatibility code for all kernels greater or equal X.Y.Z.
Another question is the handling in other libc implementations.
Quoted 8 lines
Quoted 1 line
And finally there are a lot of programs using userland kernel headers directly.
Ping!
If i interpret responses from Tom and Phil right they agree with me (or at least do not disagree). ;-)
But i miss reactions from the distro maintainers (especially Ångström).
Quoted 8 lines
I think we should make sure that linux version chosen for a build is equal or newer than linux-libc-headers for that build. Another option is that linux-libc-headers are driven out
of selected virtual/kernel too but this may be a bit clunky since it would mean that
every machine will have them different and we share sysroots e.g. two armv5te may use
same sysrootI like to force the discussion/work/decision on this problem because we're one of the mourners (we're forced to use 2.6.24 kernel by out hardware vendor :( ).
I also see the multi-machine problem (the shared sysroot at build time and the feed problem too).
So what options do we (our Ångström) have?
(1) Do not support kernel older than 2.6.31 (which is the current
LINUX_LIBC_HEADERS_VERSION).(2) Set
LINUX_LIBC_HEADERS_VERSIONto 2.6.16 (which is the currentOLDEST_KERNEL).(3) Support machine specific distro incarnations (incl. special feeds).
Quoted 7 lines
Quoted 1 line
May be some more. Option (1) would be really bad for us. I believe (2) would be bad for a lot of users because of a potential loss of functionality.
I'm still not convinced that requiring older headers is a good way to go. If applications are using new syscalls directly, they need to handle ENOSYS. If the applications already contain code to be compatible across various kernel versions at compile time, then it won't be that hard to change those applications to detect available interfaces at runtime.
At first i believe that practically it is not possible for us to guarantee that all apps do this in the right way. But second i'm not sure if this is the only problem.
The kernel docu (what's the primary docu for me) itself says "but a program built against newer kernel headers may not work on an older kernel." (see top of this post).
Quoted 8 lines
Quoted 1 line
This should be reason enough to avoid newer kernel headers (like all other linux distros do)!
Well one way is to have kernel headers per machine which means you can not share target packages anymore since they have to build per machine but it would be much integrated solution and we could generate the kernel headers from the kernel recipe itself so we are sure that the .config of kernel headers match the .config of kernel itself downside is it will defeat the multimachine sharing packages a bit.
That would definitely be my preferred solution. I hope the distro maintainers can handle this.
Quoted 4 lines
Second solution is to use the older or equal to oldest kernel of all multimachines for kernel headers. the problem Andreas described of differen defconfigs will still be there
but it will work *mostly*
Just my second choice.
Steffen
Signature · 7 lines
DResearch Fahrzeugelektronik GmbH Otto-Schmirgal-Str. 3, 10319 Berlin, Germany Tel: +49 30 515932-237 mailto:[email protected] Fax: +49 30 515932-299 Geschäftsführer: Dr. Michael Weber, Werner Mögle; Amtsgericht Berlin Charlottenburg; HRB 130120 B; Ust.-IDNr. DE273952058
2011/2/25 Khem Raj <[email protected]>:
Quoted 67 lines · Steffen Sledz
Quoted 66 lines · Andreas Oberritter
Quoted 53 lines · Steffen Sledz
Quoted 52 lines · Khem Raj
Quoted 30 lines · Steffen Sledz
Quoted 20 lines
Am 15.02.2011 15:50, schrieb Steffen Sledz:
Quoted 19 lines
Am 15.02.2011 15:12, schrieb Andreas Oberritter:
Quoted 9 lines · Steffen Sledz
Quoted 5 lines
"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."[2]
Isn't this what the variable
OLDEST_KERNELis good for, when compiling glibc?If i'm right this goes to the --enable-kernel=VERSION configure option of glibc just to optimize the library.
"the configure option --enable-kernel=X.Y.Z allows to strip out compatibility for kernel versions before X.Y.Z."
Imho it is not legitimately to follow that glibc has compatibility code for all kernels greater or equal X.Y.Z.
Another question is the handling in other libc implementations.
Quoted 8 lines
Quoted 1 line
And finally there are a lot of programs using userland kernel headers directly.
Ping!
If i interpret responses from Tom and Phil right they agree with me (or at least do not disagree). ;-)
But i miss reactions from the distro maintainers (especially Ångström).
Quoted 8 lines
I think we should make sure that linux version chosen for a build is equal or newer than linux-libc-headers for that build. Another option is that linux-libc-headers are driven out
of selected virtual/kernel too but this may be a bit clunky since it would mean that
every machine will have them different and we share sysroots e.g. two armv5te may use
same sysrootI like to force the discussion/work/decision on this problem because we're one of the mourners (we're forced to use 2.6.24 kernel by out hardware vendor :( ).
I also see the multi-machine problem (the shared sysroot at build time and the feed problem too).
So what options do we (our Ångström) have?
(1) Do not support kernel older than 2.6.31 (which is the current
LINUX_LIBC_HEADERS_VERSION).(2) Set
LINUX_LIBC_HEADERS_VERSIONto 2.6.16 (which is the currentOLDEST_KERNEL).(3) Support machine specific distro incarnations (incl. special feeds).
Quoted 7 lines
Quoted 1 line
May be some more. Option (1) would be really bad for us. I believe (2) would be bad for a lot of users because of a potential loss of functionality.
I'm still not convinced that requiring older headers is a good way to go. If applications are using new syscalls directly, they need to handle ENOSYS. If the applications already contain code to be compatible across various kernel versions at compile time, then it won't be that hard to change those applications to detect available interfaces at runtime.
At first i believe that practically it is not possible for us to guarantee that all apps do this in the right way. But second i'm not sure if this is the only problem.
The kernel docu (what's the primary docu for me) itself says "but a program built against newer kernel headers may not work on an older kernel." (see top of this post).
Quoted 8 lines
Quoted 1 line
This should be reason enough to avoid newer kernel headers (like all other linux distros do)!
Well one way is to have kernel headers per machine which means you can not share target packages anymore since they have to build per machine but it would be much integrated solution and we could generate the kernel headers from the kernel recipe itself so we are sure that the .config of kernel headers match the .config of kernel itself downside is it will defeat the multimachine sharing packages a bit.
Maybe an intermediate is to have kernel headers per kernel recipe. That still allows multimachine sharing of packages between systems that use the same arch and kernel recipe.
(and I feel sharing packages between machines with different kernels is somewhat risky anyway as there might be differences between e.g. the stock kernel and a kernel pulled from a vendor git or so).
Frans
Quoted 7 lines
Second solution is to use the older or equal to oldest kernel of all multimachines for kernel headers. the problem Andreas described of differen defconfigs will still be there
but it will work *mostly*
Quoted 77 lines · Frans Meulenbroeks
2011/2/25 Khem Raj <[email protected]>:
Quoted 67 lines · Steffen Sledz
Quoted 66 lines · Andreas Oberritter
Quoted 53 lines · Steffen Sledz
Quoted 52 lines · Khem Raj
Quoted 30 lines · Steffen Sledz
Quoted 20 lines
Am 15.02.2011 15:50, schrieb Steffen Sledz:
Quoted 19 lines
Am 15.02.2011 15:12, schrieb Andreas Oberritter:
Quoted 9 lines · Steffen Sledz
Quoted 5 lines
"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."[2]
Isn't this what the variable
OLDEST_KERNELis good for, when compiling glibc?If i'm right this goes to the --enable-kernel=VERSION configure option of glibc just to optimize the library.
"the configure option --enable-kernel=X.Y.Z allows to strip out compatibility for kernel versions before X.Y.Z."
Imho it is not legitimately to follow that glibc has compatibility code for all kernels greater or equal X.Y.Z.
Another question is the handling in other libc implementations.
Quoted 8 lines
Quoted 1 line
And finally there are a lot of programs using userland kernel headers directly.
Ping!
If i interpret responses from Tom and Phil right they agree with me (or at least do not disagree). ;-)
But i miss reactions from the distro maintainers (especially Ångström).
Quoted 8 lines
I think we should make sure that linux version chosen for a build is equal or newer than linux-libc-headers for that build. Another option is that linux-libc-headers are driven out
of selected virtual/kernel too but this may be a bit clunky since it would mean that
every machine will have them different and we share sysroots e.g. two armv5te may use
same sysrootI like to force the discussion/work/decision on this problem because we're one of the mourners (we're forced to use 2.6.24 kernel by out hardware vendor :( ).
I also see the multi-machine problem (the shared sysroot at build time and the feed problem too).
So what options do we (our Ångström) have?
(1) Do not support kernel older than 2.6.31 (which is the current
LINUX_LIBC_HEADERS_VERSION).(2) Set
LINUX_LIBC_HEADERS_VERSIONto 2.6.16 (which is the currentOLDEST_KERNEL).(3) Support machine specific distro incarnations (incl. special feeds).
Quoted 7 lines
Quoted 1 line
May be some more. Option (1) would be really bad for us. I believe (2) would be bad for a lot of users because of a potential loss of functionality.
I'm still not convinced that requiring older headers is a good way to go. If applications are using new syscalls directly, they need to handle ENOSYS. If the applications already contain code to be compatible across various kernel versions at compile time, then it won't be that hard to change those applications to detect available interfaces at runtime.
At first i believe that practically it is not possible for us to guarantee that all apps do this in the right way. But second i'm not sure if this is the only problem.
The kernel docu (what's the primary docu for me) itself says "but a program built against newer kernel headers may not work on an older kernel." (see top of this post).
Quoted 8 lines
Quoted 1 line
This should be reason enough to avoid newer kernel headers (like all other linux distros do)!
Well one way is to have kernel headers per machine which means you can not share target packages anymore since they have to build per machine but it would be much integrated solution and we could generate the kernel headers from the kernel recipe itself so we are sure that the .config of kernel headers match the .config of kernel itself downside is it will defeat the multimachine sharing packages a bit.
Quoted 3 lines
Maybe an intermediate is to have kernel headers per kernel recipe. That still allows multimachine sharing of packages between systems that use the same arch and kernel recipe.
Sounds good to me.
Quoted 10 lines
(and I feel sharing packages between machines with different kernels is somewhat risky anyway as there might be differences between e.g. the stock kernel and a kernel pulled from a vendor git or so).
Frans
Quoted 5 lines
Second solution is to use the older or equal to oldest kernel of all multimachines for kernel headers. the problem Andreas described of differen defconfigs will still be there
but it will work *mostly*
Steffen
Signature · 7 lines
DResearch Fahrzeugelektronik GmbH Otto-Schmirgal-Str. 3, 10319 Berlin, Germany Tel: +49 30 515932-237 mailto:[email protected] Fax: +49 30 515932-299 Geschäftsführer: Dr. Michael Weber, Werner Mögle; Amtsgericht Berlin Charlottenburg; HRB 130120 B; Ust.-IDNr. DE273952058
Quoted 6 lines · Khem Raj
Well one way is to have kernel headers per machine which means you can not share target packages anymore since they have to build per machine but it would be much integrated solution and we could generate the kernel headers from the kernel recipe itself so we are sure that the .config of kernel headers match the .config of kernel itself downside is it will defeat the multimachine sharing packages a bit.
The .config does not have any influence on the generated linux-libc-headers by definition. linux-libc-headers must not contain any CONFIG_* statements, because they are meant to be independent of it. The kernel config is not available to linux-libc-headers after all.
The point I was trying to make is that feature detection at compile time is impossible, if the feature can be disabled by the kernel config (which is the case for epoll and inotify, which in turn were the examples discussed on the mailing list in May 2010). You need to do runtime tests in programs intended to be portable.
Regards,
Andreas
Quoted 9 lines · Andreas Oberritter
Quoted 6 lines · Khem Raj
Well one way is to have kernel headers per machine which means you can not share target packages anymore since they have to build per machine but it would be much integrated solution and we could generate the kernel headers from the kernel recipe itself so we are sure that the .config of kernel headers match the .config of kernel itself downside is it will defeat the multimachine sharing packages a bit.
The .config does not have any influence on the generated
yes thats right
Quoted 9 lines
linux-libc-headers by definition. linux-libc-headers must not contain any CONFIG_* statements, because they are meant to be independent of it. The kernel config is not available to linux-libc-headers after all.
The point I was trying to make is that feature detection at compile time is impossible, if the feature can be disabled by the kernel config (which is the case for epoll and inotify, which in turn were the examples discussed on the mailing list in May 2010). You need to do runtime tests in programs intended to be portable.
which may not be easy to do for cross compiled packages unless they are patches to make this test dynamic
Quoted 10 lines
Regards,
Andreas_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Quoted 10 lines · Khem Raj
Quoted 5 lines · Andreas Oberritter
The point I was trying to make is that feature detection at compile time is impossible, if the feature can be disabled by the kernel config (which is the case for epoll and inotify, which in turn were the examples discussed on the mailing list in May 2010). You need to do runtime tests in programs intended to be portable.
which may not be easy to do for cross compiled packages unless they are patches to make this test dynamic
Isn't a runtime test dynamic by definition? I'm not quite sure how cross-compiling is relevant to this.
p.
Quoted 9 lines · Phil Blundell
Quoted 8 lines · Khem Raj
Quoted 5 lines · Andreas Oberritter
The point I was trying to make is that feature detection at compile time is impossible, if the feature can be disabled by the kernel config (which is the case for epoll and inotify, which in turn were the examples discussed on the mailing list in May 2010). You need to do runtime tests in programs intended to be portable.
Quoted 4 lines
Quoted 2 lines
which may not be easy to do for cross compiled packages unless they are patches to make this test dynamic
Isn't a runtime test dynamic by definition?
yes thats what I meant
I'm not quite sure how
Quoted 1 line
cross-compiling is relevant to this.
fact that we may not be able to do the runtime tests to configure a package while cross compiling is what I was thinking of
Quoted 10 lines
p.
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Quoted 18 lines · Khem Raj
Quoted 9 lines · Andreas Oberritter
Quoted 6 lines · Khem Raj
Well one way is to have kernel headers per machine which means you can not share target packages anymore since they have to build per machine but it would be much integrated solution and we could generate the kernel headers from the kernel recipe itself so we are sure that the .config of kernel headers match the .config of kernel itself downside is it will defeat the multimachine sharing packages a bit.
The .config does not have any influence on the generated
yes thats right
Quoted 4 lines
linux-libc-headers by definition. linux-libc-headers must not contain any CONFIG_* statements, because they are meant to be independent of it. The kernel config is not available to linux-libc-headers after all.
Quoted 8 lines
Quoted 5 lines
The point I was trying to make is that feature detection at compile time is impossible, if the feature can be disabled by the kernel config (which is the case for epoll and inotify, which in turn were the examples discussed on the mailing list in May 2010). You need to do runtime tests in programs intended to be portable.
which may not be easy to do for cross compiled packages unless they are patches to make this test dynamic
That doesn't make any sense. Runtime tests aren't affected by any cross compilation issues. Runtime tests are dynamic by nature.
Regards,
Andreas
Quoted 25 lines · Andreas Oberritter
Quoted 24 lines · Khem Raj
Quoted 9 lines · Andreas Oberritter
Quoted 6 lines · Khem Raj
Well one way is to have kernel headers per machine which means you can not share target packages anymore since they have to build per machine but it would be much integrated solution and we could generate the kernel headers from the kernel recipe itself so we are sure that the .config of kernel headers match the .config of kernel itself downside is it will defeat the multimachine sharing packages a bit.
The .config does not have any influence on the generated
yes thats right
Quoted 9 lines
linux-libc-headers by definition. linux-libc-headers must not contain any CONFIG_* statements, because they are meant to be independent of it. The kernel config is not available to linux-libc-headers after all.
The point I was trying to make is that feature detection at compile time is impossible, if the feature can be disabled by the kernel config (which is the case for epoll and inotify, which in turn were the examples discussed on the mailing list in May 2010). You need to do runtime tests in programs intended to be portable.
Quoted 5 lines
Quoted 2 lines
which may not be easy to do for cross compiled packages unless they are patches to make this test dynamic
That doesn't make any sense. Runtime tests aren't affected by any cross compilation issues. Runtime tests are dynamic by nature.
I think we are talking different things. I was talking about e.g. configure relying on
result of a runtime test to enable some feature during compile time
-Khem
Quoted 56 lines · Steffen Sledz
Quoted 55 lines · Andreas Oberritter
Quoted 53 lines · Steffen Sledz
Quoted 30 lines · Khem Raj
Quoted 20 lines · Steffen Sledz
Am 15.02.2011 15:50, schrieb Steffen Sledz:
Quoted 19 lines
Am 15.02.2011 15:12, schrieb Andreas Oberritter:
Quoted 9 lines · Steffen Sledz
Quoted 5 lines
"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."[2]
Isn't this what the variable
OLDEST_KERNELis good for, when compiling glibc?If i'm right this goes to the --enable-kernel=VERSION configure option of glibc just to optimize the library.
"the configure option --enable-kernel=X.Y.Z allows to strip out compatibility for kernel versions before X.Y.Z."
Imho it is not legitimately to follow that glibc has compatibility code for all kernels greater or equal X.Y.Z.
Another question is the handling in other libc implementations.
Quoted 8 lines
Quoted 1 line
And finally there are a lot of programs using userland kernel headers directly.
Ping!
If i interpret responses from Tom and Phil right they agree with me (or at least do not disagree). ;-)
But i miss reactions from the distro maintainers (especially Ångström).
Quoted 8 lines
I think we should make sure that linux version chosen for a build is equal or newer than linux-libc-headers for that build. Another option is that linux-libc-headers are driven out
of selected virtual/kernel too but this may be a bit clunky since it would mean that
every machine will have them different and we share sysroots e.g. two armv5te may use
same sysrootI like to force the discussion/work/decision on this problem because we're one of the mourners (we're forced to use 2.6.24 kernel by out hardware vendor :( ).
I also see the multi-machine problem (the shared sysroot at build time and the feed problem too).
So what options do we (our Ångström) have?
(1) Do not support kernel older than 2.6.31 (which is the current
LINUX_LIBC_HEADERS_VERSION).(2) Set
LINUX_LIBC_HEADERS_VERSIONto 2.6.16 (which is the currentOLDEST_KERNEL).(3) Support machine specific distro incarnations (incl. special feeds).
May be some more. Option (1) would be really bad for us. I believe (2) would be bad for a lot of users because of a potential loss of functionality.
Quoted 7 lines
Quoted 5 lines
I'm still not convinced that requiring older headers is a good way to go. If applications are using new syscalls directly, they need to handle ENOSYS. If the applications already contain code to be compatible across various kernel versions at compile time, then it won't be that hard to change those applications to detect available interfaces at runtime.
At first i believe that practically it is not possible for us to guarantee that all apps do this in the right way.
Sure. It's not possible to guarantee that all apps don't have severe bugs. But we can test and fix apps that are important to us.
Quoted 3 lines
But second i'm not sure if this is the only problem.
The kernel docu (what's the primary docu for me) itself says "but a program built against newer kernel headers may not work on an older kernel." (see top of this post).
That's right, because programs using compile time detection of kernel features may not work. No other issues have been brought up yet.
Quoted 1 line
This should be reason enough to avoid newer kernel headers (like all other linux distros do)!
Non-embedded linux distros have different requirements and in general they ship only one kernel version for all targets.
Btw., recently I tried to boot a rootfs built with kernel headers 2.6.18 with a 2.6.38-rc kernel. I don't know why, but it didn't work at all (running init failed). Rebuilding with kernel headers 2.6.37 allowed me to boot both kernels 2.6.18 and 2.6.38-rc.
After all it's the distro's decision which headers to use, so I won't argue for or against any policy that Angström uses. But I'm interested in actual issues faced with old kernels running binaries compiled with new headers.
Regards,
Andreas
Quoted 44 lines · Steffen Sledz
Quoted 30 lines · Khem Raj
Quoted 20 lines · Steffen Sledz
Am 15.02.2011 15:50, schrieb Steffen Sledz:
Quoted 19 lines
Am 15.02.2011 15:12, schrieb Andreas Oberritter:
Quoted 9 lines · Steffen Sledz
Quoted 5 lines
"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."[2]
Isn't this what the variable
OLDEST_KERNELis good for, when compiling glibc?If i'm right this goes to the --enable-kernel=VERSION configure option of glibc just to optimize the library.
"the configure option --enable-kernel=X.Y.Z allows to strip out compatibility for kernel versions before X.Y.Z."
Imho it is not legitimately to follow that glibc has compatibility code for all kernels greater or equal X.Y.Z.
Another question is the handling in other libc implementations.
Quoted 8 lines
Quoted 1 line
And finally there are a lot of programs using userland kernel headers directly.
Ping!
If i interpret responses from Tom and Phil right they agree with me (or at least do not disagree). ;-)
But i miss reactions from the distro maintainers (especially Ångström).
Quoted 8 lines
I think we should make sure that linux version chosen for a build is equal or newer than linux-libc-headers for that build. Another option is that linux-libc-headers are driven out
of selected virtual/kernel too but this may be a bit clunky since it would mean that
every machine will have them different and we share sysroots e.g. two armv5te may use
same sysrootI like to force the discussion/work/decision on this problem because we're one of the mourners (we're forced to use 2.6.24 kernel by out hardware vendor :( ).
I also see the multi-machine problem (the shared sysroot at build time and the feed problem too).
Quoted 7 lines
So what options do we (our Ångström) have?
(1) Do not support kernel older than 2.6.31 (which is the current
LINUX_LIBC_HEADERS_VERSION).(2) Set
LINUX_LIBC_HEADERS_VERSIONto 2.6.16 (which is the currentOLDEST_KERNEL).(3) Support machine specific distro incarnations (incl. special feeds).
I hate to state the semi-obvious but one of the problems you have now is that the distro has said that they want to stay on these more recent headers (which are required for building things which do need newer headers). So I think you need to have a (private?) discussion about how to do #3 with the least amount of headache.
Signature · 2 lines
Tom Rini Mentor Graphics Corporation
Am 25.02.2011 22:05, schrieb Tom Rini:
Quoted 66 lines · Steffen Sledz
Quoted 65 lines · Khem Raj
Quoted 40 lines
Quoted 30 lines · Steffen Sledz
Am 15.02.2011 15:50, schrieb Steffen Sledz:
Quoted 21 lines
Am 15.02.2011 15:12, schrieb Andreas Oberritter:
Quoted 10 lines · Steffen Sledz
Quoted 8 lines
"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."[2]Quoted 3 lines
Isn't this what the variable
OLDEST_KERNELis good for, when compiling
glibc?If i'm right this goes to the --enable-kernel=VERSION configure option of glibc just to optimize the library.
"the configure option --enable-kernel=X.Y.Z allows to strip out compatibility for kernel versions before X.Y.Z."
Quoted 7 lines
Imho it is not legitimately to follow that glibc has compatibility code for all kernels greater or equal X.Y.Z.
Another question is the handling in other libc implementations.
And finally there are a lot of programs using userland kernel headers directly.
Quoted 7 lines
Ping!
If i interpret responses from Tom and Phil right they agree with me (or at least do not disagree). ;-)
But i miss reactions from the distro maintainers (especially Ångström).
Quoted 8 lines
I think we should make sure that linux version chosen for a build is equal or newer than linux-libc-headers for that build. Another option is that linux-libc-headers are driven out
of selected virtual/kernel too but this may be a bit clunky since it would mean that
every machine will have them different and we share sysroots e.g. two armv5te may use
same sysrootI like to force the discussion/work/decision on this problem because we're one of the mourners (we're forced to use 2.6.24 kernel by out hardware vendor :( ).
I also see the multi-machine problem (the shared sysroot at build time and the feed problem too).
So what options do we (our Ångström) have?
(1) Do not support kernel older than 2.6.31 (which is the current
LINUX_LIBC_HEADERS_VERSION).(2) Set
LINUX_LIBC_HEADERS_VERSIONto 2.6.16 (which is the currentOLDEST_KERNEL).
Quoted 7 lines
Quoted 1 line
(3) Support machine specific distro incarnations (incl. special feeds).
I hate to state the semi-obvious but one of the problems you have now is that the distro has said that they want to stay on these more recent headers (which are required for building things which do need newer headers). So I think you need to have a (private?) discussion about how to do #3 with the least amount of headache.
I really miss a general statement from the Ångström maintainers in this discussion, something like
"We like to support as much machines as possible. So let's try if the machine and/or kernel dependend builds/feeds are a solution."
or
"We like to make a distribution with a guaranteed functionality. For that we need at least linux kernel 2.6.31 (or some other version)." (This should be documented and the try to build/use Ångström with older kernel versions should result in an error/warning.)
or
"It's not possible to fulfill all requirements with one distro. So we split it into Ångström-modern (requires 2.6.31 or newer) and Ångström-nostalgic (for older kernels)."
or something other. With such a statement it would be possible for us (and other users) to make decisions and plans for the future.
Steffen
Signature · 7 lines
DResearch Fahrzeugelektronik GmbH Otto-Schmirgal-Str. 3, 10319 Berlin, Germany Tel: +49 30 515932-237 mailto:[email protected] Fax: +49 30 515932-299 Geschäftsführer: Dr. Michael Weber, Werner Mögle; Amtsgericht Berlin Charlottenburg; HRB 130120 B; Ust.-IDNr. DE273952058
Quoted 9 lines · Andreas Oberritter
Quoted 5 lines · Steffen Sledz
"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."[2]
Isn't this what the variable
OLDEST_KERNELis good for, when compiling glibc?
Not quite, no. OLDEST_KERNEL is used to configure glibc's internal kernel compatibility code and doesn't have much to do with the headers.
Under normal circumstances, glibc will include a bunch of compatibility functions which allow the same binary to work (up to a point) on a range of kernel versions. For example, sys_pselect6 was added, on arm at least, in 2.6.32, and if glibc finds itself running on an older kernel it will fall back to using sys_select instead. However, if you configure with --enable-kernel=2.6.32 then you are promising to glibc that it will never be used on an older kernel and this compatibility logic can be omitted: you will now just get a "kernel too old" error if you try to boot on 2.6.31 or lower.
p.