From 3cd29a3d7c25cca9989e7d8966141f725fa99c68 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Fri, 13 Jan 2023 09:30:33 -0800 Subject: [PATCH] gcc-plugins: Fix build for upcoming GCC release The upcoming GCC release has refactored the gimple plugin interface a bit and unless gimple-iterator.h is included before gimple-fold.h I end up with a bunch of missing declarations when building the stack protector plugin. Upstream-Status: Backport [https://lore.kernel.org/all/20230113173033.4380-1-palmer@rivosinc.com/] Reported-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/all/20230113173033.4380-1-palmer@rivosinc.com/ Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook --- scripts/gcc-plugins/gcc-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/scripts/gcc-plugins/gcc-common.h +++ b/scripts/gcc-plugins/gcc-common.h @@ -108,7 +108,9 @@ #include "varasm.h" #include "stor-layout.h" #include "internal-fn.h" +#include "gimple.h" #include "gimple-expr.h" +#include "gimple-iterator.h" #include "gimple-fold.h" #include "context.h" #include "tree-ssa-alias.h" @@ -124,13 +126,10 @@ #include "gimplify.h" #endif -#include "gimple.h" - #if BUILDING_GCC_VERSION >= 4009 #include "tree-ssa-operands.h" #include "tree-phinodes.h" #include "tree-cfg.h" -#include "gimple-iterator.h" #include "gimple-ssa.h" #include "ssa-iterators.h" #endif