Makefile.gcc-plugins (7b4010edff09929c253e6626ab19cade9e250505) Makefile.gcc-plugins (65c059bcaa73197ca71e8d4cc9a6c903560506c1)
1ifdef CONFIG_GCC_PLUGINS
2 __PLUGINCC := $(call cc-ifversion, -ge, 0408, $(HOSTCXX), $(HOSTCC))
3 PLUGINCC := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(__PLUGINCC)" "$(HOSTCXX)" "$(CC)")
4
5 SANCOV_PLUGIN := -fplugin=$(objtree)/scripts/gcc-plugins/sancov_plugin.so
6
7 gcc-plugin-$(CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) += cyc_complexity_plugin.so
8

--- 33 unchanged lines hidden (view full) ---

42
43# If plugins aren't supported, abort the build before hard-to-read compiler
44# errors start getting spewed by the main build.
45PHONY += gcc-plugins-check
46gcc-plugins-check: FORCE
47ifdef CONFIG_GCC_PLUGINS
48 ifeq ($(PLUGINCC),)
49 ifneq ($(GCC_PLUGINS_CFLAGS),)
1ifdef CONFIG_GCC_PLUGINS
2 __PLUGINCC := $(call cc-ifversion, -ge, 0408, $(HOSTCXX), $(HOSTCC))
3 PLUGINCC := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(__PLUGINCC)" "$(HOSTCXX)" "$(CC)")
4
5 SANCOV_PLUGIN := -fplugin=$(objtree)/scripts/gcc-plugins/sancov_plugin.so
6
7 gcc-plugin-$(CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) += cyc_complexity_plugin.so
8

--- 33 unchanged lines hidden (view full) ---

42
43# If plugins aren't supported, abort the build before hard-to-read compiler
44# errors start getting spewed by the main build.
45PHONY += gcc-plugins-check
46gcc-plugins-check: FORCE
47ifdef CONFIG_GCC_PLUGINS
48 ifeq ($(PLUGINCC),)
49 ifneq ($(GCC_PLUGINS_CFLAGS),)
50 # Various gccs between 4.5 and 5.1 have bugs on powerpc due to missing
51 # header files. gcc <= 4.6 doesn't work at all, gccs from 4.8 to 5.1 have
52 # issues with 64-bit targets.
53 ifeq ($(ARCH),powerpc)
54 ifeq ($(call cc-ifversion, -le, 0501, y), y)
55 @echo "Cannot use CONFIG_GCC_PLUGINS: plugin support on gcc <= 5.1 is buggy on powerpc, please upgrade to gcc 5.2 or newer" >&2 && exit 1
56 endif
57 endif
50 ifeq ($(call cc-ifversion, -ge, 0405, y), y)
51 $(Q)$(srctree)/scripts/gcc-plugin.sh --show-error "$(__PLUGINCC)" "$(HOSTCXX)" "$(CC)" || true
52 @echo "Cannot use CONFIG_GCC_PLUGINS: your gcc installation does not support plugins, perhaps the necessary headers are missing?" >&2 && exit 1
53 else
54 @echo "Cannot use CONFIG_GCC_PLUGINS: your gcc version does not support plugins, you should upgrade it to at least gcc 4.5" >&2 && exit 1
55 endif
56 endif
57 endif
58endif
59 @:
60
61# Actually do the build, if requested.
62PHONY += gcc-plugins
63gcc-plugins: scripts_basic gcc-plugins-check
64ifdef CONFIG_GCC_PLUGINS
65 $(Q)$(MAKE) $(build)=scripts/gcc-plugins
66endif
67 @:
58 ifeq ($(call cc-ifversion, -ge, 0405, y), y)
59 $(Q)$(srctree)/scripts/gcc-plugin.sh --show-error "$(__PLUGINCC)" "$(HOSTCXX)" "$(CC)" || true
60 @echo "Cannot use CONFIG_GCC_PLUGINS: your gcc installation does not support plugins, perhaps the necessary headers are missing?" >&2 && exit 1
61 else
62 @echo "Cannot use CONFIG_GCC_PLUGINS: your gcc version does not support plugins, you should upgrade it to at least gcc 4.5" >&2 && exit 1
63 endif
64 endif
65 endif
66endif
67 @:
68
69# Actually do the build, if requested.
70PHONY += gcc-plugins
71gcc-plugins: scripts_basic gcc-plugins-check
72ifdef CONFIG_GCC_PLUGINS
73 $(Q)$(MAKE) $(build)=scripts/gcc-plugins
74endif
75 @: