Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1506310

Re: [RFC PATCH] kbuild: add -fno-PIE

From Adam Borowski <kilobyte@angband.pl>
Newsgroups linux.kernel
Subject Re: [RFC PATCH] kbuild: add -fno-PIE
Date 2016-10-21 23:30 +0200
Message-ID <suPy2-2Jv-27@gated-at.bofh.it> (permalink)
References <suG1I-4Ml-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

To be exact: this is since gcc-6 6.2.0-7 dated Tue, 18 Oct 2016 13:53:00 +0200
on amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el s390x.

> so the kernel build ends before it starts properly with:
> |kernel/bounds.c:1:0: error: code model kernel does not support PIC mode
> 
> Is this okay or do we want some kind of check to see if -fno-PIE is supported?
> It is mentioned in the 4.4.7 gcc manpage is it is not *that* new :)

A naive "git log -Sno-PIE" on gcc sources shows commit 3e7f6cce[1] from Feb
2004, and as gcc automatically supports no-XXX whenever XXX is added, it
appears the option is older than that.

> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index bf6e44a421df..97296d66b586 100644
> --- 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
>  
>  KBUILD_AFLAGS_KERNEL :=
> -- 
> 2.9.3

The patch works for me.  I haven't done any but most trivial testing,
though.


[1]. Using the https://gcc.gnu.org/git/gcc.git git gateway, commit hashes
may be different elsewhere.
-- 
A MAP07 (Dead Simple) raspberry tincture recipe: 0.5l 95% alcohol, 1kg
raspberries, 0.4kg sugar; put into a big jar for 1 month.  Filter out and
throw away the fruits (can dump them into a cake, etc), let the drink age
at least 3-6 months.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH] kbuild: add -fno-PIE Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-21 13:20 +0200
  Re: [RFC PATCH] kbuild: add -fno-PIE Adam Borowski <kilobyte@angband.pl> - 2016-10-21 23:30 +0200
    Re: [RFC PATCH] kbuild: add -fno-PIE Sven Joachim <svenjoac@gmx.de> - 2016-10-23 18:30 +0200
      Re: [RFC PATCH] kbuild: add -fno-PIE Joe Perches <joe@perches.com> - 2016-10-23 21:30 +0200
        Re: [RFC PATCH] kbuild: add -fno-PIE Sven Joachim <svenjoac@gmx.de> - 2016-10-24 09:40 +0200
          Re: [RFC PATCH] kbuild: add -fno-PIE Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-24 09:50 +0200
            Re: [RFC PATCH] kbuild: add -fno-PIE Sven Joachim <svenjoac@gmx.de> - 2016-10-24 19:40 +0200
              Re: [RFC PATCH] kbuild: add -fno-PIE Joe Perches <joe@perches.com> - 2016-10-24 19:50 +0200
              Re: [RFC PATCH] kbuild: add -fno-PIE Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-25 09:40 +0200
                Re: [RFC PATCH] kbuild: add -fno-PIE Sven Joachim <svenjoac@gmx.de> - 2016-10-26 20:00 +0200
          Re: [RFC PATCH] kbuild: add -fno-PIE Joe Perches <joe@perches.com> - 2016-10-24 12:00 +0200

csiph-web