Errors Compiling Kernel 2.6 on Slackware 10.2 - Old kernel headers required?
SlackwareThis 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.
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.
Errors Compiling Kernel 2.6 on Slackware 10.2 - Old kernel headers required?
When compiling kernel 2.6.15 in a minimal slackware 10.2 install, the following error occurs.
I've verified all prerequisites for compilation. I've experiemented with the slackware 10.2 CD and noticed that, if I install the kernel-headers package (which says it's for kernel 2.4.31, the currently-installed kernel), the 2.6 kernel compiles without any errors whatsoever.
Am I wrong in saying that a 2.6 kernel should NOT need a previous kernel's headers?
-Dave
-----------
CHK include/linux/version.h
HOSTCC scripts/basic/fixdep
In file included from /usr/include/bits/posix1_lim.h:153,
from /usr/include/limits.h:144,
from /usr/lib/gcc/i486-slackware-linux/3.4.4/include/limits.h:122,
from /usr/lib/gcc/i486-slackware-linux/3.4.4/include/syslimits.h:7,
from /usr/lib/gcc/i486-slackware-linux/3.4.4/include/limits.h:11,
from scripts/basic/fixdep.c:113:
/usr/include/bits/local_lim.h:36:26: linux/limits.h: No such file or directory
In file included from /usr/include/sys/socket.h:35,
from /usr/include/netinet/in.h:24,
from /usr/include/arpa/inet.h:23,
from scripts/basic/fixdep.c:115:
/usr/include/bits/socket.h:304:24: asm/socket.h: No such file or directory
scripts/basic/fixdep.c: In function `use_config':
scripts/basic/fixdep.c:201: error: `PATH_MAX' undeclared (first use in this function)
scripts/basic/fixdep.c:201: error: (Each undeclared identifier is reported only once
scripts/basic/fixdep.c:201: error: for each function it appears in.)
scripts/basic/fixdep.c:201: warning: unused variable `s'
scripts/basic/fixdep.c: In function `parse_dep_file':
scripts/basic/fixdep.c:297: error: `PATH_MAX' undeclared (first use in this function)
scripts/basic/fixdep.c:297: warning: unused variable `s'
make[2]: *** [scripts/basic/fixdep] Error 1
make[1]: *** [scripts_basic] Error 2
make: *** [include/linux/autoconf.h] Error 2
Installing SW10.2 test26.s kernel require 2.6.13 kernel modules but 2.4.3x kernel-headers. So it makes sense to keep same kernel-headers package when compiling newer 2.6x kernel. I would check SW current changelogs for any changes regarding kernel-headers because current uses 2.6.14x and 2.6.15x testing kernels.
Pat explains it in changelog for SW10.2 with regards to testing26.s install kernel(2.6.13). I just obey eventhough a part of my brain wants to keep headers and kernel versions the same.
This package of 2.6.x based /usr/include/linux and /usr/include/asm headers
is being provided by request for some people who need it in order to compile
ASDL modem drivers for 2.6.x. As a general rule, installing kernel headers
that are newer than the kernel glibc was compiled with *may* cause problems,
so unless you need these for a particular reason it's best to stick with the
2.4.x kernel-headers package for now.
Note -- if you compile with NPTL then you might want to use these headers,
and glibc's NPTL was compiled using 2.6 headers, so all should be well.
In that case, specify using NPTL libs and headers with these compile
options:
Okay - thanks. One more question - why would a full kernel source actually need any kernel headers other than what comes in from kernel.org?
because the version of the headers from kernel.org might be different than the version of the headers your glibc was compiled against...
allow me to quote Linus Torvalds:
Quote:
The fact is, that the header files should match the library you link
against, not the kernel you run on.
Think about it a bit.. Imagine that the kernel introduces a new "struct
X", and maintains binary backwards compatibility by having an old system
call in the old place that gets passed a pointer to "struct old_X".
It's all compatible, because binaries compiled for the old kernel will
still continue to run - they'll use the same old interfaces they are
still used to, and they obviously do not know about the new ones.
Now, if you start mixing a new kernel header file with an old binary
"glibc", you get into trouble. The new kernel header file will use the
_new_ "struct X", because it will assume that anybody compiling against
it is after the new-and-improved interfaces that the new kernel
provides.
But then you link that program (with the new "struct X") to the binary
library object archives that were compiled with the old header files,
that use the old "struct old_X" (which _used_ to be X), and that use the
old system call entry-points that have the compatibility stuff to take
"struct old_X".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.