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

Re: [Xen-devel] [XEN PATCH v3 20/23] xen/build: factorise generation of the linker scripts



On Thu, Mar 05, 2020 at 12:05:02PM +0100, Jan Beulich wrote:
> On 26.02.2020 12:33, Anthony PERARD wrote:
> > --- a/xen/Rules.mk
> > +++ b/xen/Rules.mk
> > @@ -230,6 +230,14 @@ cmd_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) 
> > $< -o $@
> >  %.s: %.S FORCE
> >     $(call if_changed,cpp_s_S)
> >  
> > +# Linker scripts, .lds.S -> .lds
> > +quiet_cmd_cc_lds_S = LDS     $@
> > +define cmd_cc_lds_S
> > +    $(CC) -P -E -Ui386 $(filter-out -Wa$(comma)%,$(a_flags)) -o $@ $<; \
> 
> $(CPP)? And then also name the thing cmd_cpp_lds_S?

Will do.

> > +    sed -e 's/.*\.lds\.o:/$(@F):/g' <$(dot-target).d >$(dot-target).d.new; 
> > \
> > +    mv -f $(dot-target).d.new $(dot-target).d
> 
> This would benefit from also switching to move-if-changed at
> this occasion.

I don't think using move-if-changed here is a good idea. The *.lds file
should be generated if it's dependency *.lds.S changed.

move-if-changed might prevent some rebuild, but the *.lds file will be
rebuild over and over again. I think move-if-changed is only useful if a
file needs to be generated at every make invocation.

> With you using "define" - is there really a need for adding the
> trailing "; \" sequence to the first two lines of the macro?

I think it is, but I'll check again if it's necessary. Maybe just ';' is
enough.

> > --- a/xen/arch/x86/Makefile
> > +++ b/xen/arch/x86/Makefile
> > @@ -75,6 +75,7 @@ obj-y += hpet.o
> >  obj-y += vm_event.o
> >  obj-y += xstate.o
> >  extra-y += asm-macros.i
> > +extra-y += xen.lds
> >  
> >  x86_emulate.o: x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h
> >  
> > @@ -197,6 +198,7 @@ endif
> >  note_file_option ?= $(note_file)
> >  
> >  ifeq ($(XEN_BUILD_PE),y)
> > +extra-y += efi.lds
> 
> Would be nice if this was moved up using
> 
> extra-$(XEN_BUILD_PE) += efi.lds

I can try, but XEN_BUILD_PE is defined in the middle of the Makefile, so
I wouldn't be able to move that with the other obj-y and extra-y
definitions.

Thanks,

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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