Blame view

scripts/Makefile.gcc-plugins 2.55 KB
b24413180   Greg Kroah-Hartman   License cleanup: ...
1
  # SPDX-License-Identifier: GPL-2.0
7ccb95e8f   Kees Cook   gcc-plugins: Regu...
2

59f53855b   Masahiro Yamada   gcc-plugins: test...
3
  gcc-plugin-$(CONFIG_GCC_PLUGIN_CYC_COMPLEXITY)	+= cyc_complexity_plugin.so
543c37cb1   Emese Revfy   Add sancov plugin
4

59f53855b   Masahiro Yamada   gcc-plugins: test...
5
  gcc-plugin-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY)	+= latent_entropy_plugin.so
7ccb95e8f   Kees Cook   gcc-plugins: Regu...
6
7
  gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY)		\
  		+= -DLATENT_ENTROPY_PLUGIN
59f53855b   Masahiro Yamada   gcc-plugins: test...
8
  ifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY
7ccb95e8f   Kees Cook   gcc-plugins: Regu...
9
      DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable
59f53855b   Masahiro Yamada   gcc-plugins: test...
10
  endif
7ccb95e8f   Kees Cook   gcc-plugins: Regu...
11
  export DISABLE_LATENT_ENTROPY_PLUGIN
c61f13eaa   Kees Cook   gcc-plugins: Add ...
12

59f53855b   Masahiro Yamada   gcc-plugins: test...
13
  gcc-plugin-$(CONFIG_GCC_PLUGIN_SANCOV)		+= sancov_plugin.so
7ccb95e8f   Kees Cook   gcc-plugins: Regu...
14

59f53855b   Masahiro Yamada   gcc-plugins: test...
15
  gcc-plugin-$(CONFIG_GCC_PLUGIN_STRUCTLEAK)	+= structleak_plugin.so
7ccb95e8f   Kees Cook   gcc-plugins: Regu...
16
17
  gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE)	\
  		+= -fplugin-arg-structleak_plugin-verbose
81a56f6dc   Kees Cook   gcc-plugins: stru...
18
19
  gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF)		\
  		+= -fplugin-arg-structleak_plugin-byref
7ccb95e8f   Kees Cook   gcc-plugins: Regu...
20
21
22
23
  gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL)	\
  		+= -fplugin-arg-structleak_plugin-byref-all
  gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK)		\
  		+= -DSTRUCTLEAK_PLUGIN
313dd1b62   Kees Cook   gcc-plugins: Add ...
24

59f53855b   Masahiro Yamada   gcc-plugins: test...
25
  gcc-plugin-$(CONFIG_GCC_PLUGIN_RANDSTRUCT)	+= randomize_layout_plugin.so
7ccb95e8f   Kees Cook   gcc-plugins: Regu...
26
27
28
29
  gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_RANDSTRUCT)		\
  		+= -DRANDSTRUCT_PLUGIN
  gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE)	\
  		+= -fplugin-arg-randomize_layout_plugin-performance-mode
6b90bd4ba   Emese Revfy   GCC plugin infras...
30

10e9ae9fa   Alexander Popov   gcc-plugins: Add ...
31
32
33
34
35
  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)
feee1b8c4   Alexander Popov   gcc-plugins/stack...
36
37
  gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STACKLEAK)		\
  		+= -fplugin-arg-stackleak_plugin-arch=$(SRCARCH)
10e9ae9fa   Alexander Popov   gcc-plugins: Add ...
38
39
40
41
  ifdef CONFIG_GCC_PLUGIN_STACKLEAK
      DISABLE_STACKLEAK_PLUGIN += -fplugin-arg-stackleak_plugin-disable
  endif
  export DISABLE_STACKLEAK_PLUGIN
189af4657   Ard Biesheuvel   ARM: smp: add sup...
42
43
44
45
46
  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
7ccb95e8f   Kees Cook   gcc-plugins: Regu...
47
48
  # All the plugin CFLAGS are collected here in case a build target needs to
  # filter them out of the KBUILD_CFLAGS.
59f53855b   Masahiro Yamada   gcc-plugins: test...
49
  GCC_PLUGINS_CFLAGS := $(strip $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y)) $(gcc-plugin-cflags-y))
7ccb95e8f   Kees Cook   gcc-plugins: Regu...
50
  # The sancov_plugin.so is included via CFLAGS_KCOV, so it is removed here.
59f53855b   Masahiro Yamada   gcc-plugins: test...
51
  GCC_PLUGINS_CFLAGS := $(filter-out %/sancov_plugin.so, $(GCC_PLUGINS_CFLAGS))
7ccb95e8f   Kees Cook   gcc-plugins: Regu...
52
  export GCC_PLUGINS_CFLAGS
ed58c0e9e   Kees Cook   gcc-plugins: abor...
53

7ccb95e8f   Kees Cook   gcc-plugins: Regu...
54
  # Add the flags to the build!
59f53855b   Masahiro Yamada   gcc-plugins: test...
55
  KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
7ccb95e8f   Kees Cook   gcc-plugins: Regu...
56
57
  
  # All enabled GCC plugins are collected here for building below.
59f53855b   Masahiro Yamada   gcc-plugins: test...
58
  GCC_PLUGIN := $(gcc-plugin-y)
7ccb95e8f   Kees Cook   gcc-plugins: Regu...
59
  export GCC_PLUGIN