From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59A5CC43464 for ; Mon, 21 Sep 2020 11:40:24 +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 A7A772071A for ; Mon, 21 Sep 2020 11:40:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xen.org header.i=@xen.org header.b="WlyBPNZp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7A772071A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org 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 1kKKAh-0007NE-17; Mon, 21 Sep 2020 11:39:51 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kKKAg-0007N9-BR for xen-devel@lists.xenproject.org; Mon, 21 Sep 2020 11:39:50 +0000 X-Inumbo-ID: 8f0a9483-388e-456a-a704-a94c2b0ddf4b Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8f0a9483-388e-456a-a704-a94c2b0ddf4b; Mon, 21 Sep 2020 11:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=XsK6/RZCmM7OzaHfvKKDgUYwUULbRrGtcwIWNtCJ0q4=; b=WlyBPNZpFFHoua1HwhNmAJMXeA ySa2f0jMfKu3lstezNLK0jS3vKPJj4dbvqmmePneJxFmcA8aC3cjFnUhoDwIpa0CREOMHUTSAFvCs Y7ln21wvHMBBPZdxtM4ohiO2uOT8t8fHMqat9CcoCjAjnHrGhzPr9ldOR1CnrKwewFFs=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kKKAd-0007lO-0J; Mon, 21 Sep 2020 11:39:47 +0000 Received: from [54.239.6.185] (helo=a483e7b01a66.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kKKAc-0006gq-IN; Mon, 21 Sep 2020 11:39:46 +0000 Subject: Re: Ping: [PATCH 1/9] build: use if_changed more consistently (and correctly) for prelink*.o To: Jan Beulich , Stefano Stabellini Cc: "xen-devel@lists.xenproject.org" , Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , George Dunlap References: <75d94bf1-b419-8a82-2d15-fb02e56109d8@suse.com> From: Julien Grall Message-ID: <43a4240c-baba-ca52-0a9f-a884c0f297be@xen.org> Date: Mon, 21 Sep 2020 12:39:44 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit 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" Hi Jan, On 21/09/2020 11:17, Jan Beulich wrote: > On 14.09.2020 12:15, Jan Beulich wrote: >> 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 >> --- >> xen/arch/arm/Makefile | 4 +++- >> xen/arch/x86/Makefile | 18 ++++++++++-------- >> 2 files changed, 13 insertions(+), 9 deletions(-) > > May I ask for an Arm-side ack (or otherwise) here, please? Acked-by: Julien Grall Cheers, > > Jan > >> 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 >> > -- Julien Grall