From: Michal Marek <mmarek@suse.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
linux-kbuild@vger.kernel.org, Ben Hutchings <ben@decadent.org.uk>,
x86-ml <x86@kernel.org>, lkml <linux-kernel@vger.kernel.org>,
+@pd.tnic
Subject: Re: [PATCH -v1.1] kbuild: Steal gcc's pie from the very beginning
Date: Tue, 15 Nov 2016 17:08:09 +0100 [thread overview]
Message-ID: <20161115160809.GA18830@sepie.suse.cz> (raw)
In-Reply-To: <20161114204529.sqn6z2bockmhxpfz@pd.tnic>
On Mon, Nov 14, 2016 at 09:45:29PM +0100, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
> Date: Mon, 14 Nov 2016 19:41:31 +0100
> Subject: [PATCH] kbuild: Steal gcc's pie from the very beginning
>
> So Sebastian turned off the PIE for kernel builds but that was too late
> - Kbuild.include already uses KBUILD_CFLAGS and trying to disable gcc
> options with, say cc-disable-warning, fails:
>
> gcc -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs
> ...
> -Wno-sign-compare -fno-asynchronous-unwind-tables -Wframe-address -c -x c /dev/null -o .31392.tmp
> /dev/null:1:0: error: code model kernel does not support PIC mode
>
> because that returns an error and we can't disable the warning. For
> example in this case:
>
> KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
>
> which leads to gcc issuing all those warnings again.
>
> So let's turn off PIE/PIC at the earliest possible moment, when we
> declare KBUILD_CFLAGS so that cc-disable-warning picks it up too.
>
> Also, we need the $(call cc-option ...) because -fno-PIE is supported
> since gcc v3.4 and our lowest supported gcc version is 3.2 right now.
>
> Signed-off-by: Borislav Petkov <bp@suse.de>
> Cc: stable@vger.kernel.org
> Cc: Ben Hutchings <ben@decadent.org.uk>
> Cc: Michal Marek <mmarek@suse.com>
> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Thanks, applied to kbuild.git#rc-fixes.
Michal
prev parent reply other threads:[~2016-11-15 16:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-14 18:51 [PATCH] kbuild: Steal gcc's pie from the very beginning Borislav Petkov
[not found] ` <20161114201457.qsevfvn465otwfvz@linutronix.de>
2016-11-14 20:45 ` [PATCH -v1.1] " Borislav Petkov
2016-11-15 16:08 ` Michal Marek [this message]
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=20161115160809.GA18830@sepie.suse.cz \
--to=mmarek@suse.com \
--cc=+@pd.tnic \
--cc=ben@decadent.org.uk \
--cc=bigeasy@linutronix.de \
--cc=bp@alien8.de \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.org \
/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