2017-11-01 15:07:57 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2018-07-11 17:38:52 -07:00
|
|
|
|
2018-05-28 18:22:06 +09:00
|
|
|
gcc-plugin-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) += latent_entropy_plugin.so
|
2018-07-11 17:38:52 -07:00
|
|
|
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) \
|
|
|
|
|
+= -DLATENT_ENTROPY_PLUGIN
|
2018-05-28 18:22:06 +09:00
|
|
|
ifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY
|
2022-08-16 15:17:20 +10:00
|
|
|
DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable -ULATENT_ENTROPY_PLUGIN
|
2016-05-24 00:09:38 +02:00
|
|
|
endif
|
2018-05-28 18:22:06 +09:00
|
|
|
export DISABLE_LATENT_ENTROPY_PLUGIN
|
|
|
|
|
|
2018-07-11 17:38:52 -07:00
|
|
|
# All the plugin CFLAGS are collected here in case a build target needs to
|
|
|
|
|
# filter them out of the KBUILD_CFLAGS.
|
2025-05-03 11:46:18 -07:00
|
|
|
GCC_PLUGINS_CFLAGS := $(strip $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y)) $(gcc-plugin-cflags-y)) -DGCC_PLUGINS
|
2018-07-11 17:38:52 -07:00
|
|
|
export GCC_PLUGINS_CFLAGS
|
|
|
|
|
|
|
|
|
|
# Add the flags to the build!
|
2018-05-28 18:22:06 +09:00
|
|
|
KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
|
2018-07-11 17:38:52 -07:00
|
|
|
|
2022-05-03 13:54:59 -07:00
|
|
|
# Some plugins are enabled outside of this Makefile, but they still need to
|
|
|
|
|
# be included in GCC_PLUGIN so they can get built.
|
2022-05-03 13:55:01 -07:00
|
|
|
gcc-plugin-external-$(CONFIG_GCC_PLUGIN_RANDSTRUCT) \
|
|
|
|
|
+= randomize_layout_plugin.so
|
2025-07-17 16:25:08 -07:00
|
|
|
gcc-plugin-external-$(CONFIG_GCC_PLUGIN_STACKLEAK) \
|
|
|
|
|
+= stackleak_plugin.so
|
2022-05-03 13:54:59 -07:00
|
|
|
|
|
|
|
|
# All enabled GCC plugins are collected here for building in
|
|
|
|
|
# scripts/gcc-scripts/Makefile.
|
|
|
|
|
GCC_PLUGIN := $(gcc-plugin-y) $(gcc-plugin-external-y)
|
2018-07-11 17:38:52 -07:00
|
|
|
export GCC_PLUGIN
|