Tuesday, January 3, 2012

Disable Optimization in Linux Kernel

edit Makefile
find the symbol: CC_OPTIMIZE_FOR_SIZE... make the 3rd line KBUILD_CFLAGS to -O0 instead of -O2 (default)

also enable kernel hacking --> kernel debugging, compile with debug info, allow gcc to uninline, compile kernel with frame pointer



1 comment:

  1. It is know that you cannot compile Linux with -O0 by default. The way you can do it is by setting -O2 to the files which break the build. More details here: http://niaz-debugging.blogspot.dk/2012/01/disable-optimization-for-some-files-in.html

    ReplyDelete