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

Re: [Xen-devel] [PATCH] build: remove shim related targets



On Tue, Feb 20, 2018 at 02:04:24AM -0700, Jan Beulich wrote:
> >>> On 20.02.18 at 09:23, <roger.pau@xxxxxxxxxx> wrote:
> > There's no need to have shim specific targets, so just use the regular
> > xen makefile targets in order to build the shim binary.
> > 
> > When the shim is build as part of the firmware directory use the
> > xen-syms as the shim binary.
> 
> Why the (much larger) xen-syms instead of xen?

IIRC Andrew argued that he would like the installed shim to contain
symbols. I've used xen-syms in order to replicate current
functionality, which installs a xen-shim binary with the symbols.

In the new version of this patch I plan to use xen, and install
xen-syms in the DEBUG_DIR.

> > --- a/tools/firmware/xen-dir/Makefile
> > +++ b/tools/firmware/xen-dir/Makefile
> > @@ -48,10 +48,10 @@ shim-%config: $(D) FORCE
> >             KCONFIG_CONFIG=$(CURDIR)/shim.config
> >  
> >  xen-shim: $(D) shim-olddefconfig
> > -   $(MAKE) -C $(D)/xen install-shim \
> > +   $(MAKE) -C $(D)/xen build \
> 
> install-xen ?

If the install target is used it's more complicated to fetch the
symbols file afterwards, because it's going to contain the Xen version
in the name. The symbols file when using the install target is at:

$(DESTDIR)$(DEBUG_DIR)/xen-syms-$(XEN_FULLVERSION)

And obtaining XEN_FULLVERSION from the xen-shim build makefile is not
trivial.

> >             XEN_CONFIG_EXPERT=y \
> > -           KCONFIG_CONFIG=$(CURDIR)/shim.config \
> > -           DESTDIR=$(CURDIR)
> > +           KCONFIG_CONFIG=$(CURDIR)/shim.config
> > +   cp $(D)/xen/xen-syms xen-shim
> 
> ln? Or do here what was done ...

I can certainly use ln.

> > @@ -149,11 +149,6 @@ $(TARGET)-syms: prelink.o xen.lds 
> > $(BASEDIR)/common/symbols-dummy.o
> >             >$(@D)/$(@F).map
> >     rm -f $(@D)/.$(@F).[0-9]*
> >  
> > -# Use elf32-x86-64 if toolchain support exists, elf32-i386 otherwise.
> > -$(TARGET)-shim: FORMAT = $(firstword $(filter elf32-x86-64,$(shell 
> > $(OBJCOPY) --help)) elf32-i386)
> > -$(TARGET)-shim: $(TARGET)-syms
> > -   $(OBJCOPY) -O $(FORMAT) $< $@
> 
> ... here so far? The removal of this step would otherwsie require
> more explanation - I recall having inquired about this before: If
> there was a reason for doing this, if shouldn't be dropped without
> saying why the other binary is now suddenly fine, but wasn't back
> then. Or alternatively it would need to be clarified that this step
> was indeed pointless.

I will add the following to the commit message:

"The objcopy step of the shim build is also removed in this patch:
since the shim is booted in PVH mode there's no need for the resulting
binary to be in elf32 format. Xen can load PVH kernels with either a
32 or 64bit elf header."

Thanks, Roger.

_______________________________________________
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®.