aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-05-28 05:22:08 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-06-10 20:16:28 -0400
commit8373b7d9d174d577d93c6d4de46ae207f0b8d55b (patch)
treeb69faa7e0a334125491cc0184d9efe760dd8f462
parentcaa91ba53eb1c92d00abdf5b6c67a310d2b4c2d9 (diff)
Documentation: kconfig: add recommended way to describe compiler support
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 <yamada.masahiro@socionext.com>
-rw-r--r--Documentation/kbuild/kconfig-language.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt
index 0e966e8f9ec7..a4eb01843c04 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.
473The dependencies are moved to the symbol GENERIC_IOMAP and we avoid the 473The dependencies are moved to the symbol GENERIC_IOMAP and we avoid the
474situation where select forces a symbol equals to 'y'. 474situation where select forces a symbol equals to 'y'.
475 475
476Adding features that need compiler support
477~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
478
479There are several features that need compiler support. The recommended way
480to describe the dependency on the compiler feature is to use "depends on"
481followed by a test macro.
482
483config CC_STACKPROTECTOR
484 bool "Stack Protector buffer overflow detection"
485 depends on $(cc-option,-fstack-protector)
486 ...
487
488If you need to expose a compiler capability to makefiles and/or C source files,
489CC_HAS_ is the recommended prefix for the config option.
490
491config CC_HAS_STACKPROTECTOR_NONE
492 def_bool $(cc-option,-fno-stack-protector)
493
476Build as module only 494Build as module only
477~~~~~~~~~~~~~~~~~~~~ 495~~~~~~~~~~~~~~~~~~~~
478To restrict a component build to module-only, qualify its config symbol 496To restrict a component build to module-only, qualify its config symbol