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

Re: [XEN PATCH v7 04/51] build: factorise generation of the linker scripts


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Tue, 7 Sep 2021 15:22:25 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Tue, 07 Sep 2021 14:22:33 +0000
  • Ironport-hdrordr: A9a23:hhJAtKxiDUUl0/HmY+nLKrPw6L1zdoMgy1knxilNoHxuH/Bw9v re+cjzsCWftN9/Yh4dcLy7VpVoIkmsl6Kdg7NwAV7KZmCP1FdARLsI0WKI+UyCJ8SRzI9gPa cLSdkFNDXzZ2IK8PoTNmODYqodKNrsytHWuQ/HpU0dKT2D88tbnn9E4gDwKDwQeCB2QaAXOb C7/cR9qz+paR0sH7+G7ilsZZmkmzXT/qiWGCI7Ow==
  • Ironport-sdr: LA5RXG2VTDD8kaiTVULn1g4JGu2Bryc+aJ6sVvCuW0cZfV2HVkIJMXEF2ovF84au77QyqyCTXi 2w+8JQoFDrYi+if5XpC3Ir3oTRiUNC0u/GRVm4vyE2aaMWJApUSbiEVgAxPRMWQzWmF4QcIEMi Heh1Hv8Ivfq0eifXuVngLVTxGrOc10YYy6V8kPem6zJxnVYeuLVQF/zlvZ3vJ1jRoRNoNZ8JV2 Lq6vKpA2ZAfgESnfdZrR8eMfV6dWfWGmH/X+Ncc1fmByG7dCxMibFJIUDvGgxkhoHkr4rqE3Kj Dn58NISckNv3LcyM//YrhEfv
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

(dropping most CC)

On Tue, Aug 24, 2021 at 11:49:51AM +0100, Anthony PERARD wrote:
> In Arm and X86 makefile, generating the linker script is the same, so
> we can simply have both call the same macro.
> 
> We need to add *.lds files into extra-y so that Rules.mk can find the
> .*.cmd dependency file and load it.
> 
> Change made to the command line:
> - Use cpp_flags macro which simply filter -Wa,% options from $(a_flags).
> - Added -D__LINKER__ even it is only used by Arm's lds.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Hi Julian,

Could you give a Ack to this patch? I think it only misses an ack from
Arm maintainers.

And if you don't mind, could you commit it with the two other arm patch
that are ready?

  - build,arm: move LDFLAGS change to arch.mk
    ( you proposed to edit the commit message before committing )
  - build: avoid building arm/arm/*/head.o twice

Cheers,

> ---
>  xen/Rules.mk          | 4 ++++
>  xen/arch/arm/Makefile | 6 ++++--
>  xen/arch/x86/Makefile | 6 ++++--
>  3 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/Rules.mk b/xen/Rules.mk
> index eaf770414305..3f61682ceab7 100644
> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -255,6 +255,10 @@ cmd_cpp_s_S = $(CPP) $(call cpp_flags,$(a_flags)) -MQ $@ 
> -o $@ $<
>  %.s: %.S FORCE
>       $(call if_changed,cpp_s_S)
>  
> +# Linker scripts, .lds.S -> .lds
> +quiet_cmd_cpp_lds_S = LDS     $@
> +cmd_cpp_lds_S = $(CPP) -P $(call cpp_flags,$(a_flags)) -D__LINKER__ -MQ $@ 
> -o $@ $<
> +
>  # Add intermediate targets:
>  # When building objects with specific suffix patterns, add intermediate
>  # targets that the final targets are derived from.
> diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
> index 3d3b97b5b440..0edd9dee6f49 100644
> --- a/xen/arch/arm/Makefile
> +++ b/xen/arch/arm/Makefile
> @@ -66,6 +66,8 @@ obj-y += vpsci.o
>  obj-y += vuart.o
>  extra-y += $(TARGET_SUBARCH)/head.o
>  
> +extra-y += xen.lds
> +
>  #obj-bin-y += ....o
>  
>  ifneq ($(CONFIG_DTB_FILE),"")
> @@ -133,8 +135,8 @@ $(TARGET)-syms: prelink.o xen.lds
>  .PHONY: include
>  include:
>  
> -xen.lds: xen.lds.S
> -     $(CPP) -P $(a_flags) -D__LINKER__ -MQ $@ -o $@ $<
> +xen.lds: xen.lds.S FORCE
> +     $(call if_changed,cpp_lds_S)
>  
>  dtb.o: $(patsubst "%",%,$(CONFIG_DTB_FILE))
>  

-- 
Anthony PERARD



 


Rackspace

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