Re: [RFC PATCH] kbuild: add -fno-PIE
From: Sven Joachim
Date: Mon Oct 24 2016 - 13:33:29 EST
On 2016-10-24 09:43 +0200, Sebastian Andrzej Siewior wrote:
> On 2016-10-24 09:38:49 [+0200], Sven Joachim wrote:
>>
>> But make still fails with it. :-(
>
> try setting CONFIG_CC_STACKPROTECTOR_NONE=y and please let me know if
> the resulting kernel built with v3.2 gcc boots & works.
Sorry, I don't have gcc 3.2 around, and my gcc 3.3 environment produces
assembler errors in arch/x86/entry/entry_32.S. Maybe binutils 2.15 is
not recent enough anymore?
Anyway, with CONFIG_CC_STACKPROTECTOR=y it is necessary to add -fno-pie
in scripts/gcc-x86_64-has-stack-protector.sh as well, because that
script invokes the compiler without KBUILD_CFLAGS. That's probably not
a problem since -fstack-protector is newer than -fno-pie. The attached
patch works for me with Debian's gcc-6 package.
Cheers,
Sven