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

Re: [XEN PATCH v7 17/51] build: set XEN_BUILD_EFI earlier


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Mon, 11 Oct 2021 15:21:48 +0100
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 11 Oct 2021 14:22:31 +0000
  • Ironport-data: A9a23:IHucNKjvvNryy0h0qeoF7K/xX161qRcKZh0ujC45NGQN5FlHY01je htvWz/TPamDZ2Tzedtxa4zipBsP7MSHxoU2GQBl/iBmQ34b9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oAMKRCQ7InQLlbGILes1htZGEk0FU/NtTo5w7Rg29Yx2IDga++wk YiaT/P3aQfNNwFcagr424rbwP+4lK2v0N+wlgVWicFj5DcypVFMZH4sDfjZw0/DaptVBoaHq 9Prl9lVyI97EyAFUbtJmp6jGqEDryW70QKm0hK6UID66vROS7BbPg/W+5PwZG8O4whlkeydx /12nI6UGSsEL5aRmbhFUQR6TRpfJ6dJreqvzXiX6aR/zmXDenrohf5vEFs3LcsT/eMf7WNmr KJCbmpXN1ba2rzwkOnTpupE36zPKOHiOp8fvXdxiynUF/88TbjIQrnQ5M8e1zA17ixLNauCN 5pFMmU+BPjGSyBPOkoaEJEhoP6hg0jNNAZEhEu34qVitgA/yyQuieOwYbI5YOeiVchT20qVu G/C12D4GQ0BcsySzyKf9XChjfOJmjn0MKoNEJWo+/gsh0ecrkQRAhALUVqwodGil1WzHdlYL iQpFjEG9PZoshbxF5+kAkP+8CXsUgMgt8R4KMQozFGh57vvvgfFXmoZbGB6ScYsu5pjLdA17 WOhk9T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VJ4VHg9iYvSwgUNHiS2i91Ep8RzLIWxt9B9MIGwwYtTCSYvExu NBW1rywKJH5x04g7vhf3KW+phxIqGeQZ293ANsBbx7EKMzIu7GCenA7t9bnmFuz9EnyKGaxY62 QcmZ+NA9Fg5/cg876rli/8/1/LQiQ3xBq/sqyx7pOEkEtDrEZtYluVYF8DA+NJ3uFJFLfKkxLm H0LgScduu6gG2FgRwSCylLgFUCd8C0V2YPs0Dls1CBKiJurnFbtJTy2UjP1c8KWrqo4yfYAu4E bedmutbtEJhH44pY5eTDLmaA
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Oct 07, 2021 at 06:14:33PM +0200, Jan Beulich wrote:
> On 24.08.2021 12:50, Anthony PERARD wrote:
> > $(nr-fixups) is renamed to $(efi-check-relocs) as the former might be
> > a bit too generic.
> 
> While I don't mind the prefix addition, may I please ask that the rest
> of the name remain as is, i.e. $(efi-nr-fixups)? "nr" because that's
> what the variable holds, and "fixups" to distinguish from full-fledged
> relocations as well as to match commentary there.

Will change.

> > --- a/xen/arch/x86/Makefile
> > +++ b/xen/arch/x86/Makefile
> > @@ -123,41 +123,7 @@ $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
> >     mv $(TMP) $(TARGET)
> >  
> >  ifneq ($(efi-y),)
> > -
> > -# Check if the compiler supports the MS ABI.
> > -export XEN_BUILD_EFI := $(shell $(CC) $(XEN_CFLAGS) -c efi/check.c -o 
> > efi/check.o 2>/dev/null && echo y)
> >  CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
> > -
> > -# Check if the linker supports PE.
> > -EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(XEN_LDFLAGS)) --subsystem=10
> > -XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(call ld-option,$(EFI_LDFLAGS) 
> > --image-base=0x100000000 -o efi/check.efi efi/check.o))
> > -# If the above failed, it may be merely because of the linker not dealing 
> > well
> > -# with debug info. Try again with stripping it.
> > -ifeq ($(CONFIG_DEBUG_INFO)-$(XEN_BUILD_PE),y-n)
> > -EFI_LDFLAGS += --strip-debug
> > -XEN_BUILD_PE := $(call ld-option,$(EFI_LDFLAGS) --image-base=0x100000000 
> > -o efi/check.efi efi/check.o)
> > -endif
> > -
> > -ifeq ($(XEN_BUILD_PE),y)
> > -
> > -# Check if the linker produces fixups in PE by default
> > -nr-fixups := $(shell $(OBJDUMP) -p efi/check.efi | grep 
> > '^[[:blank:]]*reloc[[:blank:]]*[0-9][[:blank:]].*DIR64$$' | wc -l)
> > -ifeq ($(nr-fixups),2)
> > -MKRELOC := :
> > -relocs-dummy :=
> > -else
> > -MKRELOC := efi/mkreloc
> > -relocs-dummy := efi/relocs-dummy.o
> > -# If the linker produced fixups but not precisely two of them, we need to
> > -# disable it doing so.  But if it didn't produce any fixups, it also 
> > wouldn't
> > -# recognize the option.
> > -ifneq ($(nr-fixups),0)
> > -EFI_LDFLAGS += --disable-reloc-section
> > -endif
> > -endif
> > -
> > -endif # $(XEN_BUILD_PE)
> > -
> >  endif # $(efi-y)
> 
> Is the remaining if(,) block still warranted? I.e. can't the single line
> 
> CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
> 
> live without the surrounding conditional?

Let's see, $(efi-y) depends on CONFIG_PV_SHIM_EXCLUSIVE and `sudo make
install`, but XEN_BUILD_EFI also depends on CONFIG_PV_SHIM_EXCLUSIVE and
we don't want to build in `sudo make install` so CFLAGS shouldn't be
used. So the single line without the if() block seems enough. I remove
the surrounding conditional.

Thanks,

-- 
Anthony PERARD



 


Rackspace

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