lkml.org 
[lkml]   [2016]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v8 2/4] GCC plugin infrastructure
From
Date
Dne 13.5.2016 v 01:57 Emese Revfy napsal(a):
> --- /dev/null
> +++ b/scripts/Makefile.gcc-plugins
> @@ -0,0 +1,21 @@
> +ifdef CONFIG_GCC_PLUGINS
> + __PLUGINCC := $(call cc-ifversion, -ge, 0408, $(HOSTCXX), $(HOSTCC))
> + PLUGINCC := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(__PLUGINCC)" "$(HOSTCXX)" "$(CC)")
> +
> + GCC_PLUGINS_CFLAGS := $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y))
> +
> + ifeq ($(PLUGINCC),)
> + ifneq ($(GCC_PLUGINS_CFLAGS),)
> + ifeq ($(call cc-ifversion, -ge, 0405, y), y)
> + PLUGINCC := $(shell $(CO, NFIG_SHELL) -x $(srctree)/scripts/gcc-plugin.sh "$(__PLUGINCC)" "$(HOSTCXX)" "$(CC)")
> + $(error error, your gcc installation does not support plugins, perhaps the necessary headers are missing?)
> + else
> + $(error error, your gcc version does not support plugins, you should upgrade it to gcc 4.5 at least)
> + endif
> + endif
> + endif
> +
> + KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
> + GCC_PLUGIN := $(gcc-plugin-y)
> +
> +endif

Hi Emese,

sorry for the late feedback. A problem I ran into now is that if you
have a compiler that is either too old or built with plugin support
disabled, scripts/Makefile.gcc-plugins errors out immediately. This is
going to be an issue with allmodconfig/allyesconfig test builds. A
solution would either be to make the respective options depend on
!COMPILE_TEST, or turn the errors into warnings and do nothing if the
compiler lacks plugin support. We are handling CONFIG_CC_STACKPROTECTOR
on x86 this way already.

Michal

\
 
 \ /
  Last update: 2016-05-17 16:41    [W:0.121 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site