mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
debug: Add CONFIG_READABLE_ASM
Add a config option to disable various gcc compiler optimizations that make assembler listings much harder to read. This is everything that reorders code significantly or creates partial functions. This is mainly to keep kernel hackers sane. Signed-off-by: Andi Kleen <ak@linux.intel.com> Link: http://lkml.kernel.org/r/1332960678-11879-2-git-send-email-andi@firstfloor.org Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
35372a7d45
commit
1873e870fd
10
Makefile
10
Makefile
@ -564,6 +564,16 @@ else
|
|||||||
KBUILD_CFLAGS += -O2
|
KBUILD_CFLAGS += -O2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef CONFIG_READABLE_ASM
|
||||||
|
# Disable optimizations that make assembler listings hard to read.
|
||||||
|
# reorder blocks reorders the control in the function
|
||||||
|
# ipa clone creates specialized cloned functions
|
||||||
|
# partial inlining inlines only parts of functions
|
||||||
|
KBUILD_CFLAGS += $(call cc-option,-fno-reorder-blocks,) \
|
||||||
|
$(call cc-option,-fno-ipa-cp-clone,) \
|
||||||
|
$(call cc-option,-fno-partial-inlining)
|
||||||
|
endif
|
||||||
|
|
||||||
include $(srctree)/arch/$(SRCARCH)/Makefile
|
include $(srctree)/arch/$(SRCARCH)/Makefile
|
||||||
|
|
||||||
ifneq ($(CONFIG_FRAME_WARN),0)
|
ifneq ($(CONFIG_FRAME_WARN),0)
|
||||||
|
@ -70,6 +70,15 @@ config STRIP_ASM_SYMS
|
|||||||
that look like '.Lxxx') so they don't pollute the output of
|
that look like '.Lxxx') so they don't pollute the output of
|
||||||
get_wchan() and suchlike.
|
get_wchan() and suchlike.
|
||||||
|
|
||||||
|
config READABLE_ASM
|
||||||
|
bool "Generate readable assembler code"
|
||||||
|
depends on DEBUG_KERNEL
|
||||||
|
help
|
||||||
|
Disable some compiler optimizations that tend to generate human unreadable
|
||||||
|
assembler output. This may make the kernel slightly slower, but it helps
|
||||||
|
to keep kernel developers who have to stare a lot at assembler listings
|
||||||
|
sane.
|
||||||
|
|
||||||
config UNUSED_SYMBOLS
|
config UNUSED_SYMBOLS
|
||||||
bool "Enable unused/obsolete exported symbols"
|
bool "Enable unused/obsolete exported symbols"
|
||||||
default y if X86
|
default y if X86
|
||||||
|
Loading…
Reference in New Issue
Block a user