]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
powerpc: Enable support for GCC plugins
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Tue, 6 Dec 2016 06:28:00 +0000 (17:28 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 3 Feb 2017 10:59:28 +0000 (21:59 +1100)
Enable support for GCC plugins on powerpc.

Add an additional version check in gcc-plugins-check to advise users to
upgrade to gcc 5.2+ on powerpc to avoid issues with header files (gcc <=
4.6) or missing copies of rs6000-cpus.def (4.8 to 5.1 on 64-bit
targets).

Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/Kconfig
scripts/Makefile.gcc-plugins

index 33f5b8380a7d634c39f10072154edf04890827b0..bfdd80e7754c2d56736e4b6ba7e192575a8b06c4 100644 (file)
@@ -93,6 +93,7 @@ config PPC
        select HAVE_DYNAMIC_FTRACE_WITH_REGS if MPROFILE_KERNEL
        select HAVE_FUNCTION_TRACER
        select HAVE_FUNCTION_GRAPH_TRACER
+       select HAVE_GCC_PLUGINS
        select SYSCTL_EXCEPTION_TRACE
        select VIRT_TO_BUS if !PPC64
        select HAVE_IDE
index 26c67b735dc9af67a53e349898163b0c82e6e594..9835a757d52a44afaee92f24ae7b7f8effaf3bd4 100644 (file)
@@ -47,6 +47,14 @@ gcc-plugins-check: FORCE
 ifdef CONFIG_GCC_PLUGINS
   ifeq ($(PLUGINCC),)
     ifneq ($(GCC_PLUGINS_CFLAGS),)
+      # Various gccs between 4.5 and 5.1 have bugs on powerpc due to missing
+      # header files. gcc <= 4.6 doesn't work at all, gccs from 4.8 to 5.1 have
+      # issues with 64-bit targets.
+      ifeq ($(ARCH),powerpc)
+        ifeq ($(call cc-ifversion, -le, 0501, y), y)
+         @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
+        endif
+      endif
       ifeq ($(call cc-ifversion, -ge, 0405, y), y)
        $(Q)$(srctree)/scripts/gcc-plugin.sh --show-error "$(__PLUGINCC)" "$(HOSTCXX)" "$(CC)" || true
        @echo "Cannot use CONFIG_GCC_PLUGINS: your gcc installation does not support plugins, perhaps the necessary headers are missing?" >&2 && exit 1