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

Re: Gitlab breakage: [PATCH] Config.mk: correct PIE-related option(s) in EMBEDDED_EXTRA_CFLAGS


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 9 Sep 2022 08:37:38 +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=25JcyLpzCBNQsdPGwv+P11c8g8K4FbBjsdktf1Zfi0o=; b=cFZWMsOIIvqiCZxgNAllMn3dvMr3uAz9DP+Qch0m8WV+H5cxqtxf/uVSCa4/dJYzRFM+/k+FX1Uugvt40k5FQRS6hkIv4LvAIeiAH3+3cBz4RdNys9RU+vNKdvOyb9mGCBTyPQqfyb13NjU6G1LOmasFLk60Tmh9Q+yVfFUz6yAnhh4QBnikKTF+z6VuzIi1RpI9rP8fgAZbVhaXMuSmiFB+Yb4mAA3pLu0inzZ5MW/MRwMmcTC/Iv1MFa07wHWfRbBFc4zi+jvUk1TksNR+cmcjtjJZZxTtNCtjaEt313LWcrA1fPDSRKRXrjvgRCohswD4lZyZnLO6k1Mo0bNg6w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lfex6C6CiA5kCuhi0VGYZzF/yiwYuIIxPzmv1UDnp43ytGVAwHWTb6pSe13lYVwzWTQdUqTTCtjoAZdOm2aWWsb8Ay9Eb59+aAAhLXxMgAwFhYV6EPcx9ata9KMLLJElAiUIM+7QvLriCWu4zZt80ELoqo6hGOoEhKFKJgz52TD8hiKxpU9wTfyWKaOHzWF+WWpOFyH1/bxiKH9k7dJh1M2Dzp57jth9UEQ5DNUG8FKWZtPtH8E/aPFKmbV4nkaicBbYBv/b2+jn+fYWk9t0dCLZK49YtSoNgxOI0OXcTT4HOum8kzj7Mk2FCRtMd1kEksy3CJTP9yCeju6fxMupzg==
  • 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>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Henry.Wang@xxxxxxx
  • Delivery-date: Fri, 09 Sep 2022 06:38:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 09.09.2022 01:34, Stefano Stabellini wrote:
> This patch breaks the gitlab-ci pipeline, specifically it breaks the
> hvmloader build with clang:
> 
> 
> https://gitlab.com/xen-project/xen/-/pipelines/634274727
> https://gitlab.com/xen-project/xen/-/jobs/2996114313
> 
> make[7]: Entering directory '/builds/xen-project/xen/tools/firmware/hvmloader'
> clang   -m32 -march=i686 -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall 
> -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-local-typedefs  
>  -O2 -fomit-frame-pointer 
> -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__ -MMD -MP -MF 
> .hvmloader.o.d -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 
> -D_LARGEFILE64_SOURCE -mno-tls-direct-seg-refs  -DNDEBUG -Werror -fno-pie 
> -no-pie -fno-stack-protector -fno-exceptions -fno-asynchronous-unwind-tables 
> -fcf-protection=none -ffreestanding -msoft-float -nostdinc 
> -I/builds/xen-project/xen/tools/firmware/hvmloader/../../../tools/firmware/include
>  -I/builds/xen-project/xen/tools/firmware/hvmloader/../../../tools/include 
> -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__ -I../../libacpi  
> -c -o hvmloader.o hvmloader.c 
> clang: error: argument unused during compilation: '-nopie' 
> [-Werror,-Wunused-command-line-argument]

First of all I'm puzzled by the error message: Now that we don't (try to)
use -nopie anymore, it complains about this option? We're clearly passing
-no-pie now as the command line shows.

But then - yes, I was actually expecting a similar diagnostic from gcc,
and I was surprised that there was none. Yet I have to admit I should
have tried a clang build of the hypervisor, where the issue also surfaces.

What's important though here - it's not really clear to me what the best
course of action is: We could filter out -no-pie everywhere that CFLAGS
has EMBEDDED_EXTRA_CFLAGS folded in, but isn't used for linking, but
that's odd to have in multiple places. We could also simply drop -no-pie
on the assumption that it's LDFLAGS which is supposed to be used for
linking, not CFLAGS. But that would be wrong for cases where compilation
and linking is done all in one go. Looks like we do such only with
HOSTCC / HOSTCFLAGS right now, but relying on this appears fragile.

I'll see if using the former approach promises to address the issue,
but I'll be happy to take suggestions towards better ways of dealing
with this.

Jan



 


Rackspace

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