Le 10/01/2017 à 03:11, Christian Kujau a écrit :
On Wed, 4 Jan 2017, Christian Kujau wrote:
So, would the following be sufficient? It compiles, but I haven't had a
chance to boot yet.


So, with -fno-stack-protector my GCC 4.9.2 compiles with
CC_STACKPROTECTOR_STRONG=y but panics during boot:



Maybe ppc32 is not supposed to be built with CC_STACKPROTECTOR ?

Indeed, the latest versions of GCC don't use anymore the global variable __stack_chk_guard as canary value, but a value stored at -0x7008(r2). This is not compatible with the current implementation of the kernel with uses r2 as a pointeur to current task struct. So until we fix it, I don't think CC_STACKPROTECTOR is usable on PPC with modern versions of GCC.

Christophe


Thanks,
Christian.


diff --git a/arch/powerpc/platforms/powermac/Makefile 
b/arch/powerpc/platforms/powermac/Makefile
index 1eb7b45..c7dcab9 100644
--- a/arch/powerpc/platforms/powermac/Makefile
+++ b/arch/powerpc/platforms/powermac/Makefile
@@ -1,4 +1,4 @@
-CFLAGS_bootx_init.o            += -fPIC
+CFLAGS_bootx_init.o            += -fPIC -fno-stack-protector

 ifdef CONFIG_FUNCTION_TRACER
 # Do not trace early boot code


Thanks,
Christian.
--
BOFH excuse #156:

Zombie processes haunting the computer


Reply via email to