aboutsummaryrefslogtreecommitdiffstats
path: root/meta-ti-bsp/recipes-kernel/linux/files/0001-gcc-plugins-Fix-build-for-upcoming-GCC-release.patch
blob: 3dfa31a1f1334c371787874513295ad6d6e8e6d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 3cd29a3d7c25cca9989e7d8966141f725fa99c68 Mon Sep 17 00:00:00 2001
From: Palmer Dabbelt <palmer@rivosinc.com>
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 <palmer@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Link: https://lore.kernel.org/all/20230113173033.4380-1-palmer@rivosinc.com/
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 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