'Showing error while making the code in kernel

I was trying to run hello world program in kernel but I'm getting this error when i make the code.

xx@xx-VirtualBox:~/Modules$ sudo make
[sudo] password for xx: 
make -C /lib/modules/5.8.0-41-generic/build SUBDIRS=/home/xx/Modules modules
make[1]: Entering directory '/usr/src/linux-headers-5.8.0-41-generic'
make[2]: *** No rule to make target 'arch/x86/tools/relocs_32.c', needed by 'arch/x86/tool/relocs_32.o'.  Stop.
make[1]: *** [arch/x86/Makefile:211: archscripts] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.8.0-41-generic'
make: *** [Makefile:7: all] Error 2
xx@xx-VirtualBox:~/


Solution 1:[1]

Can you please show your code and make file? It's always better for others to help you when asking problems.

As for your circumstance, your make file has something wrong as the result says

make: *** [Makefile:7: all] Error 2

I guess maybe you can change SUBDIRS=$(PWD) into M=$(shell pwd), I google and find some one solve the problem by that. If you can show your code, we can see the detail problem.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 tyChen