[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] zap linking-only option from EMBEDDED_EXTRA_CFLAGS


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 27 Sep 2022 16:34:06 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DPdiUV4zY8II75gU4rSNsJ2bZZONG1hTR8i0I9CaB8k=; b=VS8M3f3AN584z01cztGPdoLc8TtCEUxa45+gfSt5mqJAY6fwFbpa4PI+FVjUY0Hz9Tw47ddSDDqphzvq4nJOwC3VtDdCfGogYC9eTkcCa1W9o31wId4kMPX9f0l3VWynFvPRjsYs13n4tr+7gGB55tSRMtf8xtdPw0Q+9wp9OPfObg3PEN4iqcszSvFuGU5+V67yEr1nU9PyMHibyTq+H4TUMtfLmndj1h5wH7r9Jt9EfUxCOOs1I7QRTUjV8U+w3PkfcDagIo2iaNA3AwMLw3GDliMS+XvwBlBdqYcA8c4MRS6cgSps5ynwTuyEyuT2gqnmseo6rM/7R4buHriw6Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k51lSCM8Zn5tEJcAJ21EFJGdnvOfpXiFMiUs8cG2Cq4w/q/4fM03HH6Abseg5XklDwXRNujnVJYE68MOKFZ1xEA+o+cGVuC3KrZvB0s0mk/a/7wu1XYD5pPlo3RgiUagaV/pGzJffu2Wf/vVcGYfDtCu+9cqJzB5bUncax+VSMAHs49e8S1r3a1TBDLVveK/1rEYtdApCfxfOT5wtCj0TW+Amu4sPXYwmy3ywE4fdeDzneF7FYL2i1db5tSC1+yRHPwxcqw/AnDeqLqhsPcerDtD0CMQkDncXEN4LojMMoL9Ui7A9rjb2STj+u58AyBB5iXQtqYHTo5Fx6VnTv6TLQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 27 Sep 2022 14:34:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.09.2022 16:29, Andrew Cooper wrote:
> On 27/09/2022 15:14, Roger Pau Monne wrote:
>> On Fri, Sep 09, 2022 at 09:22:52AM +0200, Jan Beulich wrote:
>>> While I was suspicious of the compiler issuing a diagnostic about an
>>> unused linking-only option when not doing any linking, I did check this
>>> with a couple of gcc versions only, but not with Clang. (Oddly enough at
>>> least older Clang versions complain about the use of '-nopie' now that
>>> we actually use '-no-pie'.) Filter out the problematic option in all
>>> cases where the variable is consumed for compilation only (which right
>>> now is everywhere).
>>>
>>> Fixes: ecd6b9759919 ("Config.mk: correct PIE-related option(s) in 
>>> EMBEDDED_EXTRA_CFLAGS")
>>> Reported-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
>>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>> ---
>>> Arguably with all users of EMBEDDED_EXTRA_CFLAGS using these just for
>>> compiling, the option could be omitted from that variable right away.
>>> But if any compile-and-link-in-one-go use appeared, there would be an
>>> issue.
>> Is it feasible to have compile-and-link-in-one-go in one use feasible
>> with what we consider embedded (firmware or kernel like binaries).  I
>> would expect those to always require a linker script and a separate
>> linking step.
> 
> As I've expressed several times previously, the entire variable is bogus.
> 
> Just because we do have several things which are built as
> non-freestanding, doesn't mean they share a common CLFLAGS environment.
> 
> PIE is very specific to the intended use, and blindly disabling the
> stack protector isn't safe either.  It only works because none of our
> freestanding environments have gone to the effort of adding stack
> protector support.
> 
> -fno-exceptions is furthermore bogus in CLFLAGS, as its a CXXFLAG only.
> 
> And no, this mess can't plausibly be used for a compile and link in one
> go.  Filtering out a non-CFLAG from the collection at every call site is
> nonsense.

So what do you suggest we do in the short term?

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.