public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adam Borowski <kilobyte@angband.pl>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Michal Marek <mmarek@suse.com>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	ben@decadent.org.uk
Subject: Re: [RFC PATCH] kbuild: add -fno-PIE
Date: Fri, 21 Oct 2016 23:21:27 +0200	[thread overview]
Message-ID: <20161021212127.GA32611@angband.pl> (raw)
In-Reply-To: <20161021111600.9417-1-bigeasy@linutronix.de>

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.

  reply	other threads:[~2016-10-21 21:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21 11:16 [RFC PATCH] kbuild: add -fno-PIE Sebastian Andrzej Siewior
2016-10-21 21:21 ` Adam Borowski [this message]
2016-10-23 16:19   ` Sven Joachim
2016-10-23 19:23     ` Joe Perches
2016-10-24  7:38       ` Sven Joachim
2016-10-24  7:43         ` Sebastian Andrzej Siewior
2016-10-24 17:32           ` Sven Joachim
2016-10-24 17:48             ` Joe Perches
2016-10-25  7:30             ` Sebastian Andrzej Siewior
2016-10-26 17:51               ` Sven Joachim
2016-10-27  7:28                 ` Sebastian Andrzej Siewior
2016-10-28 23:00                   ` Andrew Morton
2016-10-29 10:10             ` Tomas Janousek
2016-10-29 17:03               ` Sven Joachim
2016-10-29 19:21                 ` Tomas Janousek
2016-10-29 21:18                   ` Sven Joachim
2016-10-24  9:57         ` Joe Perches
2016-10-27 17:09 ` Shuah Khan
2016-10-28  8:09   ` Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161021212127.GA32611@angband.pl \
    --to=kilobyte@angband.pl \
    --cc=ben@decadent.org.uk \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox