summaryrefslogtreecommitdiff
path: root/arch/powerpc/Makefile
diff options
context:
space:
mode:
authorTony Breeds <tony@bakeyournoodle.com>2008-09-02 10:50:38 +0400
committerPaul Mackerras <paulus@samba.org>2008-09-03 14:53:34 +0400
commit7563dc64585324f443f5ac107eb6d89ee813a2d2 (patch)
treead97560d4280d844ff5a2c0c574962ef4fefa671 /arch/powerpc/Makefile
parent303996dace16894710a5291327eeb79afdb8ed12 (diff)
downloadlinux-7563dc64585324f443f5ac107eb6d89ee813a2d2.tar.xz
powerpc: Work around gcc's -fno-omit-frame-pointer bug
This bug is causing random crashes (http://bugzilla.kernel.org/show_bug.cgi?id=11414). -fno-omit-frame-pointer is only needed on powerpc when -pg is also supplied, and there is a gcc bug that causes incorrect code generation on 32-bit powerpc when -fno-omit-frame-pointer is used---it uses stack locations below the stack pointer, which is not allowed by the ABI because those locations can and sometimes do get corrupted by an interrupt. This ensures that CONFIG_FRAME_POINTER is only selected by ftrace. When CONFIG_FTRACE is enabled we also pass -mno-sched-epilog to work around the gcc codegen bug. Patch based on work by: Andreas Schwab <schwab@suse.de> Segher Boessenkool <segher@kernel.crashing.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/Makefile')
-rw-r--r--arch/powerpc/Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 9155c9312c1e..c6be19e9ceae 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -116,6 +116,11 @@ ifeq ($(CONFIG_6xx),y)
KBUILD_CFLAGS += -mcpu=powerpc
endif
+# Work around a gcc code-gen bug with -fno-omit-frame-pointer.
+ifeq ($(CONFIG_FTRACE),y)
+KBUILD_CFLAGS += -mno-sched-epilog
+endif
+
cpu-as-$(CONFIG_4xx) += -Wa,-m405
cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec