diff options
| author | Tony Breeds <tony@bakeyournoodle.com> | 2008-09-02 02:50:38 -0400 |
|---|---|---|
| committer | Paul Mackerras <paulus@samba.org> | 2008-09-03 06:53:34 -0400 |
| commit | 7563dc64585324f443f5ac107eb6d89ee813a2d2 (patch) | |
| tree | ad97560d4280d844ff5a2c0c574962ef4fefa671 /arch | |
| parent | 303996dace16894710a5291327eeb79afdb8ed12 (diff) | |
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')
| -rw-r--r-- | arch/powerpc/Makefile | 5 | ||||
| -rw-r--r-- | arch/powerpc/kernel/Makefile | 7 | ||||
| -rw-r--r-- | arch/powerpc/platforms/powermac/Makefile | 2 |
3 files changed, 10 insertions, 4 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) | |||
| 116 | KBUILD_CFLAGS += -mcpu=powerpc | 116 | KBUILD_CFLAGS += -mcpu=powerpc |
| 117 | endif | 117 | endif |
| 118 | 118 | ||
| 119 | # Work around a gcc code-gen bug with -fno-omit-frame-pointer. | ||
| 120 | ifeq ($(CONFIG_FTRACE),y) | ||
| 121 | KBUILD_CFLAGS += -mno-sched-epilog | ||
| 122 | endif | ||
| 123 | |||
| 119 | cpu-as-$(CONFIG_4xx) += -Wa,-m405 | 124 | cpu-as-$(CONFIG_4xx) += -Wa,-m405 |
| 120 | cpu-as-$(CONFIG_6xx) += -Wa,-maltivec | 125 | cpu-as-$(CONFIG_6xx) += -Wa,-maltivec |
| 121 | cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec | 126 | cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec |
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 64f5948ebc9d..946daea780f1 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
| @@ -14,12 +14,13 @@ endif | |||
| 14 | 14 | ||
| 15 | ifdef CONFIG_FTRACE | 15 | ifdef CONFIG_FTRACE |
| 16 | # Do not trace early boot code | 16 | # Do not trace early boot code |
| 17 | CFLAGS_REMOVE_cputable.o = -pg | 17 | CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog |
| 18 | CFLAGS_REMOVE_prom_init.o = -pg | 18 | CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog |
| 19 | CFLAGS_REMOVE_btext.o = -pg -mno-sched-epilog | ||
| 19 | 20 | ||
| 20 | ifdef CONFIG_DYNAMIC_FTRACE | 21 | ifdef CONFIG_DYNAMIC_FTRACE |
| 21 | # dynamic ftrace setup. | 22 | # dynamic ftrace setup. |
| 22 | CFLAGS_REMOVE_ftrace.o = -pg | 23 | CFLAGS_REMOVE_ftrace.o = -pg -mno-sched-epilog |
| 23 | endif | 24 | endif |
| 24 | 25 | ||
| 25 | endif | 26 | endif |
diff --git a/arch/powerpc/platforms/powermac/Makefile b/arch/powerpc/platforms/powermac/Makefile index 58ecdd72630f..be60d64be7ad 100644 --- a/arch/powerpc/platforms/powermac/Makefile +++ b/arch/powerpc/platforms/powermac/Makefile | |||
| @@ -2,7 +2,7 @@ CFLAGS_bootx_init.o += -fPIC | |||
| 2 | 2 | ||
| 3 | ifdef CONFIG_FTRACE | 3 | ifdef CONFIG_FTRACE |
| 4 | # Do not trace early boot code | 4 | # Do not trace early boot code |
| 5 | CFLAGS_REMOVE_bootx_init.o = -pg | 5 | CFLAGS_REMOVE_bootx_init.o = -pg -mno-sched-epilog |
| 6 | endif | 6 | endif |
| 7 | 7 | ||
| 8 | obj-y += pic.o setup.o time.o feature.o pci.o \ | 8 | obj-y += pic.o setup.o time.o feature.o pci.o \ |
