Received: by 10.223.185.116 with SMTP id b49csp1457457wrg; Sun, 11 Feb 2018 12:30:28 -0800 (PST) X-Google-Smtp-Source: AH8x224H8ZsN3JPgNhgdhaL4fqr9k+10ITeXgR57xFpWmEMaKo3rZYnMJk0WanL9nnrfHB+ViEaX X-Received: by 10.99.64.196 with SMTP id n187mr7661940pga.147.1518381027965; Sun, 11 Feb 2018 12:30:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518381027; cv=none; d=google.com; s=arc-20160816; b=Yhu366JKE1YmgnbEhPgXu9wXFUkQ9OyP2EpS7nhQDs8BTEB5B1Ob8d3+X2KBPIlj1e BJOt9u5Znmn4kRHj0+40ILfSgwqaZdOiv8hDstADZKFDBJf/f6YVrqkQACMNfM7MvhIT wkOU5R6yVcodm226JVyRzdohUdeE326LJtoKp+W+FJUCxQtX77vVqtvogKftqfk5SKhr m7XjSRdQmErrRFOF+2wWj+CrGUNk10tKueGhjOPNLhgY+PZzDTh2SJ/zZOOmdi+Bdfz1 2r/olaOLiE9y/16RzBnji2MkOueogutABnNdkWbV/hC17Tew8fU4rMcclBwZOnOT5Wj0 NyVw== 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=EcFijaD0SdA/ClaA3jnsHR83Fe8PJ8ZabXgBth2dFU4=; b=NBnZ4ZyPT9SKnCaURHewrHOnNhHoXsluJmhTBjLMkSAyIYZw9B0cGZ+0NuKjRXZ2Yu ORXepVFcYSIfluv9dePQq64DlJmXiD5JYq9Aa/t1LjTF5KiUcJrGlYBUFfLykeRZTCa6 9i3NqRZvF1m2aJbxnhTUFysKEgYmJZZM0fIcPRugj5eSj8q7e3QAliDnyC+SJtcrjexz vSXO8XPq4Mv7RNg2X2NDN7gbeDQTDunTxAG81cbVQI/4kNmuUitxzr1WriSaLh+xfK6T pkbTp5o+nkZ13ra8XMGPnG0nyQUuxvB5HwjlFjdVSdU9L0xT02boBqSKzD08IhPOvvrh mstQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IpWLnbGj; 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 a65si22749pfl.342.2018.02.11.12.30.13; Sun, 11 Feb 2018 12:30:27 -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=IpWLnbGj; 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 S932156AbeBKU3d (ORCPT + 99 others); Sun, 11 Feb 2018 15:29:33 -0500 Received: from mail-ua0-f174.google.com ([209.85.217.174]:41245 "EHLO mail-ua0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932080AbeBKU3c (ORCPT ); Sun, 11 Feb 2018 15:29:32 -0500 Received: by mail-ua0-f174.google.com with SMTP id d4so3751558uak.8; Sun, 11 Feb 2018 12:29:31 -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=EcFijaD0SdA/ClaA3jnsHR83Fe8PJ8ZabXgBth2dFU4=; b=IpWLnbGjdiEpsfnmuA5FTCmWG9EXmwaaJEuImMozk3e95pw0hL39FmOw4ZlvMG5PVd F0GtBtR68upEBTlHBWegMUIqAeeXqFgUQeJdf886ecSHOgjgQXO3cPiVvf8M2DZOYwiE IQrVKmXUwzTu3h6b0eFQe9UKm7ryHF21/FpNG7QmGO1wqCG8Nh4hAuqtgkPqCKZjWL9c URBAqbGHHIYSnYnxRw7zN+1TfSt1FMuGmiN7asjXmcdPqAlHRK3xFKdW3MecwLuJbm+l 8vun+1s9tWJTcSlB7n8CYytH2vGaeCvY4MGj5kIV78DiWVtXeySWfMI4BsvABAjWZOjv n+Ww== 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=EcFijaD0SdA/ClaA3jnsHR83Fe8PJ8ZabXgBth2dFU4=; b=B+Vis9K8sqiR4iig/qjsENQOnLVUBMlktV5BvyxZHBtnaxD2goPICuOmS+XsdbJKI3 cf+aVQ5Bw0i283CYFqEFN70LUOAsdN0g030u+hGx52MaPUYzIKnm7BtREh6KEL28nM6J 4dAiAI1Tr+pdSVm1CXrqGiqBBVyIhOFkvoAlz5X10Nfiylk74cAHulhe/uxzTMnyfOP3 hDN44Z3sX9xhJ3k/Q/4ejgxi4Uk3Sb9ECPvaVBH7yLCjz8lPR9OyLm7ICCY5Z9ee/azX QwKoVRDFrxK0EJZBNym7wmW7s5p2YhYeWilTco+ZbbVAzJvfOhgM54o13uHd0W/eYx9l pyxg== X-Gm-Message-State: APf1xPAYCyD/xN0FW9/XlRWJsmxiXzQhvGIv2M5Cg0vHTGRqmfpC9A5z XZRu+1oqO5ujXQ+UZQDKJW3aYKzNKv46/g5fusnahxEpt6A= X-Received: by 10.176.77.202 with SMTP id b10mr9383320uah.187.1518380971098; Sun, 11 Feb 2018 12:29:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.70.21 with HTTP; Sun, 11 Feb 2018 12:29:30 -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:29:30 +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 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