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

Re: [XEN PATCH v8 27/47] build: grab common EFI source files in arch specific dir


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 19 Jan 2022 08:46:09 +0100
  • 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=gK2tpSNIlHt8JUBdl8amXvbyMv2LkCQhitl+LQjc0ag=; b=FisOFqpKisHecGY13zyHJfun2XmRC2Ms2NowkN34BnwW8UfkmE92v/ok9zAcVc10UST5QcF1C80EgtgbIkQt3/TAl/30KIonku9S4r8KwO4V9jMV0XO/QvG6k0EuVqYRfqHWyvx80SG4Ewcj+ia2NBHrAyRd4DR1kJsnNGVAfXYagWE9cuyI01QJbLAfqGay1wrHe9jxB5wy1lhViEXkHAeuWw1fpuhDBy5iOeHdl8VkCXaAeE44RUADJvVzexKfPCQSsiQL/SJj9+6kMgXwrNvY0OyMaJwIKw/WhVCOdYZeBxoBk0IWbw8Zvp6WIG3hO+tQUu1CYrlmaHyo0jWorg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KWKBPr+PnfWUjRqDusi+YP4HMfydH5GDttc++5+af1+gt8GBuz1d47BNtee9GY28Wd9o1iNqFb36O06ES0kfQm7JYSA6+NyWrYPfzwRkl6sWzK4xlwEm8RSax/RSyu3lz81mETv65WhBHRbsBfbF+0GW7WMBMftmo5mKU2YcVHy73mTKbHXYa0LhVhkaftjPReJiTwQh2PMZLdo3TnUHGV5h0lPcWaJzAJTHfgae7gCMED/aI+1EMtw4t2FVZNt+5tgStsRjeCcJBgtrubMYcR/2gGINZAzBxeYbfE8gGCoFex4ivYA4Tzv8B0Bb2fe8C2whtP0IpwuSVDxBeXUgIg==
  • 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>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 19 Jan 2022 07:46:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.01.2022 17:21, Anthony PERARD wrote:
> On Tue, Jan 18, 2022 at 11:06:38AM +0000, Anthony PERARD wrote:
>> On Tue, Dec 21, 2021 at 02:53:49PM +0100, Jan Beulich wrote:
>>> On 25.11.2021 14:39, Anthony PERARD wrote:
>>>> +$(obj)/%.c: $(abs_srctree)/common/efi/%.c FORCE
>>>> +  $(Q)ln -nfs $< $@
>>>
>>> Like was the case before, I think it would be better if the links were
>>> relative ones, at least when srctree == objtree (but ideally always).
>>
>> I can give it a try.
> 
> How about:
>     ln -nfs $(subst $(space),/,$(patsubst %,..,$(subst /, ,$(obj))))/$(if 
> $(building_out_of_srctree),source/)common/efi/$(<F) $@
> 
> This will result in the relative path "../../../common/efi/runtime.c"
> for in-tree builds, and "../../../source/common/efi/runtime.c" for
> out-of-tree builds. There's a "source" symlink that can be used which
> point to the source tree when doing out-of-tree builds.
> 
> The part:
>     $(subst $(space),/,$(patsubst %,..,$(subst /, ,$(obj))))
> means that if $(obj) were to be something other than "arch/*/efi", the
> command would still works and give the right number of "../".
> It does this steps to "arch/x86/efi":
>     arch x86 efi
>     .. .. ..
>     ../../..

Looks good to me.

> The added "source/" depends on whether we do out-of-tree build or not.

Well, I guess we're free to add a "source => ." symlink even in the
in-tree build case, deviating slightly from what Linux does? That
would then slightly simplify your construct.

Jan




 


Rackspace

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