linux - 在 linux compile 中错过 asm/types.h
问题描述
lenge@lenge-pc:/lenge/linux/kernel_online$ git branch
master
* tag_v4.15
CONFIG is defconfig.
编译kernel(v4.15)
时出现错误,如下:
在包含的文件中
/lenge/linux/kernel_online/include/linux/types.h:6,
from /lenge/linux/kernel_online/include/linux/page-flags.h:9,
from /lenge/linux/kernel_online/kernel/bounds.c:10:
/lenge/linux/kernel_online/include/uapi/linux/types.h:5:10: fatal
error: asm/types.h: No such file or directory #include <asm/types.h>
^~~~~~~~~~~~~ compilation terminated.
那是我的编译方法:
make ARCH=arm64 -C /lenge/linux/kernel_online O=/lenge/linux/kernel_out_aarch64 CROSS_COMPILE=/lenge/gnu/aarch64/bin/aarch64-lenge-linux-gnu- -j4
我创建符号链接作为休闲:
ln -s /lenge/linux/kernel_out_aarch64/source/arch/arm64/include/generated/uapi/asm arch/arm64/include/generated/uapi/asm
没关系。
解决方案
我只是在交叉编译到 arm64 时遇到了同样的问题。
我注意到我的源代码树中有一些生成的文件,即使我使用输出目录进行构建 (O=)。我不确定我是否不小心遗漏了 O= 一次或发生了什么,但这把事情搞砸了。
为了解决这个问题,我在源目录中运行了 make clean (或者如果你是偏执狂,则使用 make mrproper)来删除所有生成的文件。使用 O= 重新运行我的正常 make 命令成功,并且没有导致在我的源目录中生成文件(如预期的那样)。
推荐阅读
- javascript - 编程排序功能在制表器中不起作用
- spring - 将 Spring Security 添加到 Spring Boot 应用程序后找不到请求属性
- swift - Swift 5.1 我可以在另一个视图控制器中访问结构实例声明吗?
- maven - Maven项目无法解析pom
- javascript - 关闭 HTML5 视频播放器的替代方法
- sql - Node.js 加载资源失败
- javascript - 有条件地向打印视图中的数据表行添加样式
- fortran - 函数声明警告:函数“f”在 (1) 处的返回值未设置 [-Wreturn-type]
- python - Python TK 库水平滚动条未显示
- amazon-web-services - 从 EC2 实例以编程方式确定可用区