]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gcc-plugins: Rename last_stmt() for GCC 14+
authorKees Cook <keescook@chromium.org>
Mon, 7 Aug 2023 16:41:19 +0000 (09:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Jul 2024 08:38:28 +0000 (10:38 +0200)
commit 2e3f65ccfe6b0778b261ad69c9603ae85f210334 upstream.

In GCC 14, last_stmt() was renamed to last_nondebug_stmt(). Add a helper
macro to handle the renaming.

Cc: linux-hardening@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
scripts/gcc-plugins/gcc-common.h

index 9ad76b7f3f10e71fc04c4a64196388ffe4e40481..0907ab19202a1cccba3443b1f675d0273524589c 100644 (file)
@@ -977,4 +977,8 @@ static inline void debug_gimple_stmt(const_gimple s)
 #define SET_DECL_MODE(decl, mode)      DECL_MODE(decl) = (mode)
 #endif
 
+#if BUILDING_GCC_VERSION >= 14000
+#define last_stmt(x)                   last_nondebug_stmt(x)
+#endif
+
 #endif