On Tue, Apr 01, 2025 at 03:47:03PM +0100, Andrew Cooper wrote:
> diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
> index 129a109d6ec5..811adf3567c4 100644
> --- a/xen/arch/arm/Makefile
> +++ b/xen/arch/arm/Makefile
> @@ -96,21 +96,19 @@ ifeq ($(CONFIG_ARM_64),y)
>       ln -sf $(@F) $@.efi
>  endif
>  
> +$(TARGET)-syms: XEN_LDFLAGS += -T $(obj)/xen.lds

I would advise againts this change. Target-specific variables values
tend to apply to prerequist as well, so XEN_LDFLAGS will also be
modified when building prelink.o and xen.lds. It's might be ok in this
case because xen.lds doesn't use it, and prelink.o happen to be linked
in a different Makefile, but that's kind of setting a trap for someone
to fall into.

There's a keyword to keep the variable change strictly to $(TARGET)-syms
but that requires a more recent version of GNU make. That would be
"private" if we could use it. Looks like we need GNU make 3.82 to use
"private":
    "GNU make 3.82 is now available"
    https://lists.gnu.org/archive/html/info-gnu/2010-07/msg00023.html

>  $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
> -     $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
> -         $(objtree)/common/symbols-dummy.o -o $(dot-target).0
> +     $(LD) $(XEN_LDFLAGS) $< $(objtree)/common/symbols-dummy.o -o 
> $(dot-target).0

Cheers,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

Reply via email to