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

Re: [XEN PATCH v2] build: Fix x86 out-of-tree build without EFI


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 17 Aug 2022 16:29: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=DZJKcAwlEU1qoI2pdE7e9hyJXL3XadLkHJccRGdxfV8=; b=S38kdqsLNKD4P6fo4PhH5Z13oUfZWQC65YiIwnhW9oB3RMeJHcJt7BdIKXUAFI/4E4tSRYebLgV5ZlHmoVQ0cAeSP9dxqB+zqRnL5yA/QhEFEpySqpMI5EO1ItEU0wjRBOaaJhVnbnVLQzbVfcacdsUfTV02tyJx5KYvq6YewKoMAcqsWr4x1I83TjEVtDWqH9nVNjr1LKZsGjWZ+H2XDWfTuKnWaZUBIK7CEjP72rTX3E7TL3Dl75NCr9CEaxjN6ePTNCZfQjze7mGLiMF4bTZQnsGFFSRj/uwe/eE7673QZF7IHv+vY3AL74rSc43cONvgigRMN006T5baQMKxlQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k6plZabQs8vGsIxp1Y/9RMaxia+LbleTd+MXt9ihkD3xNl8BknBDfttx4l4UtpJZJIiZflAIAmx1FJatFpw9ndaBnh+ggp16on7u/nd0RbTD1o7WmfXonEE3EVaJKns6GWmAmmgb7ZyKQi7dD1EhyFB6OYtzdk0xHR+BedEnqe1r4VtDfUi+HacFK9/150k46ZvEbm2Bl1h4hMG4hBt7dcWz1CsghjXQs3AN/ZkrgpkyT1Jwg2opJR8eevcU+k0DA0ATq5SGrzJ4DjlV4SS+9DYewLwR+Qdka/1y1GCUdwNLg5KuPM+C/FHWzkk68dIUnt9CvTE6HB1wRfy/ORZOag==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 17 Aug 2022 14:29:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17.08.2022 16:12, Anthony PERARD wrote:
> On Wed, Aug 17, 2022 at 12:38:36PM +0200, Jan Beulich wrote:
>> On 17.08.2022 11:15, Anthony PERARD wrote:
>>> --- a/xen/common/efi/efi-common.mk
>>> +++ b/xen/common/efi/efi-common.mk
>>> @@ -9,9 +9,9 @@ CFLAGS-y += -iquote $(srcdir)
>>>  # e.g.: It transforms "dir/foo/bar" into successively
>>>  #       "dir foo bar", ".. .. ..", "../../.."
>>>  $(obj)/%.c: $(srctree)/common/efi/%.c FORCE
>>> -   $(Q)test -f $@ || \
>>> -       ln -nfs $(subst $(space),/,$(patsubst %,..,$(subst /, 
>>> ,$(obj))))/source/common/efi/$(<F) $@
>>> +   $(Q)ln -nfs $(subst $(space),/,$(patsubst %,..,$(subst /, 
>>> ,$(obj))))/source/common/efi/$(<F) $@
>>
>> I'm afraid the commit message hasn't made clear to me why this part of
>> the change is (still) needed (or perhaps just wanted). The rest of this
>> lgtm now, thanks.
> 
> There's an explanation in the commit message, quoted here:
>>>  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".

Hmm, yes, I had guessed that this might be it, but I wasn't able to make
the connection, sorry.

> The problem with `test -f $@` it doesn't test what we think it does. It
> doesn't test for the presence of a regular file in the source tree as
> stated in the original tree.

I didn't think it would to that. $@ is the target of the rule, and the
(pattern) target explicitly points into the build tree, by way of using
$(obj).

> First, `test -f` happily follow symlinks.

Which is of no relevance here, afaict.

> Second, $@ is always going to point to the build dir, as GNU Make will
> try to not make changes to the source tree, if I understand the logic
> correctly.
> 
> Instead of `test -f`, we could probably remove the "FORCE" from the
> prerequisite, but there's still going to be an issue if there's a file
> with the same name in both common and per-arch directory, when the common
> file is newer.

This would be a mistake now, wouldn't it? I did add "(still)" in my earlier
reply for the very reason that it looks to me as if this change might have
been an attempt to address the issue without any renaming.

> So `test -f` needs to go.

I'm sorry to conclude that for now I continue to only see that its removal
does no harm (hence the "(or perhaps just wanted)" in my original reply),
but I still don't see that it's strictly needed. Therefore I'm okay with
the change as is, but I don't view the description as quite clear enough
in this one regard.

Jan



 


Rackspace

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