| 1 |
# SPDX-License-Identifier: GPL-2.0 |
| 2 |
|
| 3 |
gcc-plugin-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) += latent_entropy_plugin.so |
| 4 |
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) \ |
| 5 |
+= -DLATENT_ENTROPY_PLUGIN |
| 6 |
ifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY |
| 7 |
DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable -ULATENT_ENTROPY_PLUGIN |
| 8 |
endif |
| 9 |
export DISABLE_LATENT_ENTROPY_PLUGIN |
| 10 |
|
| 11 |
# All the plugin CFLAGS are collected here in case a build target needs to |
| 12 |
# filter them out of the KBUILD_CFLAGS. |
| 13 |
GCC_PLUGINS_CFLAGS := $(strip $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y)) $(gcc-plugin-cflags-y)) -DGCC_PLUGINS |
| 14 |
export GCC_PLUGINS_CFLAGS |
| 15 |
|
| 16 |
# Add the flags to the build! |
| 17 |
KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS) |
| 18 |
|
| 19 |
# Some plugins are enabled outside of this Makefile, but they still need to |
| 20 |
# be included in GCC_PLUGIN so they can get built. |
| 21 |
gcc-plugin-external-$(CONFIG_GCC_PLUGIN_RANDSTRUCT) \ |
| 22 |
+= randomize_layout_plugin.so |
| 23 |
gcc-plugin-external-$(CONFIG_GCC_PLUGIN_STACKLEAK) \ |
| 24 |
+= stackleak_plugin.so |
| 25 |
|
| 26 |
# All enabled GCC plugins are collected here for building in |
| 27 |
# scripts/gcc-scripts/Makefile. |
| 28 |
GCC_PLUGIN := $(gcc-plugin-y) $(gcc-plugin-external-y) |
| 29 |
export GCC_PLUGIN |