内核模块编译错误

内核模块编译错误

每当我尝试编译模块时都会出现以下错误:

sudo make

make -C /lib/modules/5.3.0-45-generic/build -I m=/home/shakti/Drivers/hello_param modules
make[1]: Entering directory '/usr/src/linux-headers-5.3.0-45-generic'
make[2]: *** No rule to make target 'arch/x86/tools/relocs_32.c', needed by 'arch/x86/tools/relocs_32.o'.  Stop.
arch/x86/Makefile:232: recipe for target 'archscripts' failed
make[1]: *** [archscripts] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.3.0-45-generic'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2

请帮帮我。我已经尝试了很多方法。

答案1

所需的 i386 标头:

sudo apt-get install linux-headers-*(kernel version)*:i386

例子:

sudo apt-get install linux-headers-5.4.0-42:i386

相关内容