lkml.org 
[lkml]   [2011]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] Disable -fconserve-stack on ARM
> Didn't work, on the gcc command line we get -fno-conserve-stack followed
> by -fconserve-stack from the top makefile and it seems that the latter
> takes priority.

Ah ok need to move it up then too in the top level Makefile.
Like this.

-Andi

---
Disable -fconserve-stack on ARM v2

There are reports that -fconserve-stack misaligns variables on the stack.
Disable it for ARM to work around this gcc bug.

v2: Move top level flags definition up
Signed-off-by: Andi Kleen <ak@linux.intel.com>

diff --git a/Makefile b/Makefile
index 529d93f..08d848f 100644
--- a/Makefile
+++ b/Makefile
@@ -564,6 +564,10 @@ else
KBUILD_CFLAGS += -O2
endif

+# conserve stack if available
+# do this early so that an architecture can override it.
+KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)
+
include $(srctree)/arch/$(SRCARCH)/Makefile

ifneq ($(CONFIG_FRAME_WARN),0)
@@ -629,9 +633,6 @@ KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign)
# disable invalid "can't wrap" optimizations for signed / pointers
KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)

-# conserve stack if available
-KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)
-
# use the deterministic mode of AR if available
KBUILD_ARFLAGS := $(call ar-option,D)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index f5b2b39..902fec9 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -41,6 +41,10 @@ ifeq ($(CONFIG_CC_STACKPROTECTOR),y)
KBUILD_CFLAGS +=-fstack-protector
endif

+# ARM gcc developers unfortunately broke -fconserve-stack. It misaligns
+# variables on the stack
+KBUILD_CFLAGS += $(call cc-option,-fno-conserve-stack)
+
ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
KBUILD_CPPFLAGS += -mbig-endian
AS += -EB

\
 
 \ /
  Last update: 2011-05-31 20:03    [W:0.060 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site