summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.gcc-plugins
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2018-07-11 20:38:52 -0400
committerKees Cook <keescook@chromium.org>2018-07-24 19:11:07 -0400
commit7ccb95e8fe9131b8fa14b947c60dfb30044fa002 (patch)
tree2b394dee41fb0a94372e1123a859e783e07a299b /scripts/Makefile.gcc-plugins
parent45332b1bdfdc8d63ae4a9d32cbb10e11bc20baab (diff)
gcc-plugins: Regularize Makefile.gcc-plugins
The layout of Makefile.gcc-plugins had uneven tabs, and the long names of things made this file a bit hard to quickly visually parse. This breaks lines and moves options to the same tab depth. While we're at it, this also adds some comments about the various sections. Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'scripts/Makefile.gcc-plugins')
-rw-r--r--scripts/Makefile.gcc-plugins36
1 files changed, 24 insertions, 12 deletions
diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins
index f9942d9ac3fc..0a482f341576 100644
--- a/scripts/Makefile.gcc-plugins
+++ b/scripts/Makefile.gcc-plugins
@@ -1,32 +1,44 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2
2gcc-plugin-$(CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) += cyc_complexity_plugin.so 3gcc-plugin-$(CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) += cyc_complexity_plugin.so
3 4
4gcc-plugin-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) += latent_entropy_plugin.so 5gcc-plugin-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) += latent_entropy_plugin.so
5gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) += -DLATENT_ENTROPY_PLUGIN 6gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) \
7 += -DLATENT_ENTROPY_PLUGIN
6ifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY 8ifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY
7 DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable 9 DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable
8endif 10endif
11export DISABLE_LATENT_ENTROPY_PLUGIN
9 12
10gcc-plugin-$(CONFIG_GCC_PLUGIN_SANCOV) += sancov_plugin.so 13gcc-plugin-$(CONFIG_GCC_PLUGIN_SANCOV) += sancov_plugin.so
14
11gcc-plugin-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) += structleak_plugin.so 15gcc-plugin-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) += structleak_plugin.so
12gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE) += -fplugin-arg-structleak_plugin-verbose 16gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE) \
13gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) += -fplugin-arg-structleak_plugin-byref-all 17 += -fplugin-arg-structleak_plugin-verbose
14gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) += -DSTRUCTLEAK_PLUGIN 18gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) \
19 += -fplugin-arg-structleak_plugin-byref-all
20gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \
21 += -DSTRUCTLEAK_PLUGIN
15 22
16gcc-plugin-$(CONFIG_GCC_PLUGIN_RANDSTRUCT) += randomize_layout_plugin.so 23gcc-plugin-$(CONFIG_GCC_PLUGIN_RANDSTRUCT) += randomize_layout_plugin.so
17gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_RANDSTRUCT) += -DRANDSTRUCT_PLUGIN 24gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_RANDSTRUCT) \
18gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE) += -fplugin-arg-randomize_layout_plugin-performance-mode 25 += -DRANDSTRUCT_PLUGIN
26gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE) \
27 += -fplugin-arg-randomize_layout_plugin-performance-mode
19 28
29# All the plugin CFLAGS are collected here in case a build target needs to
30# filter them out of the KBUILD_CFLAGS.
20GCC_PLUGINS_CFLAGS := $(strip $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y)) $(gcc-plugin-cflags-y)) 31GCC_PLUGINS_CFLAGS := $(strip $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y)) $(gcc-plugin-cflags-y))
21 32# The sancov_plugin.so is included via CFLAGS_KCOV, so it is removed here.
22export GCC_PLUGINS_CFLAGS GCC_PLUGIN
23export DISABLE_LATENT_ENTROPY_PLUGIN
24
25# sancov_plugin.so can be only in CFLAGS_KCOV because avoid duplication.
26GCC_PLUGINS_CFLAGS := $(filter-out %/sancov_plugin.so, $(GCC_PLUGINS_CFLAGS)) 33GCC_PLUGINS_CFLAGS := $(filter-out %/sancov_plugin.so, $(GCC_PLUGINS_CFLAGS))
34export GCC_PLUGINS_CFLAGS
27 35
36# Add the flags to the build!
28KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS) 37KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
38
39# All enabled GCC plugins are collected here for building below.
29GCC_PLUGIN := $(gcc-plugin-y) 40GCC_PLUGIN := $(gcc-plugin-y)
41export GCC_PLUGIN
30 42
31# Actually do the build, if requested. 43# Actually do the build, if requested.
32PHONY += gcc-plugins 44PHONY += gcc-plugins