Problem running make for a basic kernel module

I dont know whether I have to ask this in stackoverflow or here but as I know my simple kernel module has no error, so make should have to work fine but it is not…

dont know why but I am getting error while running make for a simple kernel module program which just printing a log message. The error is as follows:

[monk@nitish kello]$ sudo make
make -C /lib/modules/5.8.16-200.fc32.x86_64/build M= modules
make[1]: Entering directory ‘/usr/src/kernels/5.8.16-200.fc32.x86_64’
HOSTCC scripts/sorttable
In file included from scripts/sorttable.c:191:
scripts/sorttable.h:89:10: fatal error: asm/orc_types.h: No such file or directory
89 | #include <asm/orc_types.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/ scripts/sorttable] Error 1
make[1]: *** [Makefile:1155: scripts] Error 2
make[1]: Leaving directory ‘/usr/src/kernels/5.8.16-200.fc32.x86_64’
make: *** [Makefile:4: all] Error 2

I am including the screenshot of my program here:

1 Like

Hi @monk! Please install the kernel-devel package, which includes the necessary hearders etc. required for kernel development. That should fix it.

More information on what package in the Fedora repository provides a file can be learned via dnf:

sudo dnf whatprovides '*/asm/orc_types.h'
1 Like

hi @FranciscoD, The sceenshot of the dnf whatprovides. I am attaching here. The package that are shown in whatprovides is kernel-devel and kernel-debug-devel well I tried to install it again, it show that I installed already [ I installed these in mid october], the simple kernel program that I have wrote run fine in other linux(in kali I have tried).
I have seen an article in bugzilla.redhat which does not make much sense to me I am new to linux. I tried make oldconfig && make prepare in /usr/src/kernels/$(uname -r) but that also not worked :pensive:

1 Like

The most common issue when a header cannot be found is that the compilation command does not know where to find them, so that’s the -I flag generally. So you need to see where in your compilation scripts this is set and correctly set it to point where the kernel headers are placed by the kernel-devel package.

1 Like