我重新编译了我的Raspberry Pi的Linux内核以启用一些调试功能,新内核编译在我的X86桌面通过由https://github.com/raspberrypi/tools提供的工具,PC的新的内核似乎工作正常,直到我编译我hello-world
驱动模块就可以了,下面的信息被打印:`./scripts/recordmcount:Syntax error:“(”unexpected“会在Raspberry Pi上编译驱动程序模块时报告
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
的hello-world
模块是相当简单,它在我的X86 PC上正确编译。
我想这也许是我的方式堆Linux内核错了...
有没有人遇到这个问题?
顺便说一句,如何正确交叉编译内核的树莓派为驱动程序开发?
如果你尝试在脚本文件夹中“make recordmcount”,你会得到一个错误吗? – ikstream