linux-kernel – `. scriptsrecordmcount:语法错误:“(我在Raspberry Pi上编译驱动程序模块时报告了”unexpected`)

linux-kernel – `. scriptsrecordmcount:语法错误:“(我在Raspberry Pi上编译驱动程序模块时报告了”unexpected`),第1张

概述我重新编译了我的Raspberry Pi的 Linux内核以启用一些调试功能.新内核是在我的X86台式机上通过 https://github.com/raspberrypi/tools提供的工具编译的.新内核似乎工作正常,直到我编译我的hello-world驱动程序模块,并打印下面的信息: make -C /lib/modules/3.18.10-d0u9/build M=/home/pi/Lin 我重新编译了我的RaspBerry Pi的 Linux内核以启用一些调试功能.新内核是在我的X86台式机上通过 https://github.com/raspberrypi/tools提供的工具编译的.新内核似乎工作正常,直到我编译我的hello-world驱动程序模块,并打印下面的信息:

make -C /lib/modules/3.18.10-d0u9/build M=/home/pi/linux-Device-Driver-3.18/1_Hello-World modulesmake[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: "(" unexpectedscripts/Makefile.build:257: recipe for target '/home/pi/linux-Device-Driver-3.18/1_Hello-World/main.o' Failedmake[2]: *** [/home/pi/linux-Device-Driver-3.18/1_Hello-World/main.o] Error 2Makefile:1398: recipe for target '_module_/home/pi/linux-Device-Driver-3.18/1_Hello-World' Failedmake[1]: *** [_module_/home/pi/linux-Device-Driver-3.18/1_Hello-World] Error 2make[1]: Leaving directory '/usr/src/linux-source-3.18'Makefile:19: recipe for target 'modules' Failedmake: *** [modules] Error 2

hello-world模块非常简单,可以在我的X86 PC上正确编译.

我想也许我编译linux内核的方式是错误的…

有没有人遇到这个问题?

顺便说一句,如何正确交叉编译内核for raspBerry Pi进行驱动程序开发?

解决方法 在不知道有关重新编译的内核版本,os版本等的更多细节的情况下,很难确定究竟发生了什么.

根据个人经验,安装Raspbian是一种更加宽容的方式来让事情在pi上运行.使Debian工作的“足够Debian”与大多数linux环境有些相似.

Sparkfun在installing Raspbian有一个很好的指南,Raspbian网站上有很多文档,似乎是一个非常活跃的社区.抱歉,我没有更多的帮助,但没有关于如何重新编译内核,启用了哪些调试功能等的更多详细信息,很难对解决方案更具体.

总结

以上是内存溢出为你收集整理的linux-kernel – `./ scripts / recordmcount:语法错误:“(我在Raspberry Pi上编译驱动程序模块时报告了”unexpected`)全部内容,希望文章能够帮你解决linux-kernel – `./ scripts / recordmcount:语法错误:“(我在Raspberry Pi上编译驱动程序模块时报告了”unexpected`)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/1030787.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存