admin管理员组

文章数量:1392054

Since Linux 6.13.4, I can no longer compile Linux using my optimization flags.

For Linux 6.13.2, the following command works:

make CFLAGS='-march=native -Os -ffast-math -flto -pipe' CXXFLAGS='-march=native -Os -ffast-math -flto -pipe'

Starting from Linux 6.13.6, I get the following logs:

  CC      /home/user/Téléchargements/linux-6.13.6/tools/objtool/libsubcmd/exec-cmd.o
exec-cmd.c:2:10: fatal error: linux/compiler.h: No such file or directory
    2 | #include <linux/compiler.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.

Edit:

solved as follows:

export KCFLAGS=" -march=native -Os -ffast-math"
export KCPPFLAGS=" -march=native -Os -ffast-math"
export KRUSTFLAGS=" -C target-cpu=native"

make

the -flto option does not work, I assume that my previous compilation line never worked.

本文标签: How to pass compiler options during Linux kernel compilation (gt 6134)Stack Overflow