From patchwork Tue Nov 19 17:58:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11252535 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ACCD1930 for ; Tue, 19 Nov 2019 18:00:38 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 88E95222EF for ; Tue, 19 Nov 2019 18:00:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="Hz3Dmcnh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 88E95222EF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iX7mL-0003H0-Ez; Tue, 19 Nov 2019 17:59:05 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iX7mK-0003Gv-Nr for xen-devel@lists.xenproject.org; Tue, 19 Nov 2019 17:59:04 +0000 X-Inumbo-ID: 4268a914-0af6-11ea-a300-12813bfff9fa Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 4268a914-0af6-11ea-a300-12813bfff9fa; Tue, 19 Nov 2019 17:58:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1574186338; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=f15TED3wylamRQ0gsHVCJJ/I/g4oKo7p8sotGjCwe0A=; b=Hz3Dmcnhikjh7AN932DU2cZ43WwlEYWSaDNSD+3eBf96MNgMkeLjJm2L jAS2jW2kIL2Vb2ZIPG7rK7eTMSZCs6OdKwgE5ExRTO2BfOaeVPru2rrh7 2rInOj9Vqg50zy1tcFZ0ZikwvdEQvb9j5IPvMmtB2JQMKz33dUUdo8lLm U=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 4/MfOnvcIBKEINT67c2Wrac7Dst4SCDHAL+oISlMKwjKZ2vPMOxtxSjHcXEM1oHEBFu2tc21mq 5dZ8j7TcO+4pDUizBKFDY1r9ag/jIStZ9SNTeiVOzOgOEXaASxbuwJgxDcGskMzoOr0YB5PgAy ngFdgYcHV5rKaRUj8cvG9qQVJBiWTeuBYOTjjoLQz+djfeyUOpehUFW/o+rW0nY/UX6uM0h26q WxYxcBCl46lrkcB8fOy6mCmNSyjgG0PHnKQaSqmLJep2VWQFlBmg3yDuZu0kf+rn/8pXllNCqH 57U= X-SBRS: 2.7 X-MesageID: 8963909 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,218,1571716800"; d="scan'208";a="8963909" From: Anthony PERARD To: Jan Beulich , Date: Tue, 19 Nov 2019 17:58:55 +0000 Message-ID: <20191119175855.1716278-1-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191119165809.GE1425@perard.uk.xensource.com> References: <20191119165809.GE1425@perard.uk.xensource.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH] xen/arch/x86/Makefile: Remove $(guard) use from $(TARGET).efi target X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Following the patch 65d104984c04 ("x86: fix race to build arch/x86/efi/relocs-dummy.o"), the error message nm: 'efi/relocs-dummy.o': No such file" started to appear on system which can't build the .efi target. This is because relocs-dummy.o isn't built anymore. The error is printed by the evaluation of VIRT_BASE and ALT_BASE which aren't use anyway. But, we don't need that file as we don't want to build `$(TARGET).efi' anyway. On such system, $(guard) evaluate to the shell builtin ':', which prevent any of the shell commands in `$(TARGET).efi' from been executed. Even if $(guard) is evaluated opon use, it depends on $(XEN_BUILD_PE) which is evaluated at the assignment. So, we can replace $(guard) in $(TARGET).efi by having two different rules depending on $(XEN_BUILD_PE) instead. The change with this patch is that none of the dependency of $(TARGET).efi will be built if the linker doesn't support PE and VIRT_BASE and ALT_BASE don't get evaluated anymore, so nm will not complain about the missing relocs-dummy.o file anymore. Since prelink-efi.o isn't built on system that can't build $(TARGET).efi anymore, we can remove the $(guard) variable everywhere. Reported-by: Jan Beulich Signed-off-by: Anthony PERARD Reviewed-by: Jan Beulich --- xen/arch/x86/Makefile | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index a6df19e901b3..a0b2f4ab1577 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -120,20 +120,20 @@ prelink_lto.o: $(ALL_OBJS) $(LD_LTO) -r -o $@ $^ prelink-efi_lto.o: $(ALL_OBJS) efi/runtime.o efi/compat.o - $(guard) $(LD_LTO) -r -o $@ $(filter-out %/efi/built_in.o,$^) + $(LD_LTO) -r -o $@ $(filter-out %/efi/built_in.o,$^) # Link it with all the binary objects prelink.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o $(LD) $(LDFLAGS) -r -o $@ $^ prelink-efi.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink-efi_lto.o efi/boot.init.o - $(guard) $(LD) $(LDFLAGS) -r -o $@ $^ + $(LD) $(LDFLAGS) -r -o $@ $^ else prelink.o: $(ALL_OBJS) $(LD) $(LDFLAGS) -r -o $@ $^ prelink-efi.o: $(ALL_OBJS) efi/boot.init.o efi/runtime.o efi/compat.o - $(guard) $(LD) $(LDFLAGS) -r -o $@ $(filter-out %/efi/built_in.o,$^) + $(LD) $(LDFLAGS) -r -o $@ $(filter-out %/efi/built_in.o,$^) endif $(TARGET)-syms: prelink.o xen.lds @@ -178,8 +178,6 @@ CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI $(TARGET).efi: VIRT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A VIRT_START$$,,p') $(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 $(filter y,$(XEN_BUILD_PE)),,:) ifneq ($(build_id_linker),) ifeq ($(call ld-ver-build-id,$(LD) $(filter -m%,$(EFI_LDFLAGS))),y) @@ -197,27 +195,31 @@ note_file := endif note_file_option ?= $(note_file) +ifeq ($(filter y,$(XEN_BUILD_PE)),y) $(TARGET).efi: prelink-efi.o $(note_file) efi.lds efi/relocs-dummy.o efi/mkreloc $(foreach base, $(VIRT_BASE) $(ALT_BASE), \ - $(guard) $(LD) $(call EFI_LDFLAGS,$(base)) -T efi.lds -N $< efi/relocs-dummy.o \ + $(LD) $(call EFI_LDFLAGS,$(base)) -T efi.lds -N $< efi/relocs-dummy.o \ $(BASEDIR)/common/symbols-dummy.o $(note_file_option) -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 + efi/mkreloc $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(@D)/.$(@F).$(base).0) >$(@D)/.$(@F).0r.S + $(NM) -pa --format=sysv $(@D)/.$(@F).$(VIRT_BASE).0 \ + | $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort >$(@D)/.$(@F).0s.S + $(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 $< \ + $(LD) $(call EFI_LDFLAGS,$(base)) -T efi.lds -N $< \ $(@D)/.$(@F).0r.o $(@D)/.$(@F).0s.o $(note_file_option) -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 - $(guard) $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1r.o $(@D)/.$(@F).1s.o - $(guard) $(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T efi.lds -N $< \ + efi/mkreloc $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(@D)/.$(@F).$(base).1) >$(@D)/.$(@F).1r.S + $(NM) -pa --format=sysv $(@D)/.$(@F).$(VIRT_BASE).1 \ + | $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort >$(@D)/.$(@F).1s.S + $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1r.o $(@D)/.$(@F).1s.o + $(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T efi.lds -N $< \ $(@D)/.$(@F).1r.o $(@D)/.$(@F).1s.o $(note_file_option) -o $@ - if $(guard) false; then rm -f $@; echo 'EFI support disabled'; \ - else $(NM) -pa --format=sysv $(@D)/$(@F) \ - | $(BASEDIR)/tools/symbols --xensyms --sysv --sort >$(@D)/$(@F).map; fi + $(NM) -pa --format=sysv $(@D)/$(@F) \ + | $(BASEDIR)/tools/symbols --xensyms --sysv --sort >$(@D)/$(@F).map rm -f $(@D)/.$(@F).[0-9]* $(@D)/..$(@F).[0-9]* +else +$(TARGET).efi: FORCE + rm -f $@; echo 'EFI support disabled' +endif efi/boot.init.o efi/runtime.o efi/compat.o efi/buildid.o efi/relocs-dummy.o: $(BASEDIR)/arch/x86/efi/built_in.o efi/boot.init.o efi/runtime.o efi/compat.o efi/buildid.o efi/relocs-dummy.o: ;