From 68fdc678df4646d5b81efd1684575be2db6c005b Mon Sep 17 00:00:00 2001 From: Andrew Donnellan Date: Wed, 2 Nov 2016 17:52:41 +1100 Subject: MAINTAINERS: add GCC plugins Makefile Signed-off-by: Andrew Donnellan Signed-off-by: Kees Cook --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index c44795306342..479cc83bca74 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5196,6 +5196,7 @@ L: kernel-hardening@lists.openwall.com S: Maintained F: scripts/gcc-plugins/ F: scripts/gcc-plugin.sh +F: scripts/Makefile.gcc-plugins F: Documentation/gcc-plugins.txt GCOV BASED KERNEL PROFILING -- cgit v1.2.3-58-ga151 From 215e2aa6c024d27cdbe88e2ea88cb59dcab588eb Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 8 Nov 2016 16:27:03 -0800 Subject: gcc-plugins: Adjust Kconfig to avoid cyc_complexity In preparation for removing "depends on !COMPILE_TEST" from GCC_PLUGINS, the GCC_PLUGIN_CYC_COMPLEXITY plugin needs to gain the restriction, since it is mainly an example, and produces (intended) voluminous stderr reporting, which is generally undesirable for allyesconfig-style build tests. This additionally puts the plugin behind EXPERT and improves the help text. Signed-off-by: Kees Cook --- arch/Kconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/Kconfig b/arch/Kconfig index 659bdd079277..d5066593a60f 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -363,8 +363,9 @@ menuconfig GCC_PLUGINS See Documentation/gcc-plugins.txt for details. config GCC_PLUGIN_CYC_COMPLEXITY - bool "Compute the cyclomatic complexity of a function" + bool "Compute the cyclomatic complexity of a function" if EXPERT depends on GCC_PLUGINS + depends on !COMPILE_TEST help The complexity M of a function's control flow graph is defined as: M = E - N + 2P @@ -374,6 +375,10 @@ config GCC_PLUGIN_CYC_COMPLEXITY N = the number of nodes P = the number of connected components (exit nodes). + Enabling this plugin reports the complexity to stderr during the + build. It mainly serves as a simple example of how to create a + gcc plugin for the kernel. + config GCC_PLUGIN_SANCOV bool depends on GCC_PLUGINS -- cgit v1.2.3-58-ga151