降低内核模块编译优化等级时出错

在Makefile里加上-O0之后

./include/linux/compiler-gcc.h:120:38: error: impossible constraint in ‘asm’
 #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
                                      ^~~
./arch/x86/include/asm/cpufeature.h:165:2: note: in expansion of macro ‘asm_volatile_goto’
  asm_volatile_goto("1: jmp 6f\n"
  ^~~~~~~~~~~~~~~~~

https://stackoverflow.com/questions/11501236/how-to-prevent-gcc-optimizing-in-kernel-modules可知,至少要-O1才行。

posted @ 2024-09-28 13:40  寻找繁星  阅读(4)  评论(0编辑  收藏  举报