Re: How can I turn off/disable -O2/-Os optimization?

From: Hagen Paul Pfeifer
Date: Sun May 06 2012 - 09:38:12 EST


* Renato Westphal | 2012-05-05 23:00:48 [-0300]:

>>> You could try the new CONFIG_READABLE_ASM patch:
>>>  http://marc.info/?l=linux-kernel&m=133296079716268&w=2

Maybe remove "-Os" on a global basis is not wanted nor required. Maybe a per
directory, per file or per function basis may superior!

make DISABLE_OPTIMIZATION=net/sched/sch_api.c

But still all core constructs defined in top level header files must be
compatible for directory/file basis to be build with no optimization at all.

One way to un-optmize fine-granular is GCC's optmize pragma [1].

Hagen

PS: such a functionality may be convenient for perf probe too! (to hook into
probepoints which are currently optimized out)


[1] http://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-Pragmas.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/