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

Re: [XEN PATCH v7 42/51] build: grab common EFI source files in arch specific dir


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 14 Oct 2021 10:51:44 +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=8ad7+q8AoTrQdO1jeRZH1euZa6JslHRFbQaEbpMjJv8=; b=WT7cwjIxYcRB3mMeT87revGmckVQV8n3YDlPJG2jRM8nGYyzwDs1MK9zt7JF50UJ6QqTgcJp+SYG+N9YDgpqbE6LVaBwrDukQF1qWVtgo6emT1FP4EWojRMJ+0kd8yLnDQJBjzkosu7H3C9OHCuDpsdFL6If5vWlyMqpOJ3j9q8LmEePtyZsO0Gwju9fWNvNu9Db6i2vdqxszX4kGgf4QFcsR4P5+ZkP9ScBwFvr+s5hxQCRbI/4GX6/oqw03OexbuSOxXEqYYCQDNE1DncQZ6A8e/ag19ZnnE7vKmBR1tZ8srexTtzQwsQv1YOYFiLkh8oPvZ9DMQn7ZzeXiggQ+A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Aemzji6Rph7MEUM8U4OsAk5LNYivHUUhD0yJBizK9n5Ng3r9/gf1gsnEMfeGY92PAxckmrfqbJRKyYEtoqtl4aIOCFy52+e2ZzBGzXzb/3RVdkGF1RAws5mZYdsVC9TTtzi3pvTSOr/GvPzVTVEA0FF94Qxx7K59fs5CmSEsHJqck78XliK+ANLbwg6wHLGZr9Y5HToHNiMFV/zv+7OmDWL5h3sgdZuFhmAA78Acj+vFx2XUtsyerdZcSjKLOzmRyAhi405+h/F/H/Ssnu2sLwckHqNW5aCoI1GYJ2hiFggUBuBEekR4Rm+xgPXk3Trs41GSCXNmia1g3ph/KQW8CA==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 14 Oct 2021 08:51:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.08.2021 12:50, Anthony PERARD wrote:
> Rather than preparing the efi source file, we will copy them as needed
> from the build location.
> 
> Avoid the links as they seems fragile in out-of-tree builds. Also by
> making a copy, we don't need to figure out the relative path or we
> don't need to use absolute path.

I agree that symlinks wouldn't be nice for the out-of-tree build case.
Otoh please see
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=8c6740616cd244e5763e974cb737affbe71db385
albeit I'll admit the situation was a little different there because
it's pre-built files which get populated into the build tree.

> --- a/xen/arch/arm/efi/Makefile
> +++ b/xen/arch/arm/efi/Makefile
> @@ -1,4 +1,10 @@
>  CFLAGS-y += -fshort-wchar
> +CFLAGS-y += -I$(srctree)/common/efi

Perhaps another opportunity for -iquote?

>  obj-y += boot.init.o pe.init.o ebmalloc.o runtime.o
>  obj-$(CONFIG_ACPI) +=  efi-dom0.init.o
> +
> +$(obj)/%.c: common/efi/%.c
> +     $(Q)cp -f $< $@

In case both trees are on the same file system, trying to hardlink first
would seem desirable. When copying, I think you should also pass -p.

> --- a/xen/arch/x86/efi/Makefile
> +++ b/xen/arch/x86/efi/Makefile
> @@ -1,4 +1,5 @@
>  CFLAGS-y += -fshort-wchar
> +CFLAGS-y += -I$(srctree)/common/efi
>  
>  quiet_cmd_objcopy_o_ihex = OBJCOPY $@
>  cmd_objcopy_o_ihex = $(OBJCOPY) -I ihex -O binary $< $@
> @@ -19,3 +20,8 @@ obj-$(XEN_BUILD_EFI) := $(filter-out %.init.o,$(EFIOBJ-y))
>  obj-bin-$(XEN_BUILD_EFI) := $(filter %.init.o,$(EFIOBJ-y))
>  extra-$(XEN_BUILD_EFI) += buildid.o relocs-dummy.o
>  nocov-$(XEN_BUILD_EFI) += stub.o
> +
> +$(obj)/%.c: common/efi/%.c
> +     $(Q)cp -f $< $@
> +
> +.PRECIOUS: $(obj)/%.c

Seeing you repeat everything here, despite it not being all this much I
wonder if there wouldn't better be a makefile fragment in common/efi/
which all interested architectures' arch/<arch>/efi/Makefile would then
include. This could then also subsume -fshort-wchar.

Jan




 


Rackspace

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