I recompiled my Raspberry Pi's Linux Kernel to enable some debug features. The new kernel is compiled on my X86 desktop PC by the tools that are supplied by https://github.com/raspberrypi/tools. The new kernel seems working fine until that I compile my hello-world
driver module on it, and the info below is printed:
make -C /lib/modules/3.18.10-d0u9/build M=/home/pi/Linux-Device-Driver-3.18/1_Hello-World modules
make[1]: Entering directory '/usr/src/linux-source-3.18'
CC [M] /home/pi/Linux-Device-Driver-3.18/1_Hello-World/main.o
./scripts/recordmcount: 1: ./scripts/recordmcount: Syntax error: "(" unexpected
scripts/Makefile.build:257: recipe for target '/home/pi/Linux-Device-Driver-3.18/1_Hello-World/main.o' failed
make[2]: *** [/home/pi/Linux-Device-Driver-3.18/1_Hello-World/main.o] Error 2
Makefile:1398: recipe for target '_module_/home/pi/Linux-Device-Driver-3.18/1_Hello-World' failed
make[1]: *** [_module_/home/pi/Linux-Device-Driver-3.18/1_Hello-World] Error 2
make[1]: Leaving directory '/usr/src/linux-source-3.18'
Makefile:19: recipe for target 'modules' failed
make: *** [modules] Error 2
The hello-world
module is fairly simple, and it is compiled correctly on my X86 PC.
I think that maybe the way I compile Linux Kernel is wrong...
Has any one meet this problem?
BTW, how to correctly cross-compile kernel for raspberry Pi for driver development?