1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 27ccb95e8SKees Cook 338addce8SEmese Revfygcc-plugin-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) += latent_entropy_plugin.so 47ccb95e8SKees Cookgcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) \ 57ccb95e8SKees Cook += -DLATENT_ENTROPY_PLUGIN 67b4010edSAndrew Donnellanifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY 7012e8d20SAndrew Donnellan DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable -ULATENT_ENTROPY_PLUGIN 838addce8SEmese Revfyendif 95aadfdebSMasahiro Yamadaexport DISABLE_LATENT_ENTROPY_PLUGIN 106b90bd4bSEmese Revfy 117ccb95e8SKees Cook# All the plugin CFLAGS are collected here in case a build target needs to 127ccb95e8SKees Cook# filter them out of the KBUILD_CFLAGS. 130cecd37dSKees CookGCC_PLUGINS_CFLAGS := $(strip $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y)) $(gcc-plugin-cflags-y)) -DGCC_PLUGINS 147ccb95e8SKees Cookexport GCC_PLUGINS_CFLAGS 157ccb95e8SKees Cook 167ccb95e8SKees Cook# Add the flags to the build! 176b90bd4bSEmese RevfyKBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS) 187ccb95e8SKees Cook 19d3646589SKees Cook# Some plugins are enabled outside of this Makefile, but they still need to 20d3646589SKees Cook# be included in GCC_PLUGIN so they can get built. 21613f4b3eSKees Cookgcc-plugin-external-$(CONFIG_GCC_PLUGIN_RANDSTRUCT) \ 22613f4b3eSKees Cook += randomize_layout_plugin.so 23*76261fc7SKees Cookgcc-plugin-external-$(CONFIG_GCC_PLUGIN_STACKLEAK) \ 24*76261fc7SKees Cook += stackleak_plugin.so 25d3646589SKees Cook 26d3646589SKees Cook# All enabled GCC plugins are collected here for building in 27d3646589SKees Cook# scripts/gcc-scripts/Makefile. 28d3646589SKees CookGCC_PLUGIN := $(gcc-plugin-y) $(gcc-plugin-external-y) 297ccb95e8SKees Cookexport GCC_PLUGIN 30