From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lea.cs.unibo.it (lea.cs.unibo.it [130.136.1.101]) by ozlabs.org (Postfix) with ESMTP id A2CEC67A6F for ; Thu, 28 Apr 2005 00:01:16 +1000 (EST) Message-ID: <426F9646.3000407@namesys.com> Date: Wed, 27 Apr 2005 06:40:22 -0700 From: Hans Reiser MIME-Version: 1.0 To: Olaf Hering References: <20050426211019.GA11579@suse.de> In-Reply-To: <20050426211019.GA11579@suse.de> Content-Type: text/plain; charset=us-ascii; format=flowed Cc: linuxppc-dev@ozlabs.org, reiserfs-dev@namesys.com, Jeff Mahoney Subject: Re: [PATCH] make gcc -O1 in fs/reiserfs optional List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Olaf Hering wrote: >Jeff, > >you added this EXTRA_CFLAGS= during 2.4 development, I think the broken >compiler was gcc 3.2 on SLES8. Can we turn this -O1 into a .config >option? > > >Signed-off-by: Olaf Hering > >Index: linux-2.6.12-rc3-olh/fs/reiserfs/Makefile >=================================================================== >--- linux-2.6.12-rc3-olh.orig/fs/reiserfs/Makefile >+++ linux-2.6.12-rc3-olh/fs/reiserfs/Makefile >@@ -21,13 +21,7 @@ ifeq ($(CONFIG_REISERFS_FS_POSIX_ACL),y) > reiserfs-objs += xattr_acl.o > endif > >-# gcc -O2 (the kernel default) is overaggressive on ppc32 when many inline >-# functions are used. This causes the compiler to advance the stack >-# pointer out of the available stack space, corrupting kernel space, >-# and causing a panic. Since this behavior only affects ppc32, this ifeq >-# will work around it. If any other architecture displays this behavior, >-# add it here. >-ifeq ($(CONFIG_PPC32),y) >+ifeq ($(CONFIG_REISERFS_CC_REDUCE_OPTIMZE),y) > EXTRA_CFLAGS := -O1 > endif > >Index: linux-2.6.12-rc3-olh/fs/Kconfig >=================================================================== >--- linux-2.6.12-rc3-olh.orig/fs/Kconfig >+++ linux-2.6.12-rc3-olh/fs/Kconfig >@@ -186,6 +186,18 @@ config REISERFS_FS > If you like it, you can pay us to add new features to it that you > need, buy a support contract, or pay us to port it to another OS. > >+config REISERFS_CC_REDUCE_OPTIMZE >+ bool "Reduce CC optimization level to workaround compiler bugs" >+ depends on PPC32 >+ default n >+ help >+ gcc -O2 (the kernel default) is overaggressive on ppc32 when many inline >+ functions are used. This causes the compiler to advance the stack >+ pointer out of the available stack space, corrupting kernel space, >+ and causing a panic. Since this behavior only affects ppc32, this ifeq >+ will work around it. If any other architecture displays this behavior, >+ add it here. >+ > config REISERFS_CHECK > bool "Enable reiserfs debug mode" > depends on REISERFS_FS > > > > Sounds reasonable.