Received: by 10.223.185.116 with SMTP id b49csp1464923wrg; Sun, 11 Feb 2018 12:43:03 -0800 (PST) X-Google-Smtp-Source: AH8x226tcHI1ZTFQYfnsDV+H0zbsXz9kNS2yjBGV5fos+A+HNiYV30bg4wBOxZec+9XnjVNpAVrt X-Received: by 10.101.76.204 with SMTP id n12mr7682391pgt.15.1518381783865; Sun, 11 Feb 2018 12:43:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518381783; cv=none; d=google.com; s=arc-20160816; b=TOaLsh4ET3sDvZrZvwyPj3KpVt6bB0kBqjEmOcWBnW+yw26DFKmXJ/c1WnmL8YDHq7 xooK4auHxQ596/vEqkjbKhm49wxuPKrTedcrY7dK15dKFXx1KNrYDq4X2ip/Ua534cMl jxB5H4BSR+K1QH3Le3m24PE1Duk8R8Km33C3IM9/qeux9IuzwWJwPn2iIlLopQO3tGFt 97M8udrk/Sj0GP8cGiGD5qqYTcoKvJTtEmiJn66GM0FhjK9KL7xpCNHmDZmiM6WaHdHd ZBTiGd5gBAsKeHT0NJrTDWRWhKtyXXUFHjuOgHb8nKy4fFMAg56ySZperHJ42v4VW0V3 K6Gg== 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 :arc-authentication-results; bh=CUMvpCHDVTAzAr091HpSb/zM9kdk6qWyvBfzBHU73vk=; b=DMzrXpTrEWqGAK77T0cZsLVFcEYupys/tQje3JBNjSObtFdG0igDuW1ZkEOS619Zfp s3GNqbckniRd1x5T9gfbLHRrxx8yk/pehjj4bjzfM2KZnsqjPMvvyK0ZhBsr0CcvTGtY PhOBQyejFCA50QCReaqW+tgTNs0ocMJTtSpQxTUu29WpwoWS1RnDitpfWq+z80usnAbf +9fz2/d3x585V/M/VEbTpmTVm6iDrtjRMA6QW6+9cpZCZByUBRsaOQnKixxJ2nXOm2rD afh86M/hwT/bLUCuWVpcA7sgSavi3WEnjbRbbvW4ooe4ActfKIVdK2sDSwbmIhV9VCws IyQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T1xZkAUn; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3-v6si2920238plm.224.2018.02.11.12.42.49; Sun, 11 Feb 2018 12:43:03 -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=@gmail.com header.s=20161025 header.b=T1xZkAUn; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932151AbeBKUmN (ORCPT + 99 others); Sun, 11 Feb 2018 15:42:13 -0500 Received: from mail-vk0-f45.google.com ([209.85.213.45]:33167 "EHLO mail-vk0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753689AbeBKUmL (ORCPT ); Sun, 11 Feb 2018 15:42:11 -0500 Received: by mail-vk0-f45.google.com with SMTP id w201so7769065vkw.0; Sun, 11 Feb 2018 12:42:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CUMvpCHDVTAzAr091HpSb/zM9kdk6qWyvBfzBHU73vk=; b=T1xZkAUn4BMAFd04yBrOddgLx4vVmswMDG/rBIHF+kzNw9jD8S4Wg6Gf8D0z+7Elgu mDDhi2/qNQCJjNqwnBPah7APoneWXgg31YxpC7liVVi1nUkeJQui9MOKzOwg1J4NGzbt aM42Kwl3Jmw1P5bv6wEugzvtiEz1qDANdgOlhrW7V2XdPFSoD901Y71mCE2ibzIUJny1 7svEO4RU+tJDen65AiRl0R291uu4HxbfzD5P1aHmNZut19EN/guqhpw8yt9w79ebAm9b dGd2HolHzvbRIpVpNhAdXm4tRwmKmgd3u7YtQwTnhGoUJra7p4si1VjsebJvG9m3Fg2f dv3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CUMvpCHDVTAzAr091HpSb/zM9kdk6qWyvBfzBHU73vk=; b=J2OZjZXXUNspbl5jVgiwcaRBaH0X8NJCXQI6nXn1SrW2zVovIOKQ5DcFr79u8Fs37M YyuBLV4xeZ9UVs5bDRsVF46X+NVXFPwsn+OvBsbbo0r2+cI0J/bEeye2D1+WfhM4mjX+ xjyTNoW+5Q14QZG8TLIT1cTEOQJW7uuaHRdD+yNLo9+ez/hs3aU7n6lAyAo/DnQ7xA7p qsApXQ8/qWsXoQQ0P4NwwDSIJN7KtD1qoJSPeaDG7vZ7zmhQNKfIx3wQO0QwkRHRGRBd 8smcd+MhySF16Owueexx2JXcdB2TS7pTip6PMzSL9o8U/URBFKURrgMaq14+T7brIEjL zPNw== X-Gm-Message-State: APf1xPDy05c9NLls4+pJE0ZRV2d0tojYZEUy971y+iAhixQ9Wb3w5jXY Zmh41MpYSKH2PBY+Ikkqh0bB2YLRo/aI+nK4aXQ= X-Received: by 10.31.233.135 with SMTP id g129mr4147279vkh.177.1518381730447; Sun, 11 Feb 2018 12:42:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.70.21 with HTTP; Sun, 11 Feb 2018 12:42:09 -0800 (PST) In-Reply-To: References: <20180210054843.z3g7wvcmlccvww3h@huvuddator> <20180210074924.3nhxsza5zdbaahxx@huvuddator> <20180210080556.mycqsjhxbaguwhay@huvuddator> <20180210085519.737ckf4bcl57h4g2@huvuddator> <20180211103432.pf2ot6nd7nbhdhsy@huvuddator> From: Ulf Magnusson Date: Sun, 11 Feb 2018 21:42:09 +0100 Message-ID: Subject: Re: [RFC PATCH 4/7] kconfig: support new special property shell= To: Kees Cook Cc: Linus Torvalds , Masahiro Yamada , 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 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