Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756628AbcJWQUt (ORCPT ); Sun, 23 Oct 2016 12:20:49 -0400 Received: from mout.gmx.net ([212.227.17.21]:55161 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756423AbcJWQUr (ORCPT ); Sun, 23 Oct 2016 12:20:47 -0400 From: Sven Joachim To: Adam Borowski Cc: Sebastian Andrzej Siewior , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, ben@decadent.org.uk Subject: Re: [RFC PATCH] kbuild: add -fno-PIE References: <20161021111600.9417-1-bigeasy@linutronix.de> <20161021212127.GA32611@angband.pl> Date: Sun, 23 Oct 2016 18:19:57 +0200 In-Reply-To: <20161021212127.GA32611@angband.pl> (Adam Borowski's message of "Fri, 21 Oct 2016 23:21:27 +0200") Message-ID: <87eg37niky.fsf@turtle.gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:0SOfL6fouJ1ki/mbju5jnTNytzNG+wq4YiBWEQGcN6izXXkEd73 +Bi/MHahkT0E6Vfz/i3f9Gd9ZqKxdp0brIsrWnX5C0SLf5lPe1MvBujOPBi8gLgGPZPhd3b ojyDoGuu9rIqwxzji6V77dlXSUmm6GakFRWgK/rF7q5aS6tuVdwppv5o8pagx/Jy8PwcrFQ hOauQZUA4fSsJG56eLMrg== X-UI-Out-Filterresults: notjunk:1;V01:K0:QhMDplHRCZc=:IpDQqP+XN5CThrcuT/+Rc4 38xJrxaVytLZQHT2c/MBpLmyKIUOsbsWoFTvhQ52I0wpZ4TQq+Uk7XVqcnc3WUTy4yXB26t5x 54Nk4ROeP2GKzPqMotU5vlFHbtHN8PF7UYDsZDpagk2IAR/WOMblGliNA73My8C42W4FSoPIY FuTIkgvQzL8TZchYdYBhcYuY1R3eMSCdikUXVUflCmCvgNxfgAHv5p/hv/M5AT7TfEa2oyVq5 6f+Hd/DuYAaUjZ7hFQ2PraH4a2WJnPIUqL8C+UiWtyRa9gNPGjdbSkH+IgfxbINliF7QHv7Dy zniSOEloQUKUNNLm/bdnu58H6kd+N6N3cMhGEt1cGg54GXwtF3TdOTUKJDC71hQ0C0zqTQAyh 5EbKhfrKnHD6PpWxcPnURaEoKLZlYCSd7Ol9GQcL9p+y8nDcDS/kjDbMjEkPnEieiVvZs5eLu IKqqSwtrPpnLP5YnKXLfcB7AXE7hR0mWDMoEV6r/QdJklz9hsZdnYm4lCjNUyKFezO5sR7pyH azQM2Ox4M+Tl28ek8UKGW3RDsvWZhO8MhOHVwXEuYAh/XYi8g3+YXm8C/+1FramsgofaeL5fW yORDERUpjaN2YDAKRAXBuKmC8QIcxqODat5fmwsO6hDc2ZmegNAABV2hSidIiAWkSqqrEHpCY gWoJOcUQA85IapHtiXX2JxQZEk2MDnSeYrkPS2nxnMkxKwvmEHzFXnLqRZMgPEeBmmmXarm5M 7PRTQ89g/9S44AutQt/PcOlLlPYaeWKO6XdxrDj5DIH8WyUI06Mc7Wp/xKgZOeY54z9SZxPcK +oPN+gp Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1904 Lines: 53 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 > > 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. Testing on Debian 3.1 (sarge) chroot, it seems that GCC 3.4 is the first release to accept -fPIE/-fno-PIE. Which could be a problem since according to Documentation/Changes GCC 3.2 is sufficient to build the kernel. >> Signed-off-by: Sebastian Andrzej Siewior >> --- >> 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. Cheers, Sven