How to build the kernel without any optimization?

Shawn Jin shawnxjin at gmail.com
Tue Aug 24 04:18:44 EST 2010


>> I already added the following to arch/powerpc/Makefile.
>>
>> # Prevent GDB from jumping around in the code when trying to single step
>> ifeq ($(CONFIG_DEBUG_KERNEL),y)
>> KBUILD_CFLAGS           += -fno-schedule-insns -fno-schedule-insns2
>> endif
>>
>
> much of the kernel can not be build without optimization - what you
> can do though is slectively try to disable optimization for specific
> files by putting
>
>  CFLAGS_REMOVE_objfilenam.o = -SOME_OPT
>
> in the Makefile. I think that is safer than what you did above as this would
> always depend on the order of options that ultimately get passed to gcc.

With this CLAGS_REMOVE, building the objfilenam.o uses only the
-SOME_OPT instead of the default CFLAGS defined? The most I found for
-SOME_OPT is the -pg.

Thanks,
-Shawn.


More information about the Linuxppc-dev mailing list