diff mbox

[RFC] kbuild: add -fno-PIE

Message ID 8760oinqly.fsf@turtle.gmx.de (mailing list archive)
State New, archived
Headers show

Commit Message

Sven Joachim Oct. 24, 2016, 7:38 a.m. UTC
On 2016-10-23 12:23 -0700, Joe Perches wrote:

> On Sun, 2016-10-23 at 18:19 +0200, Sven Joachim wrote:
>> On 2016-10-21 23:21 +0200, Adam Borowski wrote:
>> > On Fri, Oct 21, 2016 at 01:16:00PM +0200, Sebastian Andrzej Siewior wrote:
>> > > Debian started to build the gcc with --enable-default-pie by default
> []
>> > > diff --git a/Makefile b/Makefile
> []
>> > > @@ -398,7 +398,7 @@ KBUILD_CPPFLAGS := -D__KERNEL__
>> > >  KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
>> > >  		   -fno-strict-aliasing -fno-common \
>> > >  		   -Werror-implicit-function-declaration \
>> > > -		   -Wno-format-security \
>> > > +		   -Wno-format-security -fno-PIE \
>> > >  		   -std=gnu89
>
> I've used this here instead:
>
> KBUILD_CFLAGS  += $(call cc-option,-fno-pie)

Where exactly do you set that?  I tried this patch:

--8<---------------cut here---------------start------------->8---
--8<---------------cut here---------------end--------------->8---

But make still fails with it. :-(

,----
| $ LANG=C make      
| scripts/kconfig/conf  --silentoldconfig Kconfig
|   SYSTBL  arch/x86/entry/syscalls/../../include/generated/asm/syscalls_32.h
|   SYSHDR  arch/x86/entry/syscalls/../../include/generated/asm/unistd_32_ia32.h
|   SYSHDR  arch/x86/entry/syscalls/../../include/generated/asm/unistd_64_x32.h
|   SYSTBL  arch/x86/entry/syscalls/../../include/generated/asm/syscalls_64.h
|   SYSHDR  arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_32.h
|   SYSHDR  arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_64.h
|   SYSHDR  arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_x32.h
|   HOSTCC  arch/x86/tools/relocs_32.o
|   HOSTCC  arch/x86/tools/relocs_64.o
|   HOSTCC  arch/x86/tools/relocs_common.o
|   HOSTLD  arch/x86/tools/relocs
|   CHK     include/config/kernel.release
|   UPD     include/config/kernel.release
| Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong available but compiler is broken
| Makefile:1066: recipe for target 'prepare-compiler-check' failed
| make: *** [prepare-compiler-check] Error 1
`----

Cheers,
       Sven
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Sebastian Andrzej Siewior Oct. 24, 2016, 7:43 a.m. UTC | #1
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.

> 
> Cheers,
>        Sven

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 93beca4..fde1e21 100644
--- a/Makefile
+++ b/Makefile
@@ -619,6 +619,7 @@  ARCH_AFLAGS :=
 ARCH_CFLAGS :=
 include arch/$(SRCARCH)/Makefile
 
+KBUILD_CFLAGS	+= $(call cc-option,-fno-pie,)
 KBUILD_CFLAGS	+= $(call cc-option,-fno-delete-null-pointer-checks,)
 KBUILD_CFLAGS	+= $(call cc-disable-warning,maybe-uninitialized,)
 KBUILD_CFLAGS	+= $(call cc-disable-warning,frame-address,)