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

Re: [PATCH v3 1/8] xen: fix build when $(obj-y) consists of just blanks


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 9 Dec 2020 11:34:17 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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-SenderADCheck; bh=cCsIW8HwRg6tCtIHiltBiyAFuFodchcZeoGi09AQt48=; b=Qeuczp/PGWCrp2eioY46nBT+Bo5u0fDjPZ1gxsQMS5Bbn7FLy/kdiOmZMNTNnIoh4BM2kzd0my+h9UDMc3JaJyMuDlVWj7fwAQSl+Q2W5XwT6q14cbzVG7MrP2y8X9avcKOE1iJfdPl6a68XESsclWIqnMfJfEg6TOyY5CoDLHncv8nWwyVaEfHbWDizuj0+QTfzuz00J9dBh1JN0Owu1WSbxuA14qv5f7AZpjYirtWg5E4NUYA5cgahtvtAHi57fsV/OF51lPDl2t7EKluBskKI4gE7A3Q0XmQdxHbAiqZj0oXeAIga/puAQElqpgLhfPcN6lPsGXqXm4VRHisYrw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BDh7hxQfl/xiJ8iH9rVbvQ2HHWC4PjNSzoSRJO2JyAjip2asYg9QDyFl6D+siZ6revU0FSRAWvm2ACMNNhUP+GgCNL852vzvUUWQbhvsXdWBsT3CkLa1mvBzZTnD4l/8VBdRLYGwo77e/90mCkpWQukf5e9nS7Xzm1rM4ks/cL3m24cs48hpSTrrig9HUaXCapl7KAFu3y+iMpelRkNc2wB+dpk2ZvZPi/UAXpC6jFM54+oHAGHC2D//4KI2i2mNuH1QdFy2C40NvwF0iLd6VO5WrpTmzJxsMgpC9HUSYVb4WwS5Cs6gY/lAOpUqpXOvjlY0O74miC4YcMbOYQYSeA==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Wed, 09 Dec 2020 11:34:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWwaxOoKHklwCvRUixoNq5gGL6M6nuuxuA
  • Thread-topic: [PATCH v3 1/8] xen: fix build when $(obj-y) consists of just blanks

Hi Jan,

> On 23 Nov 2020, at 15:20, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> This case can occur when combining empty lists
> 
> obj-y :=
> ...
> obj-y += $(empty)
> 
> or
> 
> obj-y := $(empty) $(empty)
> 
> where (only) blanks would accumulate. This was only a latent issue until
> now, but would become an active issue for Arm once lib/ gets populated
> with all respective objects going into the to be introduced lib.a.
> 
> Also address a related issue at this occasion: When an empty built_in.o
> gets created, .built_in.o.d will have its dependencies recorded. If, on
> a subsequent incremental build, an actual constituent of built_in.o
> appeared, the $(filter-out ) would leave these recorded dependencies in
> place. But of course the linker won't know what to do with C header
> files. (The apparent alternative of avoiding to pass $(c_flags) or
> $(a_flags) would not be reliable afaict, as among these flags there may
> be some affecting information conveyed via the object file to the
> linker. The linker, finding inconsistent flags across object files, may
> then error out.) Using just $(obj-y) won't work either: It breaks when
> the same object file is listed more than once.
> 
> Reported-by: Julien Grall <julien@xxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> xen/Rules.mk | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/Rules.mk b/xen/Rules.mk
> index 333e19bec343..d5e5eb33de39 100644
> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -130,13 +130,13 @@ c_flags += $(CFLAGS-y)
> a_flags += $(CFLAGS-y) $(AFLAGS-y)
> 
> built_in.o: $(obj-y) $(extra-y)
> -ifeq ($(obj-y),)
> +ifeq ($(strip $(obj-y)),)
>       $(CC) $(c_flags) -c -x c /dev/null -o $@
> else
> ifeq ($(CONFIG_LTO),y)
> -     $(LD_LTO) -r -o $@ $(filter-out $(extra-y),$^)
> +     $(LD_LTO) -r -o $@ $(filter $(obj-y),$^)
> else
> -     $(LD) $(XEN_LDFLAGS) -r -o $@ $(filter-out $(extra-y),$^)
> +     $(LD) $(XEN_LDFLAGS) -r -o $@ $(filter $(obj-y),$^)
> endif
> endif
> 
> @@ -145,10 +145,10 @@ targets += $(filter-out $(subdir-obj-y), $(obj-y)) 
> $(extra-y)
> targets += $(MAKECMDGOALS)
> 
> built_in_bin.o: $(obj-bin-y) $(extra-y)
> -ifeq ($(obj-bin-y),)
> +ifeq ($(strip $(obj-bin-y)),)
>       $(CC) $(a_flags) -c -x assembler /dev/null -o $@
> else
> -     $(LD) $(XEN_LDFLAGS) -r -o $@ $(filter-out $(extra-y),$^)
> +     $(LD) $(XEN_LDFLAGS) -r -o $@ $(filter $(obj-bin-y),$^)
> endif
> 
> # Force execution of pattern rules (for which PHONY cannot be directly used).
> -- 
> 2.22.0
> 
> 
> 




 


Rackspace

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