Slackware This Forum is for the discussion of Slackware Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-29-2005, 09:41 AM
|
#1
|
|
Member
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 155
Rep:
|
Need clearings about kernel headers
Hi all.
I need to know which differences are between the various kernel headers distributed with kernels.
Which version I should use? I was thinking that I must use the same version of the used kernel, but by this way I have problems compiling programs.
An example: I was trying to compile chillispot.
using kernel 2.4.31 and headers 2.4.31 compiled ok;
using kernel 2.6.11.11 and headers 2.4.31 compiled ok;
using kernel 2.6.11.11 and headers 2.6.11.11 I get an error
Here you can find more details
I'm using slack updated to current, and I was using precompiled kernels from slackware ftp.
I also read the readme/warning of the 2.6 headers, but it isn't too much clear.
Can anyone explain me something more to understand why I have problems with 2.6 headers?ù
Tnx all in advance
|
|
|
|
06-29-2005, 12:03 PM
|
#2
|
|
Member
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529
Rep:
|
Quote:
|
using kernel 2.4.31 and headers 2.4.31 compiled ok;
|
This is ok. the program will work.
Quote:
|
using kernel 2.6.11.11 and headers 2.4.31 compiled ok;
|
This is not ok. the program will not work. The program does not check that the headers match the kernel, but even if it compiles, it won't run.
Quote:
|
using kernel 2.6.11.11 and headers 2.6.11.11 I get an error
|
Maybe the program is only designed for a 2.4 kernel
|
|
|
|
06-29-2005, 12:24 PM
|
#3
|
|
Member
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 155
Original Poster
Rep:
|
but the program works perfectly under 2.6.x kernels ... it interacts strongly with kernel (it creates a TUN device which is similar to a virtual net interface) and it works flawlessy ....
|
|
|
|
06-29-2005, 12:32 PM
|
#4
|
|
Senior Member
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145
Rep:
|
I may not be 100% correct about this.
99% of Linux programs use glibc ( http://www.gnu.org/software/libc/libc.html) to run, it's a C library which offers basic functions like allocating memory, opening files, etc.
The problem between different headers often arises when you compile that library with 2.4 headers, and then try to compile a program with 2.6 headers using the glibc library which was built against 2.4 headers.
I don't know exactly which code could break the program but as you can guess some functionality will be different in 2.4 and 2.6 kernels.
As Pat states in the warning file, not all code will break with different headers.
I hope I'm clear enough.
Last edited by gbonvehi; 06-29-2005 at 12:36 PM.
|
|
|
|
06-29-2005, 12:53 PM
|
#5
|
|
Member
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 155
Original Poster
Rep:
|
so probably (actual) glibc is compiled using 2.4 headers, and if I install 2.6 headers and I try to compile programs I get an error.
If I use 2.4 header (same as used to compile glibc) the conflict is resolved .. indipendently from the running kernel.
So using kernel 2.6 and headers 2.4 shouldn't be a mistake, unless libc 'becomes' compiled using 2.6 headers ..
Thanks for the clarification
|
|
|
|
06-29-2005, 01:00 PM
|
#6
|
|
Senior Member
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132
Rep:
|
Re: Need clearings about kernel headers
Quote:
Originally posted by Barx
Which version I should use? I was thinking that I must use the same version of the used kernel, but by this way I have problems compiling programs.
|
This is to be expected. Your assumption that the headers must be the same version as the running kernel is incorrect. The kernel headers must match the headers used to compile glibc. Simply put, do not upgrade the kernel headers.
Quote:
Originally posted by stefan_nicolau
quote:
using kernel 2.6.11.11 and headers 2.4.31 compiled ok;
This is not ok. the program will not work. The program does not check that the headers match the kernel, but even if it compiles, it won't run.
|
This is wrong.
Quote:
Originally posted by gbonvehi
I may not be 100% correct about this.
|
Sounds 100% correct to me. 
Last edited by shilo; 06-29-2005 at 01:56 PM.
|
|
|
|
06-29-2005, 01:00 PM
|
#7
|
|
Senior Member
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145
Rep:
|
Quote:
Originally posted by Barx
So using kernel 2.6 and headers 2.4 shouldn't be a mistake, unless libc 'becomes' compiled using 2.6 headers ..
|
Exactly
Quote:
Originally posted by Barx
Thanks for the clarification
|
No problem
Quote:
Originally posted by shilo
Sounds 100% correct to me.
|
Thanks, I wasn't sure if I was explaining it ok and my programming/guessing skills were right 
Last edited by gbonvehi; 06-29-2005 at 01:11 PM.
|
|
|
|
06-29-2005, 06:31 PM
|
#8
|
|
Member
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529
Rep:
|
Quote:
quote:Originally posted by stefan_nicolau
quote:
using kernel 2.6.11.11 and headers 2.4.31 compiled ok;
This is not ok. the program will not work. The program does not check that the headers match the kernel, but even if it compiles, it won't run.
This is wrong.
|
Sorry, I was thinking about compiling kernel modules.
|
|
|
|
06-30-2005, 02:12 AM
|
#9
|
|
Member
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 155
Original Poster
Rep:
|
Tnx all!
Last question: If I want to recompile kernel 2.6 and modules, which headers I should use? 2.4 as used to compile libc, or 2.6 as the kernel I'm compiling??
|
|
|
|
06-30-2005, 02:15 AM
|
#10
|
|
Senior Member
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145
Rep:
|
2.4 headers as libc 
|
|
|
|
06-30-2005, 11:28 AM
|
#11
|
|
Senior Member
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132
Rep:
|
 I thought that was the first question?
|
|
|
|
06-30-2005, 11:41 AM
|
#12
|
|
Member
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 155
Original Poster
Rep:
|
Quote:
Originally posted by shilo
I thought that was the first question?
|
the first question was "Can anyone explain me something more to understand why I have problems with 2.6 headers?" :-)
Now is all clear, tnx all
|
|
|
|
06-30-2005, 04:44 PM
|
#13
|
|
Zenwalk Admin
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258
Rep:
|
So how would one recompile glibc with 2.6 headers?
Sounds like the chicken or the egg.
|
|
|
|
06-30-2005, 05:55 PM
|
#14
|
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,569
|
A search tool is a wonderful thing - perhaps start here
|
|
|
|
06-30-2005, 06:48 PM
|
#15
|
|
Senior Member
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145
Rep:
|
Barx, Chinaman quoted a good part of text about why the headers should match glibc here: http://www.linuxquestions.org/questi...61#post1723561
There's also a link to the original article there.
|
|
|
|
All times are GMT -5. The time now is 06:50 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|