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

Re: [XEN PATCH] build: Fix x86 build without EFI


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 16 Aug 2022 15:02:10 +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=RdSuHhwhrm46v3ObyrtiMu+QT0/tENgG7zqq4aYFtVg=; b=GHv1WHNSDMVwBGSQei1Gm1bBdkOrCxB/ejDTn4VARuco2md08IHGgp/vZ9jN5p/KPKct+3kESEdv+LL3+lp2skSuoXldn8SLUMXKuaNhxgUnfBmJN4o6J88bA/8OGICcLa3Mp31rMp7ajlPPULC5vzrjtVhikOMeIzULX9T9uuW78hDoFs4YQjlZZOI9hXFNXX/g/r/NksXZhX7h201091Rx5A2+htpKYvx8FQ8scBigmcmYVyaMp+VTGuxk7uKViZQpyztxxe5OMo3Davh1fXSO4jyM8awd8bMTjMjVZGmVdN/gIxccWXmEkTMCnSWnQmho/N5Sd21oe79+WSdmOA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IdZJVXjEkdCAi++HD+K1KVLPkYRxkLvxFs8nHPOKiZqJOfaEykHf0FzW/pryHyviVfxFYAlM00LltWGz2OBTWJ95uD4O/rj+dDRp8R3WHNvrytmsYvuB1LTfMeLCCP7M5YBWeqtdIMmjQEI5ST8y17OrXRURoGpVT3Hs+5W5n2oiS4+FLTs1rET1WtDwCoOmd1NnUcgEmJ8IqcGEM7cCEylopuOOABpQ6CrytL1njw6zM+DtE+ukdUyfVBVANDHWrswq6aIz5cNa8ROgm319xuG+9M6y7FwYxJV+LO6k3ax993PXw0CYojVbraUYGjrBUI+2YmB5u2Es94IO62tbgw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Chen <wei.chen@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 16 Aug 2022 13:02:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16.08.2022 12:30, Anthony PERARD wrote:
> We can't have a source file with the same name that exist in both the
> common code and in the arch specific code for efi/. This can lead to
> comfusion in make and it can pick up the wrong source file. This issue
> lead to a failure to build a pv-shim for x86 out-of-tree, as this is
> one example of an x86 build using the efi/stub.c.
> 
> The issue is that in out-of-tree, make might find x86/efi/stub.c via
> VPATH, but as the target needs to be rebuilt due to FORCE, make
> actually avoid changing the source tree and rebuilt the target with
> VPATH ignored, so $@ lead to the build tree where "stub.c" dosen't
> exist yet so a link is made to "common/stub.c".
> 
> Rework the new common/stub.c file to have a different name than the
> already existing one. And build both *stub.c as two different objects.
> This mean we have to move some efi_compat_* aliases which are probably
> useless for Arm.

These useless aliases want avoiding there imo. Already when the original
series was discussed, I requested to avoid introduction of a file named
common-stub.c or alike. If names need to be different, can't we follow
boot.c's model and introduce a per-arch efi/stub.h which stub.c would
include at a suitable position (and which right now would be empty for
Arm)?

> Avoid using $(EFIOBJ-y) as an alias for $(clean-files), add
> common_stub.c directly to $(clean-files).
> 
> Fixes: 7f96859b0d00 ("xen: reuse x86 EFI stub functions for Arm")
> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> ---
> 
> For the cflag addition in non-ARM_EFI, I was tempted to apply it to
> the whole directory instead of just stub.o. (Even if there's only a
> single object). I think that would be enough to overwrite the
> -fshort-wchar from efi-common.mk, but I forgot what cflags come after
> that. But adding it to just one object mean that it's added at the
> last possible moment.
> ---
>  xen/arch/arm/efi/Makefile                | 8 ++------
>  xen/arch/x86/efi/Makefile                | 2 +-
>  xen/common/efi/efi-common.mk             | 4 ++--
>  xen/arch/x86/efi/stub.c                  | 7 -------
>  xen/common/efi/{stub.c => common_stub.c} | 6 ++++++

At the very least I'd like to request to avoid the underscore in the
file name.

Jan



 


Rackspace

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