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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 573F8C433FF for ; Mon, 5 Aug 2019 13:24:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 29AEF2075B for ; Mon, 5 Aug 2019 13:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565011488; bh=AuWFkT9W+50KDlr1VVDi4qrZYNDIOBbFQEldeM0PpMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=OraajMCIVu3pN+OU5JxN35k0bW/I2WAHYJEHIoxUoEknSBJgnK8DhSRgxnwOfBoU/ TB3SUKZh6/KavJF7+y1XRQD++/YCk7IKF4wxfNyqom2kpOVIDHO6c8UKe+Bwk+l8M9 zXhugd13vJp5oKlzboXEMdhstuU0jZsJspWLRg5I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731078AbfHENYq (ORCPT ); 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)