Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2760734ybh; Mon, 5 Aug 2019 06:25:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxldILdPeBArpZt4epZmtjzlrt+dkVs7PqhjDFpGJOlE+oPI2hoiV/VvdbAvLfHenvYwBu3 X-Received: by 2002:a17:902:9f93:: with SMTP id g19mr15028151plq.223.1565011543198; Mon, 05 Aug 2019 06:25:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565011543; cv=none; d=google.com; s=arc-20160816; b=HOHMtaLWUS0gnnK6QSm4R1LvdsXn20Y5yY1RtK54656502rAbcEdp5XZunRn0Ig7Kr t53rRwrR/z0zB4ch9sZqY1C1x2ugF6ETuimhIFzbTZz8GIrR6Ptij+ljfhJYB6hjB2I/ vCqi/muBMf4k3AX+IQnm5fZiKVQ2aXjkMZfVZFaySKIhHk6H1Kj1huruQUnYC/GsEIvw hcs91vXvljNR6FBxZOhCATkPhfqrlLEqrZHc43LVC0/PqjR0peUaCjjXC/Bv62ioeuoO TFqy9ZawFYubKw26doDw49guavIn9Okyndheoc8YJWpQOylZgDwfFs+hs+5D5pUyTe9q pSoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MzHeWpXSAanHppALLE5qlVSDJMnWMe0ILaa4kPO+/Fg=; b=zftXpkN0lhWmC7eAJ/qiOwV/b6FhGSykkYI6e2Ug8ll2xChdB/v3fTpL1a0iGywUXO Q2/wHVdum3pSRkW8UZjTljulf27P2OcPyjl42l+S8BxbwBM5jvzGkaXRM3Dqrb6iJ+E2 2mqjVgHs8oTixzOWZSbfn8d4eFticgM1D4PtAockkRmu9bH2mlAO5x/Rp3aougb2qjd0 tZm/ObILvK+XZ6OnqPOPQaRfMxT3woUmdxgNnYNT2Um7PEbI2pEzBn4jigB6JAyqmSnQ HcbIcEbpPBJOYBjZfujFIVUNbHWnrH7sAlkKb50z/i3MQPthacfScZEwPzwaQgb9XVtn HNCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GNwHLwoj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si41048393pln.285.2019.08.05.06.25.27; Mon, 05 Aug 2019 06:25:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GNwHLwoj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730208AbfHENYq (ORCPT + 99 others); Mon, 5 Aug 2019 09:24:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:33230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731062AbfHENYm (ORCPT ); Mon, 5 Aug 2019 09:24:42 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2C50720644; Mon, 5 Aug 2019 13:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565011481; bh=AuWFkT9W+50KDlr1VVDi4qrZYNDIOBbFQEldeM0PpMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GNwHLwojgd6+e3FcF+UHZFXpcKxloDMmzVC2oZAiksPw8zLkLasGeXt/tr/2YgA2M VngJCGnppFu0T8wpK6Yn0MAxAN1I99kXttZjI93bBjrmFfk+JPATWtQOn7qsnxIXD+ QrYCbwQVuKtb33TTHzW6HNztKQGSrubfi7JgUl7Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada Subject: [PATCH 5.2 077/131] kbuild: modpost: include .*.cmd files only when targets exist Date: Mon, 5 Aug 2019 15:02:44 +0200 Message-Id: <20190805124956.954506004@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805124951.453337465@linuxfoundation.org> References: <20190805124951.453337465@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada commit 944cfe9be1fbbec73bab2f7e77fe2e8f9c72970f upstream. If a build rule fails, the .DELETE_ON_ERROR special target removes the target, but does nothing for the .*.cmd file, which might be corrupted. So, .*.cmd files should be included only when the corresponding targets exist. Commit 392885ee82d3 ("kbuild: let fixdep directly write to .*.cmd files") missed to fix up this file. Fixes: 392885ee82d3 ("kbuild: let fixdep directly write to .*.cmd") Cc: # v5.0+ Signed-off-by: Masahiro Yamada Signed-off-by: Greg Kroah-Hartman --- scripts/Makefile.modpost | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -142,10 +142,8 @@ FORCE: # optimization, we don't need to read them if the target does not # exist, we will rebuild anyway in that case. -cmd_files := $(wildcard $(foreach f,$(sort $(targets)),$(dir $(f)).$(notdir $(f)).cmd)) +existing-targets := $(wildcard $(sort $(targets))) -ifneq ($(cmd_files),) - include $(cmd_files) -endif +-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) .PHONY: $(PHONY)