Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp86625yba; Mon, 20 May 2019 05:28:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbMppC/pr6dbHS8qAOhSDVklzTqTGe6d7mk/8UsI1LvfMrE3ZqhCKhTY9jeazGIfCs4+2S X-Received: by 2002:a17:902:4101:: with SMTP id e1mr77614373pld.25.1558355324287; Mon, 20 May 2019 05:28:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558355324; cv=none; d=google.com; s=arc-20160816; b=fKxJ33ePsDm6hcoX3I/ciiR+zByqdPdmxhWbO5te8jF+es4Xk2ME4zchmsCM942EBG 5+4oIJkGsHIGAgvQsPRy8sVHvFtH2h8huYAdfH/zs6nMHBuocf4pn0V/6fQX5GuIg/kk k2U9re7192p8Utj8WAVld2QOBC4EHyBUa5Fae11T6LsoZCTe7lvwQ6dOm+2tnvVx6l/s KxJ16HyVXJaGsP7B8P9HLdmTbM5DAC+cIf+NyEzn4Vai8/Oh07KOJps18l63lldSCQDv aSIYkMSRI2Rzl1YfA5v0S04WQ/+6On7nf6GA25fsCIUX8HV7XuHrd52+PwY4GNyINYpN cIcg== 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=TUPNSHossysRuj+WUqYIBYEPJWe2qyjuO0314sIaUp8=; b=zrtXjc4Eu5AZqtacpP/txQgx9R6N3doiaMvZxKKS7pbbQ7RqJWbaJx0nEGOET4h42E ZXaas36RyIPMtjn4YwKdg1YVHcaSzpvqcyAQTBrBJadUp9/LTI78Y9pLMr33KVCCdiyj eNeCbCCmISHzx3Rimo4yy/e5oTVco7i0n2wUmV+BJyQrmR2n0vuvzRIjZCbVhtRp+hxO 8mHuc+iof8Nc1ZTxMBTqOCIs8PfQILwpVNRaP4g+fLBG91mIcKuH67jPc/8uW5aF3GLY Z7w8z6Qf3RzrQhDNQtPALj1uMDXm/gxtTRkLMoy7R4LfSGeht3GpbSW3DD3djOW7zYOG zXtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B6qyOIyX; 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 l73si19817519pfb.126.2019.05.20.05.28.29; Mon, 20 May 2019 05:28:44 -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=B6qyOIyX; 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 S2389133AbfETMZk (ORCPT + 99 others); Mon, 20 May 2019 08:25:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:40830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389122AbfETMZj (ORCPT ); Mon, 20 May 2019 08:25:39 -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 12372216FD; Mon, 20 May 2019 12:25:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558355138; bh=09QVKkQqMoheB3aUsH33wCiXmOFBHYceqh6lQ2WyUM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B6qyOIyXwgqtXWestOv1a6pepEiLfTB/Xmh6LFtylDfQ+IrcZgsnz7C8Zvi8k8NZi 8SQKkS59uuEhBXyqZSpMZ466pbe8SNcpELmKSbDApn9ybeOtBNP+TNRWC+Z8KVKwrZ kf0J+Nw7bYc7Y3j8wXxsHIC02O5QKg78TKSwlKa0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada Subject: [PATCH 4.19 095/105] kbuild: turn auto.conf.cmd into a mandatory include file Date: Mon, 20 May 2019 14:14:41 +0200 Message-Id: <20190520115253.800079090@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115247.060821231@linuxfoundation.org> References: <20190520115247.060821231@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 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 @@ -623,7 +623,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 # To avoid any implicit rule to kick in, define an empty command $(KCONFIG_CONFIG): ;