problem:
When compiling the kernel:
include/linux/compiler-gcc.h:100:1: 致命错误: linux/compiler-gcc7.h:没有那个文件或目录
#include gcc_header(__GNUC__)
^~~~
编译中断。
analysis:
Query GCC version:
gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
The version is 7.5.0, it compiler-gcc7.h
must be the 7 version of the corresponding gcc.
solve:
- Reinstall the lower version of gcc.
include/linux
Findcompiler-gcc3.h
orcompiler-gcc3.h
wait for the file in the directory of the kernel folder, and rename one of them tocompiler-gcc7.h
.- Copy one of the new kernel source code
compiler-gcc7.h
to the kernel folderinclude/linux
directory.