From patchwork Sun May 12 02:13:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 163987 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:142:0:0:0:0 with SMTP id j2csp4156883ilr; Sat, 11 May 2019 19:14:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsg2vNuUvT3whmZ3lQSSp08ujOjD8j1JxE3aAC4oXuYElRGPMmavZxs3qICEKdYXIHYyH6 X-Received: by 2002:a63:6ac1:: with SMTP id f184mr24166311pgc.25.1557627251095; Sat, 11 May 2019 19:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557627251; cv=none; d=google.com; s=arc-20160816; b=EPR5Th7xcfnX5OH52KP9nJsTXb80A1iTDOGg0P6ZdVYeWuguEs+WmXfLkEkPHDsYc3 j/JO6oW7oZooIMlSCRa9NdE+IeaAH5jneoqE0vQUoE1Xsu6WxCw+vAuKN4FNy4AJxw7C mcQDd0rjI5M9Q9t5CGrzXpVERvQO9Dz8Q4vYLqYBfHI2oom0KfFsKxux7/Fx4j2B/xkl svPotJ8rtgmmsA53HQV4zLq1uwRb822GXXoDx97cacA/FS3kUCs95T/T76PeE3nwQYzy u9HAaGOkB5Oi1SNBIBUUkdJuRrF1T3P8cqNlwb0oyofOGaAEw/8Ew3JzzbEYRAZXR5Z1 9Szg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=HT7N5KQynOISRob2nuhdaPV2dSqCV0OywG41XQ0vP2I=; b=otY9vpFliszIdOJ/hVV4WXrEJdmiC92KAQw6+SOKVmEZyja27Igwt3J88cPDDh13v1 f7wodDXJXIvvQUMWU8AQizUo4ma0bJGq+6UKdgUVzS9lTzkk40vs5CzIv2wPhfBpPO/C b5kgOuSnzOpxa7d5m3Na7IFxbkxkCgkBD5DJCaCtGsgfMfn4qqBsOU8GGCMFjS9DLh6U prtne13cVn7dTF+hXQCiZO+Qazk78IYHtPFMfEL1IZlR+sUTfBW7+TecpJq6EFYp5VRt 5ZetTuvBpO1Rqn1mTDxd2Lo/7frjOu99KOwUKlMx0ZuUFAXoYrR4X96XpXBsnVTvFyh6 Pndw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=jOFtMHrZ; 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 d4si14663035pla.358.2019.05.11.19.14.08; Sat, 11 May 2019 19:14:11 -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=@nifty.com header.s=dec2015msa header.b=jOFtMHrZ; 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 S1726415AbfELCOG (ORCPT + 30 others); Sat, 11 May 2019 22:14:06 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:42085 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726128AbfELCOF (ORCPT ); Sat, 11 May 2019 22:14:05 -0400 Received: from grover.flets-west.jp (softbank126125154139.bbtec.net [126.125.154.139]) (authenticated) by conuserg-07.nifty.com with ESMTP id x4C2Du0v027760; Sun, 12 May 2019 11:13:56 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x4C2Du0v027760 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1557627236; bh=HT7N5KQynOISRob2nuhdaPV2dSqCV0OywG41XQ0vP2I=; h=From:To:Cc:Subject:Date:From; b=jOFtMHrZ+Asp8XqMopIcuYEZaGneI6siKLcl/FmuXUBKAMAZtFlhWzz6o5XNYJ28r 8FO8AyAHghhxmDXzPisJY56udfj44pyeXg9pCp78GFFmAvftwFvwoU4R8OTkQe2//c 6r25S2j0AhMcX+uWPJ5rKifZApH4e8jAZBLKukKEhpVsHlzJLsuX8UY+tOUf1R5y7b iibDms3yVxl2Z6CiJObMKXfgLGa6QT1OG0CE29eA1pN8OD7JUQN9e8gkh+WFvG7u/d roG62hPHufaroyQHEJ/Wn7P+EaxUKpXm0XgN9TCsJrfv6ClGxjHdOPTRgXNM4mi2CV 6BJAwq+6sN8dg== X-Nifty-SrcIP: [126.125.154.139] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: turn auto.conf.cmd into a mandatory include file Date: Sun, 12 May 2019 11:13:48 +0900 Message-Id: <1557627228-28896-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 the 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 target files simultaneously. As far as exampled, the target in question when this rule is invoked is auto.conf.cmd probably because it is included (line 654) below the inclusion of auto.conf (line 603). The inclusion of auto.conf is mandatory, while that of auto.conf.cmd is optional. GNU Make does not care about the failure during updating optional include files. I filed this issue (https://savannah.gnu.org/bugs/?56301) in case this behavior could be improved somehow. 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. Fixes: 9390dff66a52 ("kbuild: invoke syncconfig if include/config/auto.conf.cmd is missing") Signed-off-by: Masahiro Yamada --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 3b93010..9542165 100644 --- a/Makefile +++ b/Makefile @@ -651,7 +651,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 '***'