Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2141046imm; Mon, 28 May 2018 02:26:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq+m3ZAO6BdhWnoxKggTDYNhkJe8ubViXNb4NIybdXLQjGWLbgdc2Zu15TYnHA3EWFCXTZb X-Received: by 2002:a63:7f15:: with SMTP id a21-v6mr9950192pgd.21.1527499603042; Mon, 28 May 2018 02:26:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527499603; cv=none; d=google.com; s=arc-20160816; b=mUCtFPWgiLFjYFEdeN6bTC0dLBJAoO6TPMZjSBuY1Ape0H4/VzR7CC6CHfpb1/JqRe U5A2iyDwYI9TJZF4qmGV1UTtENs/+ezbv8EYKC1NJ5J23ZVKDxibIn7Y/L2KPFXGleuT QFXMzLQ1+hPYxuN4V/KgSx6TFcEJr4s6OICOAb1Li18c5+gxPBYo5qsGQQ3MufyhCuiN 6RiuRhi6HPzYb3PNkTF25dZAO2IqxDHE1ofpsj9BBv/gUCCXns/gFXXXXqDdoooCwCNh Rkxy0793ZZeBp/HXTXgGbtr8Z96zjKuwFSOa2NHHu6nXOuN2aw2OB6hiBrSXgaXgMpD1 vzig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=KGWTRxsHzhfYmXXlA+L1qxO2n0s45ic1ueQ8VBleHpw=; b=nr9nSP+rnVD6/m3hpCGYC+EtMwju9THvUR50+dM0mppWtu1LzjVh8572sztiKRzup+ PSeers73OvtOsubM09i00efWbx00zT/d1vKCjvJSr3CfwfhgUSM1gQsyGUglRlWOdR5j VoqAkSm+OQCBblGKs0TS+6iFUKuyDbTwTGAcSDboq9a/F+iVaBihRQH2wUeej1gTLxsi zjLKA7HcjXJUg8i4SZQAQAlRENPegclDUdrd4zfCP8XnAQ8vpS02BqvcJOBt0tbee5zo qkQiCG9c3EpXjdxUetymyWn8u0mHF4SZfdHMKbJmTQhQvUl1Tnk+APwKmexMegs8ylj4 53Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Tjgz7Qy+; 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 134-v6si2562012pgc.116.2018.05.28.02.26.28; Mon, 28 May 2018 02:26:43 -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=Tjgz7Qy+; 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 S933471AbeE1JYy (ORCPT + 99 others); Mon, 28 May 2018 05:24:54 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:22335 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933272AbeE1JYl (ORCPT ); Mon, 28 May 2018 05:24:41 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-10.nifty.com with ESMTP id w4S9MInm027506; Mon, 28 May 2018 18:22:44 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w4S9MInm027506 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1527499365; bh=KGWTRxsHzhfYmXXlA+L1qxO2n0s45ic1ueQ8VBleHpw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tjgz7Qy+K42twdfDruErrrUqpD1QYre98ZJFpnbrzmxBFs87YxLy85SMyAENR+zyz G8wq7JH4kmCNg2cLXXApK+lmoWlMvkaTrn9J6AdMhYosMU/AbD2MPHdWaonOC3y+sA tK5a+M6y3VGrHY5aUN41Xq7H4q8tMSolTLHhQ/cZa1utDLRRTZorVzUQ6ZyGKyrCuR AI+Kp4wI69fENOytrZSweltt6T1CEYuhM4p3dw55CFXTgcknn2Mb3te7sRBRa8r4q9 U3fuKW4B1NNOAxht7Qbd6SxGCQo/G8dV/y7KMau2oSFTPzWgPTZPLXGINjkaAcfMtd ya5M0ThC1k90g== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kees Cook , Nicholas Piggin , "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Linus Torvalds , Masahiro Yamada Subject: [PATCH v5 31/31] Documentation: kconfig: add recommended way to describe compiler support Date: Mon, 28 May 2018 18:22:08 +0900 Message-Id: <1527499328-13213-32-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527499328-13213-1-git-send-email-yamada.masahiro@socionext.com> References: <1527499328-13213-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It would be nice if the source code is written in the same style. This proposes the convention for describing the compiler capability in Kconfig. Signed-off-by: Masahiro Yamada --- This is not a technical issue, but it would be nice if everybody follows the same coding style. Without any documemation, people may write the code in their own way. For example, there could be some possibilities for the option naming. CC_HAS_ CC_SUPPORTS_ CC_HAVE_ ... IMHO, CC_HAS_ is short and enough to understand the meaning. CC_SUPPORTS_ is also good, but I personally prefer the shorter one. Comments are appreciated. Changes in v5: - Newly added Changes in v4: None Changes in v3: None Changes in v2: None Documentation/kbuild/kconfig-language.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt index 0e966e8..a4eb018 100644 --- a/Documentation/kbuild/kconfig-language.txt +++ b/Documentation/kbuild/kconfig-language.txt @@ -473,6 +473,24 @@ config option to 'y' no matter the dependencies. The dependencies are moved to the symbol GENERIC_IOMAP and we avoid the situation where select forces a symbol equals to 'y'. +Adding features that need compiler support +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +There are several features that need compiler support. The recommended way +to describe the dependency on the compiler feature is to use "depends on" +followed by a test macro. + +config CC_STACKPROTECTOR + bool "Stack Protector buffer overflow detection" + depends on $(cc-option,-fstack-protector) + ... + +If you need to expose a compiler capability to makefiles and/or C source files, +CC_HAS_ is the recommended prefix for the config option. + +config CC_HAS_STACKPROTECTOR_NONE + def_bool $(cc-option,-fno-stack-protector) + Build as module only ~~~~~~~~~~~~~~~~~~~~ To restrict a component build to module-only, qualify its config symbol -- 2.7.4