From patchwork Thu Jun 4 10:22:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 11587703 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 0945F1391 for ; Thu, 4 Jun 2020 10:23:53 +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 E2BE5206C3 for ; Thu, 4 Jun 2020 10:23:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2BE5206C3 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 1jgn0v-0007vp-2W; Thu, 04 Jun 2020 10:22:21 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jgn0t-0007vk-J1 for xen-devel@lists.xenproject.org; Thu, 04 Jun 2020 10:22:19 +0000 X-Inumbo-ID: 44a9d7dc-a64d-11ea-9947-bc764e2007e4 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 44a9d7dc-a64d-11ea-9947-bc764e2007e4; Thu, 04 Jun 2020 10:22:18 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id AB93BB157; Thu, 4 Jun 2020 10:22:20 +0000 (UTC) To: "xen-devel@lists.xenproject.org" From: Jan Beulich Subject: [PATCH] build: fix dependency tracking for preprocessed files Message-ID: Date: Thu, 4 Jun 2020 12:22:11 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 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: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Paul Durrant , Andrew Cooper , Ian Jackson , George Dunlap Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" While the issue is more general, I noticed that asm-macros.i not getting re-generated as needed. This was due to its .*.d file mentioning asm-macros.o instead of asm-macros.i. Use -MQ here as well, and while at it also use -MQ to avoid the somewhat fragile sed-ary on the *.lds dependency tracking files. While there, further avoid open-coding $(CPP) and drop the bogus -Ui386. Signed-off-by: Jan Beulich --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -201,13 +201,13 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(call if_changed,obj_init_o) quiet_cmd_cpp_i_c = CPP $@ -cmd_cpp_i_c = $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) $< -o $@ +cmd_cpp_i_c = $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) $< -o $@ -MQ $@ quiet_cmd_cc_s_c = CC $@ cmd_cc_s_c = $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -S $< -o $@ quiet_cmd_s_S = CPP $@ -cmd_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) $< -o $@ +cmd_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) $< -o $@ -MQ $@ %.i: %.c FORCE $(call if_changed,cpp_i_c) --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -123,9 +123,7 @@ asm-offsets.s: $(TARGET_SUBARCH)/asm-off $(CC) $(filter-out -flto,$(c_flags)) -S -o $@ $< xen.lds: xen.lds.S - $(CC) -P -E -Ui386 $(a_flags) -o $@ $< - sed -e 's/xen\.lds\.o:/xen\.lds:/g' <.xen.lds.d >.xen.lds.d.new - mv -f .xen.lds.d.new .xen.lds.d + $(CPP) -P $(a_flags) -o $@ -MQ $@ $< dtb.o: $(CONFIG_DTB_FILE) --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -244,9 +244,7 @@ $(BASEDIR)/include/asm-x86/asm-macros.h: efi.lds: AFLAGS-y += -DEFI xen.lds efi.lds: xen.lds.S - $(CC) -P -E -Ui386 $(filter-out -Wa$(comma)%,$(a_flags)) -o $@ $< - sed -e 's/.*\.lds\.o:/$(@F):/g' <.$(@F).d >.$(@F).d.new - mv -f .$(@F).d.new .$(@F).d + $(CPP) -P $(filter-out -Wa$(comma)%,$(a_flags)) -o $@ -MQ $@ $< boot/mkelf32: boot/mkelf32.c $(HOSTCC) $(HOSTCFLAGS) -o $@ $<