Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1003915yba; Thu, 4 Apr 2019 02:11:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0aoB4qZqvz/jKf4gdbv1nhVuRuMftfIyuBgT1ixUDICLMBxEtWnCUiYxCPRvVBPWZmYy6 X-Received: by 2002:a17:902:a3:: with SMTP id a32mr5120192pla.45.1554369111344; Thu, 04 Apr 2019 02:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554369111; cv=none; d=google.com; s=arc-20160816; b=Ld2KLI0oiabVedTdt0IRWtAkMjmrrC0pq7k9zU5puN0aGKMek+YTjg9Vuw4op+b/77 wfhov8VhYXbTM8kmOjXMj503nPAdf+gO8usYsBZJ49g1XkatiYg3xpvBu1QY8V+PW6nc x0Kwtbcl0YDR7uyqwikF4yAnN/nXAnL7SqntvajAUKP8GUUBpOn9r0SXZjnLAYR+9k3S rz1tZAczVNLzr1l/g46IigVt9Dgbz65e0lgjMKToShAJWD1dGe+zbZLcQ4oNHX99cRlV Z7ZA7zuPrge6onPdDNMWUNemM+EApboSqzwVbRVtCuwcxgyiHLCVRmD8dZh9tlq0XuW2 JzYQ== 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=p8jucDzWc3mx4zL5RjLiF0JVsrkzVI+p0chCiMG5N/Y=; b=ly8sZDaDM6yt9HoJXJ6sGL6ZVlGIju9VvDtBEXX5j7JiwG3r6MgkEJvThZsocsy4gW yDrqV+nTh2pJ/vRFb43s3vOC93cAyncS5H+9A1CMFVFXWViDgLDC85gjB3S9yRdbxWYP Cgxziamwh3Xg4loMveoB3LmLj3zvbNbLx2KqZhNXQgOr/wugJeYe1XasahTL4GDt7jxh Ya2bM6SeZfQg85gTlZ3CBqIhUv/5y8tEWYVpdBSTezswjF8ShfyxAHbzwdM16WsVjVLk Oj66K+2K4hdH4DCQh06GYUthW/6vKjlv7R5rSrVUtxP5mj6UIuhYbevb+5r6eF1iWUIQ 0fqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JOtTagEX; 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 q20si15719146plr.136.2019.04.04.02.11.36; Thu, 04 Apr 2019 02:11:51 -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=JOtTagEX; 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 S1732690AbfDDJLG (ORCPT + 99 others); Thu, 4 Apr 2019 05:11:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:50892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733092AbfDDJLE (ORCPT ); Thu, 4 Apr 2019 05:11:04 -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 C2D5121741; Thu, 4 Apr 2019 09:11:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554369063; bh=s0vpPu9zIq1jMCw7y5JqrkxotCHJEXTVH7zh4zm+HjU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JOtTagEXfFBl4t1k+LtDEsfd1i2y9QBEe02GJCjOQKrwGr8BxQXQKqDXji8OyfBuz xGU3hXS8xHbfOkR2e7U/eceJhZPjbDaceoelBVXQ+VsN0UFyzwcKCCaAkH3+z7Jlkv mlzdwojObN37/9mMdiGhzSMuCTVFgG//AVlUJ8fA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Sasha Levin Subject: [PATCH 5.0 069/246] kbuild: invoke syncconfig if include/config/auto.conf.cmd is missing Date: Thu, 4 Apr 2019 10:46:09 +0200 Message-Id: <20190404084621.560171007@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084619.236418459@linuxfoundation.org> References: <20190404084619.236418459@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 5.0-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 9390dff66a52d1a60c6e517d8fa6cdbdffc83cb1 ] If include/config/auto.conf.cmd is lost for some reasons, it is not self-healing, so the top Makefile misses to run syncconfig. Move include/config/auto.conf.cmd to the target side. I used a pattern rule instead of a normal rule here although it is a bit gross. If the rule were written with a normal rule like this, include/config/auto.conf \ include/config/auto.conf.cmd \ include/config/tristate.conf: $(KCONFIG_CONFIG) $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig ... syncconfig would be executed per target. Using a pattern rule makes sure that syncconfig is executed just once because Make assumes the recipe will create all of the targets. Here is a quote from the GNU Make manual [1]: "Pattern rules may have more than one target. Unlike normal rules, this does not act as many different rules with the same prerequisites and recipe. If a pattern rule has multiple targets, make knows that the rule's recipe is responsible for making all of the targets. The recipe is executed only once to make all the targets. When searching for a pattern rule to match a target, the target patterns of a rule other than the one that matches the target in need of a rule are incidental: make worries only about giving a recipe and prerequisites to the file presently in question. However, when this file's recipe is run, the other targets are marked as having been updated themselves." [1]: https://www.gnu.org/software/make/manual/html_node/Pattern-Intro.html Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3ee390feea61..6d542aede778 100644 --- a/Makefile +++ b/Makefile @@ -625,12 +625,15 @@ ifeq ($(may-sync-config),1) -include include/config/auto.conf.cmd # To avoid any implicit rule to kick in, define an empty command -$(KCONFIG_CONFIG) include/config/auto.conf.cmd: ; +$(KCONFIG_CONFIG): ; # The actual configuration files used during the build are stored in # include/generated/ and include/config/. Update them if .config is newer than # include/config/auto.conf (which mirrors .config). -include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd +# +# This exploits the 'multi-target pattern rule' trick. +# The syncconfig should be executed only once to make all the targets. +%/auto.conf %/auto.conf.cmd %/tristate.conf: $(KCONFIG_CONFIG) $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig else # External modules and some install targets need include/generated/autoconf.h -- 2.19.1