Subject: [PATCH] force -mno-string option on cell

From: Akinobu Mita <[email-masked]>
Date: Fri, 23 Mar 2007 21:06:19 +0900

GCC may generate inline copy loop to handle memcpy() function
instead of kernel defined memcpy() with -mstring or -Os.
But this inlined version of memcpy() caused an alignment interrupt
when copying from SPU local store on PS3.
(http://ozlabs.org/pipermail/cbe-oss-dev/2007-March/001348.html)

This patch deletes -mstring option on all powerpc and force -mno-string
option on Cell.

Cc: Arnd Bergmann <[email-masked]>
Cc: Paul Mackerras <[email-masked]>
Signed-off-by: Akinobu Mita <[email-masked]>

---
 arch/powerpc/Makefile |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: 2.6-git-ps3/arch/powerpc/Makefile
===================================================================
--- 2.6-git-ps3.orig/arch/powerpc/Makefile
+++ 2.6-git-ps3/arch/powerpc/Makefile
@@ -102,8 +102,9 @@ CFLAGS += $(call cc-option,-mno-altivec)
 # kernel considerably.
 CFLAGS += $(call cc-option,-funit-at-a-time)
 
-ifndef CONFIG_FSL_BOOKE
-CFLAGS		+= -mstring
+# No string instruction for SPE local store areas
+ifeq ($(CONFIG_PPC_CELL),y)
+CFLAGS		+= -mno-string
 endif
 
 ifeq ($(CONFIG_6xx),y)