fatal error: linux/compiler-gcc6.h: No such file or directory

在交叉编译i.MX6UL的Kernel代码时出现这个错误

CHK include/config/kernel.release 
Using .. as source for kernel 
GEN ./Makefile 
CHK include/generated/uapi/linux/version.h 
CHK include/generated/utsrelease.h 
make[3]: ‘include/generated/mach-types.h’ is up to date. 
CC kernel/bounds.s 
In file included from ../include/linux/compiler.h:54:0, 
from ../include/uapi/linux/stddef.h:1, 
from ../include/linux/stddef.h:4, 
from ../include/uapi/linux/posix_types.h:4, 
from ../include/uapi/linux/types.h:13, 
from ../include/linux/types.h:5, 
from ../include/linux/page-flags.h:8, 
from ../kernel/bounds.c:9: 
../include/linux/compiler-gcc.h:121:30: fatal error: linux/compiler-gcc6.h: No such file or directory 
#include gcc_header(GNUC) 

compilation terminated.

原因是因为我使用的交叉编译工具链版本太高(6.2.1版本)导致,先在内核代码根目录下搜索

[root@localhost linux-2.6.32]# find . -name "compiler-gcc*"
./include/linux/compiler-gcc.h
./include/linux/compiler-gcc3.h
./include/linux/compiler-gcc4.h
[root@localhost linux-2.6.32]#

支持的版本有3、4。
解决方案:下载 高版本内核 或者 低版本交叉编译链

猜你喜欢

转载自blog.csdn.net/whatday/article/details/88432066