LinuxQuestions.org
Help answer threads with 0 replies.
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 03-30-2013, 04:14 PM   #1
usr345
Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 208
Blog Entries: 1

Rep: Reputation: Disabled
Problem compiling kernel on Slackware


I use Slackware 14.0. Trying to remove unnecessary files I uninstalled kernel-src package. I already had the source, cloned from git. But after I removed it, seems, that standard Include directories, pointing to /usr/src/linux were corrupted. And now I can't run make menuconfig to compile the new kernel:

Quote:
# make menuconfig
HOSTCC scripts/basic/fixdep
In file included from /usr/include/sys/socket.h:40:0,
from /usr/include/netinet/in.h:25,
from /usr/include/arpa/inet.h:23,
from scripts/basic/fixdep.c:116:
/usr/include/bits/socket.h:384:24: fatal error: asm/socket.h: No such file or directory
How to restore C_INCLUDE_PATH variable, so the compiler could find the include files from kernel source?
 
Old 03-31-2013, 01:58 AM   #2
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
/usr/src/linux will symlink to your default kernel, if you remove kernel-src (/usr/src/linux-$YOUR-KERNEL-VERSION) then you have removed the kernel it was pointing too, just remake the symlink to your new downloaded source.

from the console as root or sudo:

rm -rf /usr/src/linux
ln -s /new/source/location/linux-$VERSION /usr/src/linux
 
Old 03-31-2013, 02:15 AM   #3
usr345
Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 208

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
No, man. I have put the source directly into /usr/src/linux without a symlink. And is getting the error. It's something with Include directories for gcc.
 
Old 03-31-2013, 04:55 AM   #4
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Quote:
Originally Posted by usr345 View Post
No, man. I have put the source directly into /usr/src/linux without a symlink. And is getting the error. It's something with Include directories for gcc.
ok you don't put the source file into the /usr/src/linux directory, this is always a symlink to you kernel source, your include files are located in /usr/src/linux-your-version/include. gcc defaults to look in /usr/src/linux/include for the include files, this is why you always symlink it to what ever kernel your are using.
 
Old 03-31-2013, 06:31 PM   #5
usr345
Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 208

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
I did, what you suggested. But still have the same error. I think, that default gcc directories are not including /usr/src/linux. And that's the cause.
 
Old 03-31-2013, 06:50 PM   #6
usr345
Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 208

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
I fixed it, installing kernel-headers package. Here are the helpful docs:

http://alien.slackbook.org/dokuwiki/...eaders_package
 
Old 04-01-2013, 12:21 AM   #7
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Quote:
Originally Posted by usr345 View Post
I fixed it, installing kernel-headers package. Here are the helpful docs:

http://alien.slackbook.org/dokuwiki/...eaders_package
Ok if installing the kernel-header packages worked, then removing kernel-source may have remove the original header files, which are found in /usr/include directory, these are the includes that are built against the original gcc version shipped with slackware 14, that would have been my next suggestion should you still have trouble, glad it's all working now.
 
  


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
Re-compiling the Slackware kernel bogzab Slackware 12 04-10-2008 05:53 PM
slackware 10.2: compiling the kernel? sharathg786 Slackware 2 07-31-2006 08:14 AM
Errors Compiling Kernel 2.6 on Slackware 10.2 - Old kernel headers required? Dave S. Slackware 8 03-04-2006 12:15 AM
Compiling new kernel with Slackware 10 madhatter2 Linux - Newbie 2 07-29-2004 04:08 PM
Compiling kernel 2.6.4 on Slackware 9.1 ProtoformX Linux - General 1 03-13-2004 10:41 AM

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

All times are GMT -5. The time now is 07:30 AM.

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