[Problem solving] linux/compiler-gcc7.h: there is no such file or directory

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.hmust be the 7 version of the corresponding gcc.


solve:

  1. Reinstall the lower version of gcc.
  2. include/linuxFind compiler-gcc3.hor compiler-gcc3.hwait for the file in the directory of the kernel folder, and rename one of them to compiler-gcc7.h.
  3. Copy one of the new kernel source code compiler-gcc7.hto the kernel folder include/linuxdirectory.

Guess you like

Origin blog.csdn.net/p1279030826/article/details/113931568
Recommended