From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3ttklp52hVzDqGt for ; Wed, 4 Jan 2017 19:40:22 +1100 (AEDT) Date: Wed, 4 Jan 2017 02:40:03 -0600 From: Segher Boessenkool To: Christophe LEROY Cc: benh@au1.ibm.com, Christian Kujau , linuxppc-dev@lists.ozlabs.org Subject: Re: bootx_init.c:88: undefined reference to `__stack_chk_fail_local' Message-ID: <20170104084003.GD28613@gate.crashing.org> References: <1483483841.15843.4.camel@au1.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, Jan 04, 2017 at 09:23:47AM +0100, Christophe LEROY wrote: > >The way gcc implements the stack protector has some serious > >incompatibilities with the way the Linux kernel uses r13, I wouldn't > >even try until we sort that out... > > Yes indeed, it looks like recent versions of GCC don't use anymore the > global __stack_chk_guard variable but a hard coded offset relative to r2 > or r13: > > On 32 bits, it uses -7008(r2) > On 64 bits, it uses -7010(r13) This is https://gcc.gnu.org/PR78875 . It should have been this way since forever; if it really wasn't, it is unclear why not. Either way, we (i.e. GCC) will add some compiler option to make this work for the kernel. It will be part of 7 and we'll probably backport it to 6.4 and 5.5 . For bootx_init.c, this probably should be compiled with -fno-stack-protector just like all the other boot time stuff. Segher