From patchwork Mon Sep 14 10:15:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 11773487 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 5A007112E for ; Mon, 14 Sep 2020 10:17:43 +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 3987D2076C for ; Mon, 14 Sep 2020 10:17:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3987D2076C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass 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.92) (envelope-from ) id 1kHlWb-0004L6-8w; Mon, 14 Sep 2020 10:15:53 +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.92) (envelope-from ) id 1kHlWZ-0004L0-JC for xen-devel@lists.xenproject.org; Mon, 14 Sep 2020 10:15:51 +0000 X-Inumbo-ID: 2ff8d569-5982-4986-b1d9-65d333359bd9 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2ff8d569-5982-4986-b1d9-65d333359bd9; Mon, 14 Sep 2020 10:15:40 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 76EC8AD21; Mon, 14 Sep 2020 10:15:55 +0000 (UTC) Subject: [PATCH 1/9] build: use if_changed more consistently (and correctly) for prelink*.o From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Julien Grall , Stefano Stabellini , George Dunlap References: Message-ID: <75d94bf1-b419-8a82-2d15-fb02e56109d8@suse.com> Date: Mon, 14 Sep 2020 12:15:39 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Switch to $(call if_changed,ld) where possible; presumably not doing so in e321576f4047 ("xen/build: start using if_changed") right away was an oversight, as it did for Arm in (just) one case. It failed to add prelink.o to $(targets), though, causing - judging from the observed behavior on x86 - undue rebuilds of the final binary (because of prelink.o getting rebuild for $(cmd_prelink.o) being empty, in turn because of .prelink.o.cmd not getting read) during "make install-xen". Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné Acked-by: Julien Grall --- xen/arch/arm/Makefile | 4 +++- xen/arch/x86/Makefile | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 51173d97127e..296c5e68bbc3 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -95,12 +95,14 @@ prelink_lto.o: $(ALL_OBJS) # Link it with all the binary objects prelink.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o - $(LD) $(XEN_LDFLAGS) -r -o $@ $^ + $(call if_changed,ld) else prelink.o: $(ALL_OBJS) FORCE $(call if_changed,ld) endif +targets += prelink.o + $(TARGET)-syms: prelink.o xen.lds $(LD) $(XEN_LDFLAGS) -T xen.lds -N prelink.o \ $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0 diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 74152f2a0dad..9b368632fb43 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -136,19 +136,21 @@ prelink_lto.o: $(ALL_OBJS) $(LD_LTO) -r -o $@ $^ # Link it with all the binary objects -prelink.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o $(EFI_OBJS-y) - $(LD) $(XEN_LDFLAGS) -r -o $@ $^ +prelink.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o $(EFI_OBJS-y) FORCE + $(call if_changed,ld) -prelink-efi.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o - $(LD) $(XEN_LDFLAGS) -r -o $@ $^ +prelink-efi.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o FORCE + $(call if_changed,ld) else -prelink.o: $(ALL_OBJS) $(EFI_OBJS-y) - $(LD) $(XEN_LDFLAGS) -r -o $@ $^ +prelink.o: $(ALL_OBJS) $(EFI_OBJS-y) FORCE + $(call if_changed,ld) -prelink-efi.o: $(ALL_OBJS) - $(LD) $(XEN_LDFLAGS) -r -o $@ $^ +prelink-efi.o: $(ALL_OBJS) FORCE + $(call if_changed,ld) endif +targets += prelink.o prelink-efi.o + $(TARGET)-syms: prelink.o xen.lds $(LD) $(XEN_LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \ $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0