解决 Linux系统上驱动交叉编译时出现:
include/uapi/linux/types.h:5:10: fatal error: asm/types.h: No such file or directory
内核版本:5.4.47
解决方案:对比内核版本4.1.35版本发现,在内核顶层的Makefile的LINUXINCLUDE宏中少加入了-I$(objtree)/arch/$(SRCARCH)/include/generated/uapi路径,加入后编译正常。
| # Use LINUXINCLUDE when you must reference the include/ directory. # Needed to be compatible with the O= option LINUXINCLUDE := \ -I$(srctree)/arch/$(SRCARCH)/include \ -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \ -I$(objtree)/arch/$(SRCARCH)/include/generated \ $(if $(building_out_of_srctree),-I$(srctree)/include) \ -I$(objtree)/include \ $(USERINCLUDE) |
本文介绍了解决Linux系统上驱动交叉编译时遇到的一个常见问题:include/uapi/linux/types.h文件引用了不存在的asm/types.h文件。通过对比不同内核版本的Makefile,发现了缺少必要的路径设置,并给出了具体的解决方案。
2824

被折叠的 条评论
为什么被折叠?



