LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-29-2005, 09:41 AM   #1
Barx
Member
 
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 155

Rep: Reputation: 26
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
 
Old 06-29-2005, 12:03 PM   #2
stefan_nicolau
Member
 
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529

Rep: Reputation: 32
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
 
Old 06-29-2005, 12:24 PM   #3
Barx
Member
 
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 155

Original Poster
Rep: Reputation: 26
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 ....
 
Old 06-29-2005, 12:32 PM   #4
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
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.
 
Old 06-29-2005, 12:53 PM   #5
Barx
Member
 
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 155

Original Poster
Rep: Reputation: 26
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
 
Old 06-29-2005, 01:00 PM   #6
shilo
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: Reputation: 50
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.
 
Old 06-29-2005, 01:00 PM   #7
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
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.
 
Old 06-29-2005, 06:31 PM   #8
stefan_nicolau
Member
 
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529

Rep: Reputation: 32
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.
 
Old 06-30-2005, 02:12 AM   #9
Barx
Member
 
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 155

Original Poster
Rep: Reputation: 26
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??
 
Old 06-30-2005, 02:15 AM   #10
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
2.4 headers as libc
 
Old 06-30-2005, 11:28 AM   #11
shilo
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: Reputation: 50
Quote:
Last question:
I thought that was the first question?
 
Old 06-30-2005, 11:41 AM   #12
Barx
Member
 
Registered: Jun 2004
Location: Italy
Distribution: Slack x64 current
Posts: 155

Original Poster
Rep: Reputation: 26
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
 
Old 06-30-2005, 04:44 PM   #13
AxXium
Zenwalk Admin
 
Registered: May 2005
Location: Louisiana, U.S.A.
Distribution: Zenwalk Gnu/Linux
Posts: 258

Rep: Reputation: 31
So how would one recompile glibc with 2.6 headers?

Sounds like the chicken or the egg.
 
Old 06-30-2005, 05:55 PM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,569

Rep: Reputation: 4268Reputation: 4268Reputation: 4268Reputation: 4268Reputation: 4268Reputation: 4268Reputation: 4268Reputation: 4268Reputation: 4268Reputation: 4268Reputation: 4268
A search tool is a wonderful thing - perhaps start here
 
Old 06-30-2005, 06:48 PM   #15
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
trying to find/install kernel-source or kernel-headers timsch75 Slackware 3 10-22-2005 09:17 AM
Difference between kernel-headers kernel-source twinkers Debian 2 06-18-2005 11:20 AM
2.6.11.6 Kernel Headers Jesterace Slackware 4 03-28-2005 11:33 AM
send packets with kernel routing and without kernel messing with headers bassdemon Programming 5 02-08-2005 06:29 PM
Kernel headers mmm Linux - General 3 07-13-2003 03:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:50 PM.

Contact Us - Advertising Info - Rules - Privacy - Donations - Contributing Member - LQ Sitemap - "Weather apps tell you it'll rain. Wyndo tells you when to go."
Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions