From patchwork Mon May 20 12:15:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 164626 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp234964ili; Mon, 20 May 2019 05:38:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwN82kIy54YFEiY18xw2PBfPNEswj0iVDckFolopwj1mCO2IkC+9XraVs2VTW68zfACexR+ X-Received: by 2002:a63:b70f:: with SMTP id t15mr73065021pgf.351.1558355889169; Mon, 20 May 2019 05:38:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558355889; cv=none; d=google.com; s=arc-20160816; b=Jyig8GN1/xL7ieNR6zh1TfFGGHMkdUiBUThMma9S37imRQmR3lgH2SbEblRFa5TK3U Wd9vPJ/xX6bSiAESflMVu12ENExbqWZtZ+YOuCRASzhrVqc6Y2Al9w9Mol4gjJi32TbO hHKY1EbHL5d832gzXgCoKIPff4HUvIgpXpUUDdxsQmbQPjHK+XP/c4lnutwhXeTxuNXL aB9Faf8yuiavVCOjtUYNxHIUcSfaCzrpKuD4c9dlc6Avxz1jsQFsCijJ9aH0TuAkCTnr 6ZuO6QQoX2BWLRKLXHIwRK9YujKliYelk6AMETPnlyn7ZU87NBqXfD2S4Fc0MPTVjVHF Y7Kg== 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=aLSPy0PJB38nhyugiEAD0hlO+VUpL6qZFyx1bRcfjE0=; b=xl3z3EBnGYECpfdup/kAP5Pjg6smvsSLWJREPXtbOm6N3h3wAySfWY/EI1dmZx9gVz UONFzAQoGd0qi2IpV4m6XvqvA3Ert3UZQSurS3YM1Ggfl87afhvms5JKLXH5GMUa0JRR 6HlmX4coGmPHjzCPUUJQaoehsryqr4YKDfT/ZDSjO/xu8eSPME3dNxrZMAm6tyXMEP4F fCRMoLFPsjuFCXig2OD2WBg7jzNtLEw1qh2HU9VEGU995Q4NHHFVOQqQAMZHQre2jQHx z1H3w5wDUpauNeS9qqXu6tts8yaHKOC5y1fOmrhZ+CaZuUM4joYhpzKS/QmYIpUzQA8E wLPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uJhRrHBQ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e11si12396932pgv.569.2019.05.20.05.38.07; Mon, 20 May 2019 05:38:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=uJhRrHBQ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391250AbfETMgS (ORCPT + 14 others); Mon, 20 May 2019 08:36:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:55306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391078AbfETMgR (ORCPT ); Mon, 20 May 2019 08:36:17 -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 513C721479; Mon, 20 May 2019 12:36:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558355775; bh=zPcvc2akhzzKrUb6urgykNTe+6gmgSw6iONcU2LWsAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uJhRrHBQyili9eWRFYyuh9S5tUnX1SWuJu///hB/1ZonBxBsv8ijx8J8ccJRFTyzv iLGVhO0oURVOxLW18S9+p39CGpXOwIqIu7L31d/98TcfM+azBuZOVNBV/IAI+gVWVO UcUArI1ZiSvpB0hx7WUow0j+99DVByZeKIb8QQ4w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada Subject: [PATCH 5.1 120/128] kbuild: turn auto.conf.cmd into a mandatory include file Date: Mon, 20 May 2019 14:15:07 +0200 Message-Id: <20190520115256.794907347@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115249.449077487@linuxfoundation.org> References: <20190520115249.449077487@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada commit d2f8ae0e4c5c754f1b2a7b8388d19a1a977e698a upstream. syncconfig is responsible for keeping auto.conf up-to-date, so if it fails for any reason, the build must be terminated immediately. However, since commit 9390dff66a52 ("kbuild: invoke syncconfig if include/config/auto.conf.cmd is missing"), Kbuild continues running even after syncconfig fails. You can confirm this by intentionally making syncconfig error out: # diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c # index 08ba146..307b9de 100644 # --- a/scripts/kconfig/confdata.c # +++ b/scripts/kconfig/confdata.c # @@ -1023,6 +1023,9 @@ int conf_write_autoconf(int overwrite) # FILE *out, *tristate, *out_h; # int i; # # + if (overwrite) # + return 1; # + # if (!overwrite && is_present(autoconf_name)) # return 0; Then, syncconfig fails, but Make would not stop: $ make -s mrproper allyesconfig defconfig $ make scripts/kconfig/conf --syncconfig Kconfig *** Error during sync of the configuration. make[2]: *** [scripts/kconfig/Makefile;69: syncconfig] Error 1 make[1]: *** [Makefile;557: syncconfig] Error 2 make: *** [include/config/auto.conf.cmd] Deleting file 'include/config/tristate.conf' make: Failed to remake makefile 'include/config/auto.conf'. SYSTBL arch/x86/include/generated/asm/syscalls_32.h SYSHDR arch/x86/include/generated/asm/unistd_32_ia32.h SYSHDR arch/x86/include/generated/asm/unistd_64_x32.h SYSTBL arch/x86/include/generated/asm/syscalls_64.h [ continue running ... ] The reason is in the behavior of a pattern rule with multi-targets. %/auto.conf %/auto.conf.cmd %/tristate.conf: $(KCONFIG_CONFIG) $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig GNU Make knows this rule is responsible for making all the three files simultaneously. As far as examined, auto.conf.cmd is the target in question when this rule is invoked. It is probably because auto.conf.cmd is included below the inclusion of auto.conf. The inclusion of auto.conf is mandatory, while that of auto.conf.cmd is optional. GNU Make does not care about the failure in the process of updating optional include files. I filed this issue (https://savannah.gnu.org/bugs/?56301) in case this behavior could be improved somehow in future releases of GNU Make. Anyway, it is quite easy to fix our Makefile. Given that auto.conf is already a mandatory include file, there is no reason to stick auto.conf.cmd optional. Make it mandatory as well. Cc: linux-stable # 5.0+ Fixes: 9390dff66a52 ("kbuild: invoke syncconfig if include/config/auto.conf.cmd is missing") Signed-off-by: Masahiro Yamada [commented out diff above to keep patch happy - gregkh] Signed-off-by: Greg Kroah-Hartman --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/Makefile +++ b/Makefile @@ -636,7 +636,7 @@ ifeq ($(may-sync-config),1) # Read in dependencies to all Kconfig* files, make sure to run syncconfig if # changes are detected. This should be included after arch/$(SRCARCH)/Makefile # because some architectures define CROSS_COMPILE there. --include include/config/auto.conf.cmd +include include/config/auto.conf.cmd $(KCONFIG_CONFIG): @echo >&2 '***'