summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2023-06-08 23:13:35 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-14 11:09:30 +0200
commit02ce3cf222913143a6a44c2e1901e69b80885f09 (patch)
treedc28be4d2f0311efc78dcbbffa278fdda1365a34 /scripts
parent4c3ddc06cedb62f2904e58fd95170bf206bee149 (diff)
downloadlinux-stable-02ce3cf222913143a6a44c2e1901e69b80885f09.tar.gz
linux-stable-02ce3cf222913143a6a44c2e1901e69b80885f09.tar.bz2
linux-stable-02ce3cf222913143a6a44c2e1901e69b80885f09.zip
gcc-plugins: Reorganize gimple includes for GCC 13
mainline commit: e6a71160cc145e18ab45195abf89884112e02dfb The gimple-iterator.h header must be included before gimple-fold.h starting with GCC 13. Reorganize gimple headers to work for all GCC versions. 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> [ Modified to handle differences in other includes and conditional compilation in the 5.10.y tree. ] Signed-off-by: Paul Barker <paul.barker@sancloud.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gcc-plugins/gcc-common.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
index 9ad76b7f3f10..6d4563b8a52c 100644
--- a/scripts/gcc-plugins/gcc-common.h
+++ b/scripts/gcc-plugins/gcc-common.h
@@ -108,7 +108,13 @@
#include "varasm.h"
#include "stor-layout.h"
#include "internal-fn.h"
+#endif
+
+#include "gimple.h"
+
+#if BUILDING_GCC_VERSION >= 4009
#include "gimple-expr.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "context.h"
#include "tree-ssa-alias.h"
@@ -124,13 +130,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