Make No rule to make target ‘tools/objtool/objtool‘

写在前面

转载链接:
[1] baixvkwfn. Make No rule to make target ‘tools/objtool/objtool’ [EB/OL]. https://blog.csdn.net/baixvkwfn/article/details/99537599/, 2019-08-14/20220315.

原文

编译一版Ubuntu 18.04.1 自定内核4.19.8-768-amd+下的PL2303GC驱动,提示No rule to make target ‘tools/objtool/objtool’。因为系统是其它部门提供的,也没去研究就直接在网上找解决方式,发现有两种, 但都不能解决我的问题。
网1. 从网上找到答案,先尝试make CONFIG_STACK_VALIDATION= 能编译出.o文 件,但会出其它错误:
Bus error (core dumped)
scripts/Makefile.modpost:92: recipe for target ‘__modpost’ failed.
网2. 在使用标准内核4.19.8下编译,一切顺利,但编译出来的驱动ko不能在当前使用的内核下加载,所以这种方法还是不可行,但给出了最终解决的思路。
适合我的最终解决:

  1. 比较发现自定内核的头文件目录/tools/objtool/下只有Makefile, 没有其它工具。
    cp /usr/src/linux-header-4.19.8/tools/objtool/* /usr/src/linux-header-4.19.8-768-amd+/tools/objtool/
  2. 编译出.o文件,但还是会提示网1一样的错误,并且系统提示/usr/src/linux-headers-4.19.8-768-amd+/scripts/mod/modpost 异常。考虑到标准内核能编译,所以比较两个modpost文件,发现自定内核的是自行编译,单独执行此modpost,同样给出Bus error (core dumped)。所以替换此文件。
    cp /usr/src/linux-header-4.19.8/scripts/mod/modpost /usr/src/linux-header-4.19.8-768-amd+/scripts/mod/modpost
    3.再次编译,一切正常。
  更新:
  如果出现CONFIG_X86_X32 Enabled but on binutils support, 必须检查源文件路径中是否出现空格
  如果出现Warning message: Clock skew detected. Yourbuild may be incomplete. 其原因是,当前系统的时间还在编译目录中的文件(包括源程序文件和编译后生成的.o目标文件)最后修改时间之前。
  解决:find . -type f | xargs -n 5 touch

转载链接:
[1] baixvkwfn. Make No rule to make target ‘tools/objtool/objtool’ [EB/OL]. https://blog.csdn.net/baixvkwfn/article/details/99537599/, 2019-08-14/20220315.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值