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

阅读量: searchstar 2021-01-23 00:29:26
Categories: Tags:

在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才行。