Skip to content

Commit

Permalink
gcc-plugins: Remove cyc_complexity
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
kees committed Oct 21, 2021
1 parent 8bd51a2 commit b4d8957
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 89 deletions.
2 changes: 0 additions & 2 deletions Documentation/kbuild/gcc-plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ Enable the GCC plugin infrastructure and some plugin(s) you want to use
in the kernel config::

CONFIG_GCC_PLUGINS=y
CONFIG_GCC_PLUGIN_CYC_COMPLEXITY=y
CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y
...

Expand All @@ -115,4 +114,3 @@ The GCC plugins are in scripts/gcc-plugins/. You need to put plugin source files
right under scripts/gcc-plugins/. Creating subdirectories is not supported.
It must be added to scripts/gcc-plugins/Makefile, scripts/Makefile.gcc-plugins
and a relevant Kconfig file.
See the cyc_complexity_plugin.c (CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) GCC plugin.
2 changes: 0 additions & 2 deletions scripts/Makefile.gcc-plugins
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0

gcc-plugin-$(CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) += cyc_complexity_plugin.so

gcc-plugin-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) += latent_entropy_plugin.so
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) \
+= -DLATENT_ENTROPY_PLUGIN
Expand Down
16 changes: 0 additions & 16 deletions scripts/gcc-plugins/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,6 @@ menuconfig GCC_PLUGINS

if GCC_PLUGINS

config GCC_PLUGIN_CYC_COMPLEXITY
bool "Compute the cyclomatic complexity of a function" if EXPERT
depends on !COMPILE_TEST # too noisy
help
The complexity M of a function's control flow graph is defined as:
M = E - N + 2P
where

E = the number of edges
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
# Plugin can be removed once the kernel only supports GCC 6+
Expand Down
69 changes: 0 additions & 69 deletions scripts/gcc-plugins/cyc_complexity_plugin.c

This file was deleted.

0 comments on commit b4d8957

Please sign in to comment.