Received: by 10.223.185.116 with SMTP id b49csp2398195wrg; Mon, 12 Feb 2018 08:56:41 -0800 (PST) X-Google-Smtp-Source: AH8x224gODbHKFWaMgx2Sq1arYk7zmoB/n9JBSqwt8O9iLvbaBQPns4KJKIY2WND5qVpuNpWgoUw X-Received: by 10.98.209.8 with SMTP id z8mr12252850pfg.240.1518454601804; Mon, 12 Feb 2018 08:56:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518454601; cv=none; d=google.com; s=arc-20160816; b=jJq368tHxglB7op0KjubtRz4bwe+/YSz2dl3h+wdL5BIU7fG55B0Uq2sigavLNStqu V898xmIpJoWEJ6jVPz/yIOhZscd0Y+7XhICQVmOKxqTFb3UMsFzs5aUXjEKumoPbGzfZ 6BDn819+DHRptdyWcx3+EEmR9+4oq6iFOr/QMgFRoD85lvKdwvZXobGAhY4tuLLvIgn8 gScUW3YijgiUFqbVIHA9neG+sfzf1Z5QB4T86UAQUUSbZhKdVviwNBiCZWv2usyNEHlG iXDxJpMheHu67P4x0cj/BRAhn9TBSnJrE5j2Mnu1OJbSWGE4utaXiMZ1zetzOWy/iVHJ vR9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=5PonHrL+WGPaGecsQWWUmMN5nIM70rRNdPhxCdE51Ws=; b=jA/6EvNAtl5PNbO8jRenkMiNxT2MQoVPga64J0kuajw5psWzmnQ52KguKxKcLnnkac kCxy7bSUO1rpnjU5zc6Hz5D7w9dKwWWVHTTns3kAcBkOrskO11OhSUQ5ggQJECkBd0fR uhxkwnKPUBrpnXVxg3MbQgnmqNU6vG1ieCBo3z12eGm9p6CsuhJrOk8eD0cTGFuDA9Wm ks70pZuqBPHkUM3bizWmEOEHMJf159FOmffknn9ADcBaJX5FYFKxwrxwEcVvNElPp7Dm P7UoB2rXnC731CbLqC6Jb2dGQ5ChEEQQOfz0JDTTr2V30LhNmTdlU3l7QlBEOC4cVPs/ JC5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=I2SDl96m; 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 l1si1809676pga.408.2018.02.12.08.56.26; Mon, 12 Feb 2018 08:56:41 -0800 (PST) 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=I2SDl96m; 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 S1752774AbeBLPX2 (ORCPT + 99 others); Mon, 12 Feb 2018 10:23:28 -0500 Received: from conssluserg-02.nifty.com ([210.131.2.81]:36847 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752281AbeBLPXY (ORCPT ); Mon, 12 Feb 2018 10:23:24 -0500 Received: from mail-vk0-f45.google.com (mail-vk0-f45.google.com [209.85.213.45]) (authenticated) by conssluserg-02.nifty.com with ESMTP id w1CFNIp6008882; Tue, 13 Feb 2018 00:23:19 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com w1CFNIp6008882 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1518448999; bh=5PonHrL+WGPaGecsQWWUmMN5nIM70rRNdPhxCdE51Ws=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=I2SDl96m6xkVIiKjnnJu8pf/ZiWMWIxWhjKkeaarqHClb2kzGUHExsqhF3YJln9uC GeYOKwOKVLvm0FP4EEI40dB4h3GIyXHeh5+1Fm7rCusMpJtcriBIBDzWv+vxfQXavd i/2gMEVDc4hXPOk0VGr5CPNcwmyHCFxPafZd0bc23F9HQS2iK7hxwxIEJTwCwUrmRv 2wsmMnpJ51Zq6IWsiyItS34Ny4VYYr2VrcbKYdQyWH2r8AeUQCXCJkKf3zTi4w1F5E aUA9yl0zKtQkeKlyjxO4cFxOWReAMphquukJLVmTuKQ7i9U1ddxqs5JTSGC+ciJWoO we75Vn0xKXR+A== X-Nifty-SrcIP: [209.85.213.45] Received: by mail-vk0-f45.google.com with SMTP id t126so1840801vkb.11; Mon, 12 Feb 2018 07:23:19 -0800 (PST) X-Gm-Message-State: APf1xPCChT4T2GlFgaf5c6o84TvBRiTBSZDWkI3K/x1YuoUK3n8XpXRh NAqcMEtcusAfenMeire1LUzzwuZo6geWh/kk8R4= X-Received: by 10.31.235.132 with SMTP id j126mr10104403vkh.193.1518448998121; Mon, 12 Feb 2018 07:23:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.83.212 with HTTP; Mon, 12 Feb 2018 07:22:37 -0800 (PST) In-Reply-To: References: <20180210085519.737ckf4bcl57h4g2@huvuddator> <20180211103432.pf2ot6nd7nbhdhsy@huvuddator> <20180212125458.vb4ve3ieejvuvo65@huvuddator> From: Masahiro Yamada Date: Tue, 13 Feb 2018 00:22:37 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 4/7] kconfig: support new special property shell= To: Ulf Magnusson Cc: Kees Cook , Linus Torvalds , Linux Kbuild mailing list , Greg Kroah-Hartman , Andrew Morton , Nicolas Pitre , "Luis R . Rodriguez" , Randy Dunlap , Sam Ravnborg , Michal Marek , Martin Schwidefsky , Pavel Machek , linux-s390 , Jiri Kosina , Linux Kernel Mailing List , Tejun Heo , Ingo Molnar , "Van De Ven, Arjan" , Arnd Bergmann Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-02-12 23:53 GMT+09:00 Ulf Magnusson : > On Mon, Feb 12, 2018 at 3:21 PM, Masahiro Yamada > wrote: >> 'syncconfig' in a more proper name > > Wonder if --update-config-files-for-build or something would be an > even better name. I want to use a name that ends with 'config' like any other config targets because: - I want use the same name for scripts/kconfig/conf option and Makefile target to take advantage of 'simple-targets' [1] - I want to use pattern rule to descend into scripts/kconfig/ [2] [1] https://github.com/torvalds/linux/blob/v4.16-rc1/scripts/kconfig/Makefile#L84 [2] https://github.com/torvalds/linux/blob/v4.16-rc1/Makefile#L506 It would be possible to directly descend into scripts/kconfig/ like follows, but I do not have a good reason to break the convention. include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd $(Q)$(MAKE) $(build)=scripts/kconfig update-config-files-for-build > > Kinda tough to compress it into something that adheres to *nix > terseness while making it somewhat clear what kind of stuff it deals > with. :P > > Cheers, > Ulf > > On Mon, Feb 12, 2018 at 3:21 PM, Masahiro Yamada > wrote: >> 2018-02-12 21:54 GMT+09:00 Ulf Magnusson : >>> On Sun, Feb 11, 2018 at 09:42:09PM +0100, Ulf Magnusson wrote: >>>> On Sun, Feb 11, 2018 at 9:29 PM, Ulf Magnusson wrote: >>>> > On Sun, Feb 11, 2018 at 6:56 PM, Kees Cook wrote: >>>> >> Another case I mentioned before that I just want to make sure we don't >>>> >> reintroduce the problem of getting "stuck" with a bad .config file. >>>> >> While adding _STRONG support, I discovered the two-phase Kconfig >>>> >> resolution that happens during the build. If you selected _STRONG with >>>> >> a strong-capable compiler, everything was fine. If you then tried to >>>> >> build with an older compiler, you'd get stuck since _STRONG wasn't >>>> >> support (as detected during the first Kconfig phase) so the >>>> >> generated/autoconf.h would never get updated with the newly selected >>>> >> _REGULAR). I moved the Makefile analysis of available stack-protector >>>> >> options into the second phase (i.e. after all the Kconfig runs), and >>>> >> that worked to both unstick such configs and provide a clear message >>>> >> early in the build about what wasn't available. >>>> >> >>>> >> If all this detection is getting moved up into Kconfig, I'm worried >>>> >> we'll end up in this state again. If the answer is "you have to delete >>>> >> autoconf.h if you change compilers", then that's fine, but it sure >>>> >> seems unfriendly. :) >>>> > >>>> > Did you mean include/config/auto.conf? That's the one that gets >>>> > included by the Makefiles. >>>> > >>>> > If the feature detection is moved into Kconfig, you should only need >>>> > to rerun the configuration (make menuconfig/oldconfig/olddefconfig) if >>>> > you change the compiler. That will update .config while taking the new >>>> > features into account, and then the second phase during 'make' will >>>> > update include/config/auto.conf from .config. >>>> > >>>> > That second Kconfig phase generates include/generated/autoconf.h and >>>> > include/config/. The include/config/ directory implements dependencies >>>> > between source files and Kconfig symbols by turning the symbols into >>>> > (empty) files. When building (during the "second phase"), Kconfig >>>> > compares .config with include/config/auto.conf to see what changed, >>>> > and signals the changes to 'make' by touch'ing the files corresponding >>>> > to the changed symbols. The idea is to avoid having to do a full >>>> > rebuild whenever the configuration is changed. >>>> > >>>> > Check out scripts/basic/fixdep.c as well if you want to understand how it works. >>>> > >>>> > Cheers, >>>> > Ulf >>>> >>>> By the way: >>>> >>>> That second phase is also a "normal" Kconfig run in the sense that it >>>> does all the usual dependency checking stuff. Even if .config doesn't >>>> respect dependencies, include/config/auto.conf will. So I think you >>>> might not even need to rerun the configuration (though .config will be >>>> out-of-date until you do). >>>> >>>> Cheers, >>>> Ulf >>> >>> Seems you'd have to rerun the configuration, because >>> include/config/auto.conf is only regenerated if it's older than .config. >>> >>> Here's the bit in the root Makefile that does it (KCONFIG_CONFIG is >>> .config). >>> >>> # If .config is newer than include/config/auto.conf, someone tinkered >>> # with it and forgot to run make oldconfig. >>> # if auto.conf.cmd is missing then we are probably in a cleaned tree so >>> # we execute the config step to be sure to catch updated Kconfig files >>> include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd >>> $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig >>> >>> silentoldconfig is a terrible name. What it actually does is run that >>> "second phase" stuff. >> >> Right. This is a historical misnomer. >> >> My plan is, as already posted below, to rename 'silentoldconfig' to 'synconfig' >> https://lkml.org/lkml/2018/1/17/1359 >> >> >> >>> Pretty sure that comment lies by the way. 'make oldconfig' doesn't >>> update include/config/auto.conf. It's probably outdated. >> >> Good catch. >> >> >>> >>> I wonder if it would be simpler to just always run silentoldconfig when >>> building. It's not that slow on my system: >>> >>> $ export ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` >>> $ time scripts/kconfig/conf --silentoldconfig Kconfig >>> >>> real 0m0.167s >>> user 0m0.162s >>> sys 0m0.004s >>> >>> That'd both simplify the Makefiles, and make sure that the latest >>> features are always used if you do feature testing in Kconfig. >>> >>> I don't know how strongly people feel about a few tenths of a second >>> though. >> >> >> No. NACK. >> >> silentoldconfig touches include/generated/autoconf.h >> so, files that depend on it will be re-compiled, unnecessarily. >> >> >> silentoldconfig ( 'syncconfig' in a more proper name) >> should be run only when necessary. >> >> >> >> >> -- >> Best Regards >> Masahiro Yamada > -- > To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Best Regards Masahiro Yamada