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

Re: [Xen-devel] [PATCH 2/2] x86/EFI: use less crude way of generating the build ID



> --- a/xen/arch/x86/Makefile
> +++ b/xen/arch/x86/Makefile
> @@ -158,24 +158,30 @@ $(TARGET).efi: VIRT_BASE = 0x$(shell $(N
>  $(TARGET).efi: ALT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A 
> ALT_START$$,,p')
>  # Don't use $(wildcard ...) here - at least make 3.80 expands this too early!
>  $(TARGET).efi: guard = $(if $(shell echo efi/dis* | grep disabled),:)
> +
>  ifneq ($(build_id_linker),)
> -$(TARGET).efi: note.o
> +ifeq ($(call ld-ver-build-id,$(LD) $(EFI_LDFLAGS)),y)
> +CFLAGS += -DBUILD_ID_EFI
> +EFI_LDFLAGS += $(build_id_linker)
> +note_file := efi/buildid.o
> +else
>  note_file := note.o
> +endif
>  else
>  note_file :=
>  endif
>  
> -$(TARGET).efi: prelink-efi.o efi.lds efi/relocs-dummy.o 
> $(BASEDIR)/common/symbols-dummy.o efi/mkreloc
> +$(TARGET).efi: prelink-efi.o $(note_file) efi.lds efi/relocs-dummy.o 
> $(BASEDIR)/common/symbols-dummy.o efi/mkreloc
>       $(foreach base, $(VIRT_BASE) $(ALT_BASE), \
>                 $(guard) $(LD) $(call EFI_LDFLAGS,$(base)) -T efi.lds -N $< 
> efi/relocs-dummy.o \
> -                     $(BASEDIR)/common/symbols-dummy.o -o 
> $(@D)/.$(@F).$(base).0 &&) :
> +                     $(BASEDIR)/common/symbols-dummy.o $(note_file) -o 
> $(@D)/.$(@F).$(base).0 &&) :
>       $(guard) efi/mkreloc $(foreach base,$(VIRT_BASE) 
> $(ALT_BASE),$(@D)/.$(@F).$(base).0) >$(@D)/.$(@F).0r.S
>       $(guard) $(NM) -pa --format=sysv $(@D)/.$(@F).$(VIRT_BASE).0 \
>               | $(guard) $(BASEDIR)/tools/symbols $(all_symbols) --sysv 
> --sort >$(@D)/.$(@F).0s.S
>       $(guard) $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).0r.o 
> $(@D)/.$(@F).0s.o
>       $(foreach base, $(VIRT_BASE) $(ALT_BASE), \
>                 $(guard) $(LD) $(call EFI_LDFLAGS,$(base)) -T efi.lds -N $< \
> -                     $(@D)/.$(@F).0r.o $(@D)/.$(@F).0s.o -o 
> $(@D)/.$(@F).$(base).1 &&) :
> +                     $(@D)/.$(@F).0r.o $(@D)/.$(@F).0s.o $(note_file) -o 
> $(@D)/.$(@F).$(base).1 &&) :
>       $(guard) efi/mkreloc $(foreach base,$(VIRT_BASE) 
> $(ALT_BASE),$(@D)/.$(@F).$(base).1) >$(@D)/.$(@F).1r.S
>       $(guard) $(NM) -pa --format=sysv $(@D)/.$(@F).$(VIRT_BASE).1 \
>               | $(guard) $(BASEDIR)/tools/symbols $(all_symbols) --sysv 
> --sort >$(@D)/.$(@F).1s.S
> @@ -185,8 +191,8 @@ $(TARGET).efi: prelink-efi.o efi.lds efi
>       if $(guard) false; then rm -f $@; echo 'EFI support disabled'; fi
>       rm -f $(@D)/.$(@F).[0-9]*
>  
> -efi/boot.init.o efi/runtime.o efi/compat.o: 
> $(BASEDIR)/arch/x86/efi/built_in.o
> -efi/boot.init.o efi/runtime.o efi/compat.o: ;
> +efi/boot.init.o efi/runtime.o efi/compat.o efi/buildid.o: 
> $(BASEDIR)/arch/x86/efi/built_in.o
> +efi/boot.init.o efi/runtime.o efi/compat.o efi/buildid.o: ;
>  
>  asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c
>       $(CC) $(filter-out -flto,$(CFLAGS)) -S -o $@ $<
> --- a/xen/arch/x86/efi/Makefile
> +++ b/xen/arch/x86/efi/Makefile
> @@ -9,6 +9,9 @@ efi := $(if $(efi),$(shell $(CC) $(filte
>  efi := $(if $(efi),$(shell $(LD) -mi386pep --subsystem=10 -o check.efi 
> check.o 2>disabled && echo y))
>  efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); 
> $(call create,runtime.o)))
>  
> -extra-$(efi) += boot.init.o relocs-dummy.o runtime.o compat.o
> +extra-$(efi) += boot.init.o relocs-dummy.o runtime.o compat.o buildid.o
> +
> +%.o: %.ihex
> +     $(OBJCOPY) -I ihex -O binary $< $@
>  



Under  Ubuntu 14.04.4 this fails compilation:


make[4]: *** No rule to make target `buildid.o', needed by `stub.o'.
Stop.


The properties of Ubuntu 14.04.4 are:
konrad@ubuntu:~/xen$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
konrad@ubuntu:~/xen/xen$ ld --version
GNU ld (GNU Binutils for Ubuntu) 2.24
konrad@ubuntu:~/xen/xen$ ld -mi386pep
ld: no input files

konrad@ubuntu:~/xen/xen$ cat /etc/debian_version 
jessie/sid

Hadn't dug in this.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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