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_CYC_COMPLEXITY) += cyc_complexity_plugin.so
|
2016-05-24 00:09:38 +02: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
|
2023-03-27 14:52:34 -04: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
|
|
|
gcc-plugin-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) += structleak_plugin.so
|
|
|
|
|
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE) \
|
|
|
|
|
+= -fplugin-arg-structleak_plugin-verbose
|
2019-01-23 15:19:29 -08:00
|
|
|
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF) \
|
|
|
|
|
+= -fplugin-arg-structleak_plugin-byref
|
2018-07-11 17:38:52 -07:00
|
|
|
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) \
|
|
|
|
|
+= -fplugin-arg-structleak_plugin-byref-all
|
2023-02-22 13:05:35 -07:00
|
|
|
ifdef CONFIG_GCC_PLUGIN_STRUCTLEAK
|
|
|
|
|
DISABLE_STRUCTLEAK_PLUGIN += -fplugin-arg-structleak_plugin-disable
|
|
|
|
|
endif
|
|
|
|
|
export DISABLE_STRUCTLEAK_PLUGIN
|
2018-07-11 17:38:52 -07:00
|
|
|
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \
|
|
|
|
|
+= -DSTRUCTLEAK_PLUGIN
|
|
|
|
|
|
2018-08-17 01:16:59 +03:00
|
|
|
gcc-plugin-$(CONFIG_GCC_PLUGIN_STACKLEAK) += stackleak_plugin.so
|
|
|
|
|
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STACKLEAK) \
|
|
|
|
|
+= -DSTACKLEAK_PLUGIN
|
|
|
|
|
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STACKLEAK) \
|
|
|
|
|
+= -fplugin-arg-stackleak_plugin-track-min-size=$(CONFIG_STACKLEAK_TRACK_MIN_SIZE)
|
2020-06-24 15:33:29 +03:00
|
|
|
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STACKLEAK) \
|
|
|
|
|
+= -fplugin-arg-stackleak_plugin-arch=$(SRCARCH)
|
2018-08-17 01:16:59 +03:00
|
|
|
ifdef CONFIG_GCC_PLUGIN_STACKLEAK
|
|
|
|
|
DISABLE_STACKLEAK_PLUGIN += -fplugin-arg-stackleak_plugin-disable
|
|
|
|
|
endif
|
|
|
|
|
export DISABLE_STACKLEAK_PLUGIN
|
|
|
|
|
|
2018-12-06 09:32:57 +01:00
|
|
|
gcc-plugin-$(CONFIG_GCC_PLUGIN_ARM_SSP_PER_TASK) += arm_ssp_per_task_plugin.so
|
|
|
|
|
ifdef CONFIG_GCC_PLUGIN_ARM_SSP_PER_TASK
|
|
|
|
|
DISABLE_ARM_SSP_PER_TASK_PLUGIN += -fplugin-arg-arm_ssp_per_task_plugin-disable
|
|
|
|
|
endif
|
|
|
|
|
export DISABLE_ARM_SSP_PER_TASK_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.
|
|
|
|
|
GCC_PLUGINS_CFLAGS := $(strip $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y)) $(gcc-plugin-cflags-y))
|
|
|
|
|
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
|
|
|
|
2023-07-20 13:01:34 -04:00
|
|
|
# Some plugins are enabled outside of this Makefile, but they still need to
|
|
|
|
|
# be included in GCC_PLUGIN so they can get built.
|
|
|
|
|
gcc-plugin-external-$(CONFIG_GCC_PLUGIN_SANCOV) \
|
|
|
|
|
+= sancov_plugin.so
|
2023-07-20 13:02:43 -04:00
|
|
|
gcc-plugin-external-$(CONFIG_GCC_PLUGIN_RANDSTRUCT) \
|
|
|
|
|
+= randomize_layout_plugin.so
|
2023-07-20 13:01:34 -04: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
|