You are not logged in.

#1 2020-05-14 09:54:58

lv
Member
Registered: 2014-10-18
Posts: 5

[SOLVED] kernel-headers: LINUX_VERSION_CODE seems wrong

I'm trying to compile an utility and it complained about the version of my linux headers.

checking for linux/version.h... yes
configure: error: "libgpiod needs linux headers version >= v5.5.0"

This seemed very odd because I'm sure I have kernel 5.6.11 with the respective headers installed, but I double-checked anyway with pacman.

$ pacman -Ss linux-headers
core/linux-headers 5.6.11.arch1-1 [installed]
    Headers and scripts for building modules for the Linux kernel

After that I reinstalled the linux-headers package and rebooted my machine to make sure everything correct, but the utility complained again. I looked at the version check and it does this:

AC_COMPILE_IFELSE([AC_LANG_SOURCE(
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
#error
#endif
)],
[], [AC_MSG_ERROR(["libgpiod needs linux headers version >= v5.5.0"])])

So I started looking at the version.h file.

$ cat /usr/include/linux/version.h
#define LINUX_VERSION_CODE 328721
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
$ python
Python 3.8.2 (default, Apr  8 2020, 14:31:25) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> (328721 >> 16) & 0xff
5
>>> (328721 >> 8) & 0xff
4
>>> (328721 >> 0) & 0xff
17
>>>

I have no clue how this could happen, but my linux/version.h file tells me it's 5.4.17 even though I'm sure 5.6.11 is installed. Does someone have a hint why this could happen?

Last edited by lv (2020-05-14 11:27:13)

Offline

#2 2020-05-14 10:03:15

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 10,003

Re: [SOLVED] kernel-headers: LINUX_VERSION_CODE seems wrong

That comes from the linux-api-headers not the linux-headers package. They are not really expected to be used directly by most userspace software and do as far as I know not receive bumps that often, but in any case that package seems to have been bumped today, update your system again.

Last edited by V1del (2020-05-14 10:07:33)

Offline

#3 2020-05-14 11:26:40

lv
Member
Registered: 2014-10-18
Posts: 5

Re: [SOLVED] kernel-headers: LINUX_VERSION_CODE seems wrong

Thanks, I didn't knew that. Funny coincidence that it was updated just minutes after I discovered it.

Offline

Board footer

Powered by FluxBB