编译linux实时内核‘error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible’等几个问题

  1. Kernel does not support PIC mode 解决办法:https://blog.csdn.net/jasonLee_lijiaqi/article/details/84651138
  2. ./include/linux/types.h:17:9: error: unknown type name ‘__kernel_ino_t’ typedef __kernel_ino_t ino_t; ^~~~~~~~~~~~~~ ./include/linux/types.h:18:9: error: unknown type name ‘__kernel_mode_t’ typedef __kernel_mode_t mode_t; ^~~~~~~~~~~~~~~ ./include/linux/types.h:21:9: error: unknown type name ‘__kernel_off_t’ typedef __kernel_off_t off_t; ^~~~~~~~~~~~~~ ./include/linux/types.h:22:9: error: unkn以下省略一堆。。。
    暂无解决办法,可参考GIT-HUB的一位兄弟的描述暂时认为可能是版本问题。
  3. gcc not found 重新装gcc,看看gcc --version有没有出现。我出现过gcc --version,没有显示版本,但是sudo apt install gcc却告诉我已经安装了最新版,这时候把sudo remove gcc,再sudo apt install gcc
  4. [error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible],原因可能是gcc-9的一些更改出现了bug,参考网页
    重新安装一遍gcc-8,可以成功运行。安装gcc-8参考网页

你可能感兴趣的:(Linux)