LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (http://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Problem compiling kernel on Slackware (http://www.linuxquestions.org/questions/linux-kernel-70/problem-compiling-kernel-on-slackware-4175456190/)

usr345 03-30-2013 05:14 PM

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?

fotoguy 03-31-2013 02:58 AM

/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

usr345 03-31-2013 03:15 AM

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.

fotoguy 03-31-2013 05:55 AM

Quote:

Originally Posted by usr345 (Post 4922001)
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.

usr345 03-31-2013 07:31 PM

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.

usr345 03-31-2013 07:50 PM

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

http://alien.slackbook.org/dokuwiki/...eaders_package

fotoguy 04-01-2013 01:21 AM

Quote:

Originally Posted by usr345 (Post 4922352)
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.


All times are GMT -5. The time now is 02:00 AM.