Makefile.gcc-plugins 1.2 KB

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