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.
if youre not supposed to blacklist kernel headers package (re: comment in /etc/slackpkg/blacklist) but im running the /testing 5.11.x kernel do i go ahead and run the 5.11.x headers and indeed blacklist them since im manually doing the kernel upgrades??
Medium story short, it probably doesn't matter what you do. The kernel headers have remained pretty stable for the past many years and it's unlikely that it'll matter what one you have installed. I still have the 4.4.x headers installed on my 14.2 system, but I'm running the 5.10 kernel. That's 5 years of major kernel releases from my headers to what I'm running and I've not run into a single problem tied to it.
I still hold with the mantra that headers should be older than the used kernel and be kept the same as used at glibc build time.
It seems obvious to me that newer headers could expose unsupported features when it's the other way around. Older headers mean that new features may not be available for use, but that's far less likely to break anything which gives any consideration to backward compatibility.
A common question regarding linux-headers is whether you need to keep them synced with your kernel version. The answer is no.
Quote:
Originally Posted by igadoter
You can have a newer linux-headers version then your running kernel binary.
Those are from the glibc wiki, telling which linux-headers should be used when compiling glibc. If you build glibc, use the newest linux-headers available so your glibc will be able to use the latest kernel features, if available. It does not matter which kernel you run when building glibc, and it does not matter on which kernel you will use the new glibc.
The kernel hardly gets new features for glibc when the latest number of the kernel version changes during a stable kernel version series, so kernel-headers-5.11.0 is as good as kernel-headers-5.11.14 for building glibc. But if you build glibc against kernel-headers-5.10.x, you might miss some new feature. If linux-5.11 introduced some new feature that glibc can use, and glibc is built against kernel-headers-5.11.x, the feature is available when running on kernel >= 5.11, but glibc works ok with kernel 5.10 and older, too, but without that feature.
If you are not building glibc yourself, use whatever kernel-headers.
Last edited by Petri Kaukasoina; 04-14-2021 at 05:20 AM.
I was always told that if you use a pre-built glibc (as most users do) and you want to compile other software against it, then you should always use the kernel headers against which that version of glibc was built, regardless of what kernel you are actually running. Because the build scripts might access the kernel headers directly and they should not find anything in them that might conflict with the values assumed by glibc.
Yeah, I think it's one of those in practice vs in theory, situations, but IMO best to play it safe.
In CRUX the headers are part of the glibc package itself: glibc 2.32 and headers from 5.4.72, so they're a little bit behind what Slackware current is shipping.
If I understand correctly, kernel headers is just an inclusive name for kernel source unpacked in /usr/src. So if one builds his kernels rather than relying on a kernel package by definition the proper "kernel headers" (AND "headers" actually built with the running GCC) exist. "A rose by any other name still smells as sweet".
Actually Linux kernel header for the running kernel can be found in /sys/kernel/kheaders.tar.xz. Slackware already ship it as module. You can load it using modprobe and then extract it into some dir and using it for your build.
If I understand correctly, kernel headers is just an inclusive name for kernel source unpacked in /usr/src. So if one builds his kernels rather than relying on a kernel package by definition the proper "kernel headers" (AND "headers" actually built with the running GCC) exist.
Not quite. The kernel headers are part of the source tarball. They get installed by using a make install_headers instruction. If you are just building a kernel for use (for example to take advantage of a new hardware driver) you wouldn't normally install the headers at all, only the bz image and the modules.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.