LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-29-2008, 02:47 AM   #1
grosjo
LQ Newbie
 
Registered: Jul 2004
Posts: 5

Rep: Reputation: 0
Building 2.6.28 on x86


Hello

Since asm-x86 has disappeared from the kernel, how to build 2.6.28 on a x86 platform ?
(i.e. make menuconfig complains about missing asm/socket.h for instance)

Thanks

Joan
 
Old 12-29-2008, 06:30 AM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Hi.

It's looking for /usr/include/asm/socket.h which is part of the glibc Linux headers. Make sure you've got the linux-kernel-headers or kernel-headers package installed on your system.

Dave
 
Old 12-29-2008, 07:16 AM   #3
grosjo
LQ Newbie
 
Registered: Jul 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Well, I unbzipped the original file from kernel.org to /usr/src/linux and so far (i.e. with any previous kernels) I have symlinked /usr/include/asm to /usr/src/linux/include/asm-x86 which worked fine.

So, do you mean that I need to recompile glibc as well ?

Quote:
Originally Posted by ilikejam View Post
Hi.

It's looking for /usr/include/asm/socket.h which is part of the glibc Linux headers. Make sure you've got the linux-kernel-headers or kernel-headers package installed on your system.

Dave
 
Old 12-29-2008, 07:26 AM   #4
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
The glibc headers and the kernel headers aren't necessarily the same. Just remove the symlinks, and install the kernel-headers package and all should be well.

See 6.11.3 in this page:
http://www.faqs.org/docs/linux_scrat...06/kernel.html

Dave

Last edited by ilikejam; 12-29-2008 at 07:32 AM.
 
Old 12-29-2008, 07:42 AM   #5
grosjo
LQ Newbie
 
Registered: Jul 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Sorry , I do not understand:
asm/xxx.h comes from kernel.org, why should I replace the correct headers file of the kernel with anything not related to it ?

What do you mean by "kernel-headers" packahge ? is it 2.6.28 bz2 file ?

Quote:
Originally Posted by ilikejam View Post
The glibc headers and the kernel headers aren't necessarily the same. Just remove the symlinks, and install the kernel-headers package and all should be well.

See 6.11.3 in this page:
http://www.faqs.org/docs/linux_scrat...06/kernel.html

Dave
 
Old 12-29-2008, 08:44 AM   #6
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Your copy of glibc was compiled against a certain set of Linux kernel headers. These headers should not be changed unless your compiled version of glibc changes, and it's these headers which should be in /usr/include . The kernel source is completely separate from these headers (unless you're compiling glibc yourself, in which case you may as well use the current kernel headers for this purpose). Basically, the stuff in /usr/include should match your glibc version, not the particular kernel version you happen to be running. To quote Linus:
Quote:
And yes, this is what I do. My /usr/src/linux still has the old 2.2.13
header files, even though I haven't run a 2.2.13 kernel in a _loong_
time. But those headers were what glibc was compiled against, so those
headers are what matches the library object files.
'make menuconfig' attempts to compile the menuconfig system if it's not already been compiled, which requires glibc's version of the kernel headers to be in place (since it's compiling against glibc), and it's at this point that gcc gives up. Actually compiling the kernel itself doesn't need the /usr/include files, but the compile of 'menuconfig' does.

Dave

Last edited by ilikejam; 12-29-2008 at 08:45 AM.
 
Old 12-29-2008, 08:52 AM   #7
grosjo
LQ Newbie
 
Registered: Jul 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Thank you very much for this clear answer.

Quote:
Originally Posted by ilikejam View Post
Your copy of glibc was compiled against a certain set of Linux kernel headers. These headers should not be changed unless your compiled version of glibc changes, and it's these headers which should be in /usr/include . The kernel source is completely separate from these headers (unless you're compiling glibc yourself, in which case you may as well use the current kernel headers for this purpose). Basically, the stuff in /usr/include should match your glibc version, not the particular kernel version you happen to be running. To quote Linus:

'make menuconfig' attempts to compile the menuconfig system if it's not already been compiled, which requires glibc's version of the kernel headers to be in place (since it's compiling against glibc), and it's at this point that gcc gives up. Actually compiling the kernel itself doesn't need the /usr/include files, but the compile of 'menuconfig' does.

Dave
 
Old 12-31-2008, 09:43 PM   #8
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 774

Rep: Reputation: 243Reputation: 243Reputation: 243
People that followed the old "symlink-to-usr-from-kernel" style will have this trouble starting with 2.6.28. See the glibc INSTALL file about /usr/include/asm,linux issues (around like 388 in glibc-2.7). Actually, the old asm headers have been moved in 2.6.28. They're now under /usr/src/linux-2.6.28/arch/x86/include/asm instead of /usr/src/linux/include/asm-x86. Somewhere I saw people doing compatibility symlinking between those two (maybe a Gentoo forum?) but I don't know if that is proper or not. This kernel boots way slow. Very odd.
 
  


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
Need help building x86_64 Cross compiler on x86 linux (Red Hat) torque_dwf Linux - Software 4 01-08-2009 03:37 AM
Building 2.6.28 on a x86 grosjo Linux - Newbie 1 12-29-2008 07:37 AM
[SOLVED] Having problem building/installing Sendmail 8.14.2 by using Solaris 8 x86 johncsl82 Solaris / OpenSolaris 7 07-08-2008 01:48 AM
Building a JumpStart server - x86 mxxx Solaris / OpenSolaris 2 04-19-2007 11:45 AM
Boot x86 target from flash, with the image and file system on the x86 host. batsayan Linux - Software 2 08-23-2005 12:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:02 PM.

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
Open Source Consulting | Domain Registration