Skip to content

Commit b4d8957

Browse files
committed
gcc-plugins: Remove cyc_complexity
This plugin has no impact on the resulting binary, is disabled under COMPILE_TEST, and is not enabled on any builds I'm aware of. Additionally, given the clarified purpose of GCC plugins in the kernel, remove cyc_complexity. Cc: Masahiro Yamada <[email protected]> Cc: Michal Marek <[email protected]> Cc: Nick Desaulniers <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Kees Cook <[email protected]> Reviewed-by: Miguel Ojeda <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Acked-by: Nick Desaulniers <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8bd51a2 commit b4d8957

File tree

4 files changed

+0
-89
lines changed

4 files changed

+0
-89
lines changed

Documentation/kbuild/gcc-plugins.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ Enable the GCC plugin infrastructure and some plugin(s) you want to use
9696
in the kernel config::
9797

9898
CONFIG_GCC_PLUGINS=y
99-
CONFIG_GCC_PLUGIN_CYC_COMPLEXITY=y
10099
CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y
101100
...
102101

@@ -115,4 +114,3 @@ The GCC plugins are in scripts/gcc-plugins/. You need to put plugin source files
115114
right under scripts/gcc-plugins/. Creating subdirectories is not supported.
116115
It must be added to scripts/gcc-plugins/Makefile, scripts/Makefile.gcc-plugins
117116
and a relevant Kconfig file.
118-
See the cyc_complexity_plugin.c (CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) GCC plugin.

scripts/Makefile.gcc-plugins

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0
22

3-
gcc-plugin-$(CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) += cyc_complexity_plugin.so
4-
53
gcc-plugin-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) += latent_entropy_plugin.so
64
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) \
75
+= -DLATENT_ENTROPY_PLUGIN

scripts/gcc-plugins/Kconfig

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,6 @@ menuconfig GCC_PLUGINS
1919

2020
if GCC_PLUGINS
2121

22-
config GCC_PLUGIN_CYC_COMPLEXITY
23-
bool "Compute the cyclomatic complexity of a function" if EXPERT
24-
depends on !COMPILE_TEST # too noisy
25-
help
26-
The complexity M of a function's control flow graph is defined as:
27-
M = E - N + 2P
28-
where
29-
30-
E = the number of edges
31-
N = the number of nodes
32-
P = the number of connected components (exit nodes).
33-
34-
Enabling this plugin reports the complexity to stderr during the
35-
build. It mainly serves as a simple example of how to create a
36-
gcc plugin for the kernel.
37-
3822
config GCC_PLUGIN_SANCOV
3923
bool
4024
# Plugin can be removed once the kernel only supports GCC 6+

scripts/gcc-plugins/cyc_complexity_plugin.c

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)