How to pass compiler options during Linux kernel compilation? (>= 6.13.4) - Stack Overflow

Since Linux 6.13.4, I can no longer compile Linux using my optimization flags.For Linux 6.13.2, the fo

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744763799a4592331.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信