Linux/errno.h: No such file or directory when building kernel for Debian 13

Hi all,
I have troubles building kernel 7.1 for Debian 13 on OBS: I get the below error:

[  514s] /usr/bin/make -f /usr/src/packages/BUILD/scripts/Makefile.build obj=scripts scripts/unifdef
[  514s] # HOSTCC  scripts/unifdef
[  514s]   gcc -Wp,-MMD,scripts/.unifdef.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu11   -I /usr/src/packages/BUILD/scripts/include   -I scripts   -o scripts/unifdef /usr/src/packages/BUILD/scripts/unifdef.c   
[  514s] In file included from /usr/include/errno.h:28,
[  514s]                  from /usr/src/packages/BUILD/scripts/unifdef.c:51:
[  514s] /usr/include/x86_64-linux-gnu/bits/errno.h:26:11: fatal error: linux/errno.h: No such file or directory

I’m however able to build the same source package on my machine using sbuild in unshare mode.

Any ideas what I am missing?

The OBS package link: https://build.opensuse.org/package/show/home:morgwai:tbfive-kernel/7.1-tbfive1
The full build output: https://build.opensuse.org/build/home:morgwai:tbfive-kernel/Debian_13/x86_64/7.1-tbfive1/_log

I’ve found a few posts regarding similar errors, but when building other packages like gcc: the remedy used there was to install additionally linux-libc-dev package, however this does not seems like a good solution for kernel, as it is supposed to provide these headers itself…

Thanks!

I’m confused (probably an age thing) …
Why are you “building kernel 7.1 for Debian 13” on openSUSE??
What does a Debian kernel have to do with openSUSE ??

OBS offers the option to build for other distros. And has been doing so for years.

2 Likes

I’ve just verified that Debian’s buildd image variant (used by sbuild by default) does indeed contain linux-libc-dev, so it seems it may be a Debian kernel build script bug covered by the typical setup of Debian’s build infra, now exposed by OBS.
I’ll try adding linux-libc-dev and will report back.

I’ve added Required: linux-libc-dev to my project config, which if I understand the manual correctly, is supposed to trigger a rebuild, but nothing happened. So I’ve triggered a rebuild manually and got the same error :confused:
Additionally I’ve noticed logs like this:

[   44s] [300/527] installing libc6-dev-2.41-12+deb13u3
[   44s] dpkg: libc6-dev:amd64: dependency problems, but configuring anyway as you requested:
[   44s]  libc6-dev:amd64 depends on linux-libc-dev; however:
[   44s]   Package linux-libc-dev is not installed.

Am I doing it wrong? What’s the proper way to add an additional package to the build environment?

Apparently a known bug since 2019:

Still, it should at least work after a manual trigger… :frowning: Not sure what to do now… :confused:

Try to use Keep: linux-libc-dev in the project config.

According to the manual:

Keep: PACKAGES
To eliminate build cycles the to-be-built package are not installed by default, even when it is required. Keep can be used to overwrite this behavior. It is usually needed for packages like make that are used to build itself. Preinstalled packages are automatically kept, as the package installation program needs to work all the time.

linux-libc-dev is built from this source package, so it’s not installed even when being Required.

1 Like

This has worked! :))) Thank you so much!!

I’ve updated the bug report and also have added this trick to the Debian OBS wiki.

For future readers:
Per this comment, Keep: is obsolete, so I’ve filed https://github.com/openSUSE/open-build-service/issues/19830

If Keep is gone in a future version, we still have Preinstall.
But yes, it’s just a hack, better to declare in Build-Depends.

As mentioned in the comments, it is a transitive dep of packages declared in Build-Depends:. That’s why I filed this new 19830 :wink:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.