diff options
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | lib/Kconfig.debug | 9 |
2 files changed, 19 insertions, 0 deletions
@@ -564,6 +564,16 @@ else | |||
564 | KBUILD_CFLAGS += -O2 | 564 | KBUILD_CFLAGS += -O2 |
565 | endif | 565 | endif |
566 | 566 | ||
567 | ifdef CONFIG_READABLE_ASM | ||
568 | # Disable optimizations that make assembler listings hard to read. | ||
569 | # reorder blocks reorders the control in the function | ||
570 | # ipa clone creates specialized cloned functions | ||
571 | # partial inlining inlines only parts of functions | ||
572 | KBUILD_CFLAGS += $(call cc-option,-fno-reorder-blocks,) \ | ||
573 | $(call cc-option,-fno-ipa-cp-clone,) \ | ||
574 | $(call cc-option,-fno-partial-inlining) | ||
575 | endif | ||
576 | |||
567 | include $(srctree)/arch/$(SRCARCH)/Makefile | 577 | include $(srctree)/arch/$(SRCARCH)/Makefile |
568 | 578 | ||
569 | ifneq ($(CONFIG_FRAME_WARN),0) | 579 | ifneq ($(CONFIG_FRAME_WARN),0) |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 6777153f18f3..4d3cbbbe4516 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -70,6 +70,15 @@ config STRIP_ASM_SYMS | |||
70 | that look like '.Lxxx') so they don't pollute the output of | 70 | that look like '.Lxxx') so they don't pollute the output of |
71 | get_wchan() and suchlike. | 71 | get_wchan() and suchlike. |
72 | 72 | ||
73 | config READABLE_ASM | ||
74 | bool "Generate readable assembler code" | ||
75 | depends on DEBUG_KERNEL | ||
76 | help | ||
77 | Disable some compiler optimizations that tend to generate human unreadable | ||
78 | assembler output. This may make the kernel slightly slower, but it helps | ||
79 | to keep kernel developers who have to stare a lot at assembler listings | ||
80 | sane. | ||
81 | |||
73 | config UNUSED_SYMBOLS | 82 | config UNUSED_SYMBOLS |
74 | bool "Enable unused/obsolete exported symbols" | 83 | bool "Enable unused/obsolete exported symbols" |
75 | default y if X86 | 84 | default y if X86 |