From patchwork Tue May 31 18:01:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 833802 Received: from canuck.infradead.org (canuck.infradead.org [134.117.69.58]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4VJxkiq026351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 31 May 2011 20:00:07 GMT Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QRV5x-0002me-64; Tue, 31 May 2011 19:59:17 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QRV5q-0002hU-2j for linux-arm-kernel@canuck.infradead.org; Tue, 31 May 2011 19:59:10 +0000 Received: from mga11.intel.com ([192.55.52.93]) by casper.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QRTGu-0005lo-Al for linux-arm-kernel@lists.infradead.org; Tue, 31 May 2011 18:02:29 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 31 May 2011 11:01:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,298,1304319600"; d="scan'208";a="9944906" Received: from unknown (HELO localhost) ([10.255.13.61]) by fmsmga002.fm.intel.com with ESMTP; 31 May 2011 11:01:08 -0700 Date: Tue, 31 May 2011 11:01:07 -0700 From: Andi Kleen To: Catalin Marinas Subject: Re: [PATCH] Disable -fconserve-stack on ARM Message-ID: <20110531180107.GA9261@alboin.amr.corp.intel.com> References: <1306429854.26735.9.camel@e102144-lin.cambridge.arm.com> <20110526215101.GL24876@n2100.arm.linux.org.uk> <20110527083806.GA21100@e102109-lin.cambridge.arm.com> <20110527085414.GP24876@n2100.arm.linux.org.uk> <20110527095111.GC21100@e102109-lin.cambridge.arm.com> <20110528153417.GB25869@alboin.amr.corp.intel.com> <20110531163026.GB771@e102109-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110531163026.GB771@e102109-lin.cambridge.arm.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110531_190228_668379_BE739468 X-CRM114-Status: GOOD ( 14.76 ) X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2-r929478 on casper.infradead.org summary: Content analysis details: (-6.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.55.52.93 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= , Russell King - ARM Linux , Nicolas Pitre , Will Deacon , lkml , Andrew Morton , sam@ravnborg.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 31 May 2011 20:00:07 +0000 (UTC) > 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 Tested-by: Catalin Marinas --- 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 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