Received: by 10.223.185.116 with SMTP id b49csp21447wrg; Sat, 10 Feb 2018 01:22:40 -0800 (PST) X-Google-Smtp-Source: AH8x227jhRoZN+w0YP0pWW52UWtJ6H+U8tFntEDc53gFVH/Ktq24/1RpnzWgipfFwFAPUZihCgGI X-Received: by 10.99.45.195 with SMTP id t186mr4593865pgt.127.1518254560235; Sat, 10 Feb 2018 01:22:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518254560; cv=none; d=google.com; s=arc-20160816; b=deJF3mUvgEFtnWSPvRINNQ2FNWu4bo5jdGXkM8dT+vHHfft4s6Xa+DV9F0Kd2k4FE0 1PAsnit1s2zkGxp5XtzKZz9oFmWFI4vxRe9APUmvQuaOgFRZxLIg+Kvyd6L3MF4FY41h Q0Cy/v/DOo7E7P793ZX3InMamS8FvW0YE+rcTRf+zzZpi8yC61EEN7kZupRZXTKO8LcU 1AELsSFYQyqZ9jyzWGO/3T3GmkxCQ4BVTQff00C7NAUbMxT1Nrm0ECGBy7qGN4YxdIwp 3HTgo5oQqSpc84XGsmIsvZ7mZZc2XrFkt5XtcfqDNR4TR3aHOpOEdhz5oBXtyrm8VONg iRWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=XxPAso/bRC4B0HNebHkCaZZq0UG4Ieh9HBb68L689bE=; b=aVP3nqmkrpolXyu24O/48EIxY9+//HfjA/hWAYjvubAxiJvLv2tAi75TqyWZ1CRIwf VTS7I5MGo0pJOHsWNWXd/RybUlGp7EWlwlP38jAnx7TM48RXB/sSfDcXEKBgfytvwGzS v+bwyX4hbN812A9tJUtbT1+xO2wkhMqroF5ME9XVU+SgxDjm1+Q6qLY5MFlRjlRiWLPI NE6TdFzIP3MuH1hO727P6m+4VL1U+WmEcuCdyy7FiUV8nYoDqKmjGoT9DxLMWNwz/3rn 5/RIITmQcSkvN/o67r2GJoRXApegDYbpsUXRhUrMJc4u7LfoPDrnbpwCjtrOnAzY8H+b +Pig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mlg5DNVb; 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 196si3071602pfv.261.2018.02.10.01.22.26; Sat, 10 Feb 2018 01:22:40 -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=mlg5DNVb; 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 S1752199AbeBJJVc (ORCPT + 99 others); Sat, 10 Feb 2018 04:21:32 -0500 Received: from mail-lf0-f46.google.com ([209.85.215.46]:39349 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750832AbeBJJV3 (ORCPT ); Sat, 10 Feb 2018 04:21:29 -0500 Received: by mail-lf0-f46.google.com with SMTP id h78so7203573lfg.6; Sat, 10 Feb 2018 01:21:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=XxPAso/bRC4B0HNebHkCaZZq0UG4Ieh9HBb68L689bE=; b=mlg5DNVbjiYRhyv0PI1ccCpU/az65O9X4t6XdQAnamXF4v9V3qvVyvYsJeMG+r1k49 e0q4dTzsYhjQr4GbEQ/IMH/tdQSdodmlusJgd8whtxhzse3/xRXGshohVsC7iMtFN7N3 O4LzPVBi8Rza2lrd7zyrGSr/Ih99g2ttf47ZKD6E1BuMtr2UH3uS6vEuf8Ss8vY3Jabm rpGYyVnv3Wu1XbbIrXRnT6o62ggA/XzBjOIIwAO40+u00CzIKudw2XqOUfWgWxkQi6F8 RxPB8+SdsGcZyLAquPOaI+zPE9TCv+TOA3sVsJmCR8xBNRsaVIkUJs+Bu3yHjgYgD5RJ fxkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=XxPAso/bRC4B0HNebHkCaZZq0UG4Ieh9HBb68L689bE=; b=TjOnB19rNfyiwGb5EXqo+TsS58a2P1guQ0SYcHlePiRaOjOo9i+Cx4JOL4O571/Vv4 96zH0R4Aha1QeaJ/JXv56ahTF2WruJmnDY+K9IF08BgP2LZmm6URPDr7CL218Lba0E3t jCVB3rY+ycBCtXYPzTAr5u3rV95foaA7PRDzE+HnXF8AE+pvOvtnReNsGFRYjU6UyQIK RTSq1PrGoxLApLSpHUyHeCcMIqQ83DdsUIiKK3rVqJC3KJdoLxG2Ka3HaQuVbdI28SlJ abN72xtBBg+KllFtoz9uIxCEuy2v15HwYxYTPBp6+/LeVXiBJ1/tlCU2gyYvgaG2KMYM zVzA== X-Gm-Message-State: APf1xPDmbs6mbbukegN25ryWj2eUcam7q4fiK0FFqgjZxg7jkmLmhaiX XRsB9yrU/HI8nXxAOIutnuw= X-Received: by 10.46.29.137 with SMTP id w9mr3945419lje.105.1518254486986; Sat, 10 Feb 2018 01:21:26 -0800 (PST) Received: from huvuddator (ua-213-113-106-221.cust.bredbandsbolaget.se. [213.113.106.221]) by smtp.gmail.com with ESMTPSA id 20sm275033ljc.82.2018.02.10.01.21.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Feb 2018 01:21:26 -0800 (PST) Date: Sat, 10 Feb 2018 10:21:24 +0100 From: Ulf Magnusson To: Masahiro Yamada Cc: Kees Cook , Linux Kbuild mailing list , Linus Torvalds , 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 Subject: Re: [RFC PATCH 4/7] kconfig: support new special property shell= Message-ID: <20180210092124.im7x2qs5xbkyebr7@huvuddator> References: <1518106752-29228-5-git-send-email-yamada.masahiro@socionext.com> <20180209053038.pscoijvowmyudyzf@huvuddator> <20180209124607.akjhncb5sempjqcn@huvuddator> <20180210054843.z3g7wvcmlccvww3h@huvuddator> <20180210074924.3nhxsza5zdbaahxx@huvuddator> <20180210080556.mycqsjhxbaguwhay@huvuddator> <20180210085519.737ckf4bcl57h4g2@huvuddator> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180210085519.737ckf4bcl57h4g2@huvuddator> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 10, 2018 at 09:55:19AM +0100, Ulf Magnusson wrote: > On Sat, Feb 10, 2018 at 09:05:56AM +0100, Ulf Magnusson wrote: > > On Sat, Feb 10, 2018 at 08:49:24AM +0100, Ulf Magnusson wrote: > > > On Sat, Feb 10, 2018 at 04:12:13PM +0900, Masahiro Yamada wrote: > > > > 2018-02-10 14:48 GMT+09:00 Ulf Magnusson : > > > > > On Fri, Feb 09, 2018 at 12:46:54PM -0800, Kees Cook wrote: > > > > >> On Fri, Feb 9, 2018 at 4:46 AM, Ulf Magnusson wrote: > > > > >> > One thing that makes Kconfig confusing (though it works well enough in > > > > >> > practice) is that .config files both record user selections (the saved > > > > >> > configuration) and serve as a configuration output format for make. > > > > >> > > > > > >> > It becomes easier to think about .config files once you realize that > > > > >> > assignments to promptless symbols never have an effect on Kconfig > > > > >> > itself: They're just configuration output, intermixed with the saved > > > > >> > user selections. > > > > >> > > > > > >> > Assume 'option env' symbols got written out for example: > > > > >> > > > > > >> > - For a non-user-assignable symbol, the entry in the .config > > > > >> > file is just configuration output and ignored by Kconfig, > > > > >> > which will fetch the value from the environment instead. > > > > >> > > > > > >> > - For an assignable 'option env' symbol, the entry in the > > > > >> > .config file is a saved user selection (as well as > > > > >> > configuration output), and will be respected by Kconfig. > > > > >> > > > > >> In the stack-protector case, this becomes quite important, since the > > > > >> goal is to record the user's selection regardless of compiler > > > > >> capability. For example, if someone selects _REGULAR, it shouldn't > > > > >> "upgrade" to _STRONG. (Similarly for _NONE.) Having _AUTO provides a > > > > >> way to pick "best possible for this compiler", though. If a user had > > > > >> previously selected _STRONG but they're doing builds with an older > > > > >> compiler (or a misconfigured newer compiler) without support, the goal > > > > >> is to _fail_ to build, not silently select _REGULAR. > > > > >> > > > > >> So, in this case, what's gained is the logic for _AUTO, and the logic > > > > >> to not show, say, _STRONG when it's not available in the compiler. But > > > > >> we must still fail to build if _STRONG was in the .config. It can't > > > > >> silently rewrite it to _REGULAR because the compiler support for > > > > >> _STRONG regressed. > > > > >> > > > > >> -Kees > > > > >> > > > > >> -- > > > > >> Kees Cook > > > > >> Pixel Security > > > > > > > > > > Provided that would be the desired behavior: > > > > > > > > > > What about changing the meaning of the choice symbols from e.g. "select > > > > > -fstack-protector-strong" to "want -fstack-protector-strong"? Then the > > > > > user preference would always be remembered, regardless of what's > > > > > available. > > > > > > > > > > Here's a proof-of-concept. I realized that the fancy new 'imply' keyword > > > > > fits pretty well here, since it works like a dependency-respecting > > > > > select. > > > > > > > > > > config CC_HAS_STACKPROTECTOR_STRONG > > > > > bool > > > > > option shell="$CC -Werror -fstack-protector-strong -c -x c /dev/null" > > > > > > > > > > config CC_HAS_STACKPROTECTOR > > > > > bool > > > > > option shell="$CC -Werror -fstack-protector -c -x c /dev/null" > > > > > > > > > > > > > > > choice > > > > > prompt "Stack Protector buffer overflow detection" > > > > > default WANT_CC_STACKPROTECTOR_STRONG > > > > > > > > > > config WANT_CC_STACKPROTECTOR_STRONG > > > > > bool "Strong" > > > > > imply CC_STACKPROTECTOR_STRONG > > > > > > > > > > config WANT_CC_STACKPROTECTOR_REGULAR > > > > > bool "Regular" > > > > > imply CC_STACKPROTECTOR_REGULAR > > > > > > > > > > config WANT_CC_STACKPROTECTOR_NONE > > > > > bool "None" > > > > > imply CC_STACKPROTECTOR_NONE > > > > > > > > > > endchoice > > > > > > > > > > > > > > > config CC_STACKPROTECTOR_STRONG > > > > > bool > > > > > depends on CC_HAS_STACKPROTECTOR_STRONG > > > > > > > > > > > > Do you mean > > > > > > > > config CC_STACKPROTECTOR_STRONG > > > > bool > > > > depends on CC_HAS_STACKPROTECTOR_STRONG && \ > > > > WANT_CC_STACKPROTECTOR_STRONG > > > > > > > > or, maybe > > > > > > > > > > > > config CC_STACKPROTECTOR_STRONG > > > > bool > > > > depends on CC_HAS_STACKPROTECTOR_STRONG > > > > default WANT_CC_STACKPROTECTOR_STRONG > > > > > > > > ? > > > > > > With the 'imply', it should work with just the 'depends on'. I had your > > > last version earlier though, and it works too. > > > > > > 'imply' kinda makes sense, as in "turn on the strong stack protector if > > > its dependencies are satisfied". > > > > > > > > > > > > > > > > > > > > > > > > > > > > config CC_STACKPROTECTOR_REGULAR > > > > > bool > > > > > depends on CC_HAS_STACKPROTECTOR_REGULAR > > > > > > > > > > config CC_STACKPROTECTOR_NONE > > > > > bool > > > > > > > > > > This version has the drawback of always showing all the options, even if > > > > > some they wouldn't be available. Kconfig comments could be added to warn > > > > > if an option isn't available at least: > > > > > > > > > > comment "Warning: Your compiler does not support -fstack-protector-strong" > > > > > depends on !CC_HAS_STACKPROTECTOR_STRONG > > > > > > > > > > config WANT_CC_STACKPROTECTOR_STRONG > > > > > ... > > > > > > > > > > > > > > > comment "Warning: Your compiler does not support -fstack-protector" > > > > > depends on !CC_HAS_STACKPROTECTOR_REGULAR > > > > > > > > > > config WANT_CC_STACKPROTECTOR_REGULAR > > > > > ... > > > > > > > > > > This final comment might be nice to have too: > > > > > > > > > > comment "Warning: Selected stack protector not available" > > > > > depends on !(CC_STACKPROTECTOR_STRONG || > > > > > CC_STACKPROTECTOR_REGULAR || > > > > > CC_STACKPROTECTOR_NONE) > > > > > > > > > > Should probably introduce a clear warning that tells the user what they > > > > > need to change in Kconfig if they build with a broken selection too. > > > > > > > > > > > > > > > CC_STACKPROTECTOR_AUTO could be added to the choice in a slightly kludgy > > > > > way too. Maybe there's something neater. > > > > > > > > > > config CC_STACKPROTECTOR_AUTO > > > > > bool "Automatic" > > > > > imply CC_STACKPROTECTOR_STRONG > > > > > imply CC_STACKPROTECTOR_REGULAR if !CC_HAS_STACKPROTECTOR_STRONG > > > > > imply CC_STACKPROTECTOR_NONE if !CC_HAS_STACKPROTECTOR_STRONG && \ > > > > > !CC_HAS_STACKPROTECTOR_REGULAR > > > > > > > > > > > > > > > Another drawback of this approach is that it breaks existing .config > > > > > files (the CC_STACKPROTECTOR_* settings are ignored, since they just > > > > > look like "configuration output" to Kconfig now). If that'd be a > > > > > problem, the old names could be used instead of > > > > > WANT_CC_STACKPROTECTOR_STRONG, etc., and new names introduced instead, > > > > > though it'd look a bit cryptic. > > > > > > > > > > Ideas? > > > > > > > > > > > > > > > > > > > > > FWIW, the following is what I was playing with. > > > > (The idea for emitting warnings is Ulf's idea) > > > > > > > > > > > > ------------------>8------------------- > > > > config CC > > > > string > > > > option env="CC" > > > > > > > > config CC_HAS_STACKPROTECTOR > > > > bool > > > > option shell="$CC -Werror -fstack-protector -c -x c /dev/null" > > > > > > > > config CC_HAS_STACKPROTECTOR_STRONG > > > > bool > > > > option shell="$CC -Werror -fstack-protector-strong -c -x c /dev/null" > > > > > > > > config CC_HAS_STACKPROTECTOR_NONE > > > > bool > > > > option shell="$CC -Werror -fno-stack-protector -c -x c /dev/null" > > > > > > > > config CC_STACKPROTECTOR > > > > bool > > > > > > > > choice > > > > prompt "Stack Protector buffer overflow detection" > > > > > > > > config CC_STACKPROTECTOR_AUTO > > > > bool "Auto" > > > > select CC_STACKPROTECTOR if (CC_HAS_STACKPROTECTOR || \ > > > > CC_HAS_STACKPROTECTOR_STRONG) > > > > > > With this approach, I guess you would still need to handle the > > > CC_STACKPROTECTOR_AUTO logic outside of Kconfig, since e.g. > > > CC_STACKPROTECTOR_STRONG won't get enabled automatically if supported. > > > > > > The idea above was to make it "internal" to the Kconfig files (though it > > > still gets written out), with the > > > CC_STACKPROTECTOR_{REGULAR,STRONG,NONE} variables automatically getting > > > set as appropriate. > > > > That was a confusing way of putting it -- sorry about that. > > > > What I meant was that it would just be a user selection, with all the > > logic of selecting one of CC_STACKPROTECTOR_{REGULAR,STRONG,NONE} being > > handled internally in the Kconfig files, even in the > > CC_STACKPROTECTOR_AUTO case. > > > > Nothing outside of Kconfig would need to check CC_STACKPROTECTOR_AUTO > > then. > > > > > > > > The build could then the detect if none of > > > CC_STACKPROTECTOR_{REGULAR,STRONG,NONE} are set and do what's > > > appropriate (error out in some semi-helpful way or whatever... not > > > deeply familiar with kernel policy here :). > > > > > > > > > > > config CC_STACKPROTECTOR_REGULAR > > > > bool "Regular" > > > > select CC_STACKPROTECTOR > > > > > > > > config CC_STACKPROTECTOR_STRONG > > > > bool "Strong" > > > > select CC_STACKPROTECTOR > > > > > > > > config CC_STACKPROTECTOR_NONE > > > > bool "None" > > > > > > > > endchoice > > > > > > > > > > > > comment "(WARNING) stackprotecter was chosen, but your compile does > > > > not support it. Build will fail" > > > > depends on CC_STACKPROTECTOR_REGULAR && \ > > > > !CC_HAS_STACKPROTECTOR > > > > > > > > comment "(WARNING) stackprotecter-strong was chosen, but your compile > > > > does not support it. Build will fail" > > > > depends on CC_STACKPROTECTOR_STRONG && \ > > > > !CC_HAS_STACKPROTECTOR_STRONG > > > > ------------------------->8--------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > BTW, setting option flags in Makefile is dirty, like follows: > > > > > > > > > > > > ccflags-$(CONFIG_CC_STACKPROTECTOR_STRONG) += -fstack-protector-strong > > > > ccflags-$(CONFIG_CC_STACKPROTECTOR_REGULAR) += -fstack-protector > > > > > > > > if ($(CONFIG_CC_STACKPROTECTOR_AUTO),y) > > > > ccflags-$(CONFIG_CC_HAS_STACKPROTECTOR) += -fstack-protector > > > > ccflags-$(CONFIG_CC_HAS_STACKPROTECTOR_STRONG) += -fstack-protector-strong > > > > ccflags-$(CONFIG_CC_HAS_STACKPROTECTOR_NONE) += -fno-stack-protector > > > > endif > > > > > > > > if ($(CONFIG_CC_STACKPROTECTOR_NONE),y) > > > > ccflags-$(CONFIG_CC_HAS_STACKPROTECTOR_NONE) += -fno-stack-protector > > > > endif > > > > > > > > > > > > > > > > > > > > One idea could be to calculate the compiler option in Kconfig. > > > > > > > > config CC_OPT_STACKPROTECTOR > > > > string > > > > default "-fstack-protector-strong" if CC_STACKPROTECTOR_STRONG || \ > > > > (CC_STACKPROTECTOR_AUTO && \ > > > > CC_HAS_STACKPROTECTOR_STRONG) > > > > default "-fstack-protector" if CC_STACKPROTECTOR_REGULAR || \ > > > > (CC_STACKPROTECTOR_AUTO && \ > > > > CC_HAS_STACKPROTECTOR) > > > > default "-fno-stack-protector" if CC_HAS_STACKPROTECTOR_NONE > > > > > > If CC_STACKPROTECTOR_AUTO is made "internal", this could be simplified > > > to something like > > > > > > config CC_OPT_STACKPROTECTOR > > > string > > > default "-fstack-protector-strong" if CC_STACKPROTECTOR_STRONG > > > default "-fstack-protector" if CC_STACKPROTECTOR_REGULAR > > > default "-fno-stack-protector" if CC_HAS_STACKPROTECTOR_NONE > > > # If the compiler doesn't even support > > > # -fno-stack-protector > > > default "" > > > > > > (Last default is just to make the empty string explicit. That's the > > > value it would get anyway.) > > > > > > > > > > > > > > > > > > > Makefile will become clean. > > > > Of course, this is at the cost of ugliness in Kconfig. > > > > > > > > > > > > > > > > > > > > -- > > > > Best Regards > > > > Masahiro Yamada > > > > > > Please tell me if I've misunderstood some aspect of the old behavior. > > > > > > Cheers, > > > Ulf > > > > Cheers, > > Ulf > > Here's a complete updated example, with some stuff from Masahiro added. > > Turns out warnings inside choices get cut off easily in menuconfig, so I > went with just a single warning instead (which should be enough anyway). > > With this version, the only "outputs" that the Makefiles needs to look > at are CC_STACKPROTECTOR_{STRONG,REGULAR,NONE} (and > CC_OPT_STACKPROTECTOR). WANT_CC_OPT_STACKPROTECTOR_AUTO is handled > automatically. > > The caveat related to old .config files mentioned above still applies. > > How many compilers don't support -fno-stack-protector by the way? > > config CC_HAS_STACKPROTECTOR_STRONG > bool > option shell="$CC -Werror -fstack-protector-strong -c -x c /dev/null" > > config CC_HAS_STACKPROTECTOR_REGULAR > bool > option shell="$CC -Werror -fstack-protector -c -x c /dev/null" > > config CC_HAS_STACKPROTECTOR_NONE > bool > default y This default is left-over testing stuff. Sorry about that. > option shell="$CC -Werror -fno-stack-protector -c -x c /dev/null" > > > choice > prompt "Stack Protector buffer overflow detection" > default WANT_CC_STACKPROTECTOR_AUTO > > config WANT_CC_STACKPROTECTOR_AUTO > bool "Automatic" > imply CC_STACKPROTECTOR_STRONG > imply CC_STACKPROTECTOR_REGULAR if !CC_HAS_STACKPROTECTOR_STRONG > imply CC_STACKPROTECTOR_NONE if !CC_HAS_STACKPROTECTOR_STRONG && \ > !CC_HAS_STACKPROTECTOR_REGULAR > > config WANT_CC_STACKPROTECTOR_STRONG > bool "Strong" > imply CC_STACKPROTECTOR_STRONG > > config WANT_CC_STACKPROTECTOR_REGULAR > bool "Regular" > imply CC_STACKPROTECTOR_REGULAR > > config WANT_CC_STACKPROTECTOR_NONE > bool "None" > imply CC_STACKPROTECTOR_NONE > > endchoice > > comment "Warning: Selected stack protector not available" > depends on !(CC_STACKPROTECTOR_STRONG || \ > CC_STACKPROTECTOR_REGULAR || \ > CC_STACKPROTECTOR_NONE) > > > config CC_STACKPROTECTOR_STRONG > bool > depends on CC_HAS_STACKPROTECTOR_STRONG > > config CC_STACKPROTECTOR_REGULAR > bool > depends on CC_HAS_STACKPROTECTOR_REGULAR > > config CC_STACKPROTECTOR_NONE > bool > > > config CC_OPT_STACKPROTECTOR > string > default "-fstack-protector-strong" if CC_STACKPROTECTOR_STRONG > default "-fstack-protector" if CC_STACKPROTECTOR_REGULAR > default "-fno-stack-protector" if CC_HAS_STACKPROTECTOR_NONE > # If the compiler doesn't even support > # -fno-stack-protector > default "" > > Of course, at some point you're just moving complexity from one place to > another. Maybe this all-Kconfig approach isn't worth it if people find > it harder to understand. I don't know how bad the Makefiles are here at > the moment. > > Cheers, > Ulf Cheers, Ulf