加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux-kernel – `./ scripts / recordmcount:语法错误:“(我

发布时间:2020-12-14 01:55:44 所属栏目:Linux 来源:网络整理
导读:我重新编译了我的Raspberry Pi的 Linux内核以启用一些调试功能.新内核是在我的X86台式机上通过 https://github.com/raspberrypi/tools提供的工具编译的.新内核似乎工作正常,直到我编译我的hello-world驱动程序模块,并打印下面的信息: make -C /lib/modules/
我重新编译了我的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 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内核的方式是错误的…

有没有人遇到这个问题?

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

解决方法

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

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读