u-boot-2012.04.01编译问题5:linux/compiler-gcc6.h: No such file or directory

编译uboot时遇到问题:/home/book/test/u-boot-2012.04.01/include/linux/compiler-gcc.h:87:30: fatal error: linux/compiler-gcc6.h: No such file or directory
 #include gcc_header(__GNUC__)

搜索compiler-gcc*

~/test/u-boot-2012.04.01$ find -name compiler-gcc*
./include/linux/compiler-gcc4.h
./include/linux/compiler-gcc.h
./include/linux/compiler-gcc3.h
发现确实没有compiler-gcc6.h文件

解决办法有2个:

1、将compiler-gcc4.h拷贝为同一目录下的compiler-gcc6.h

~/test/u-boot-2012.04.01$ cp ./include/linux/compiler-gcc4.h ./include/linux/compiler-gcc6.h

重新编译后问题解决

2、修改compiler-gcc.h文件,将#include gcc_header(__GNUC__)修改为#include gcc_header(4)

vim /home/book/test/u-boot-2012.04.01/include/linux/compiler-gcc.h +87

#define __gcc_header(x) #x
#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
#define gcc_header(x) _gcc_header(x)
//#include gcc_header(__GNUC__)
#include gcc_header(4)

重新编译后问题解决

参考:linux 内核编译 错误 fatal error: linux/compiler-gcc6.h: No such file or directory

 

你可能感兴趣的:(嵌入式,内核,u-boot,ubuntu)