summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pagano <mpagano@gentoo.org>2023-10-18 15:54:56 -0400
committerMike Pagano <mpagano@gentoo.org>2023-10-18 15:54:56 -0400
commit10a9a6bf7b7d62357104ce0079711f0ccdbde3e2 (patch)
treef5db7cd66609c5fdd853d8f224cb35c22b3ba712
parentkheaders: make it possible to override TAR (diff)
downloadlinux-patches-10a9a6bf7b7d62357104ce0079711f0ccdbde3e2.tar.gz
linux-patches-10a9a6bf7b7d62357104ce0079711f0ccdbde3e2.tar.bz2
linux-patches-10a9a6bf7b7d62357104ce0079711f0ccdbde3e2.zip
gcc-plugins: Rename last_stmt() for GCC 14+
Signed-off-by: Mike Pagano <mpagano@gentoo.org>
-rw-r--r--0000_README4
-rw-r--r--2940_handle-gcc-14-last-stmt-rename.patch31
2 files changed, 35 insertions, 0 deletions
diff --git a/0000_README b/0000_README
index 665fa5a2..86ea0adc 100644
--- a/0000_README
+++ b/0000_README
@@ -107,6 +107,10 @@ Patch: 2930_tar_override.patch
From: https://lore.kernel.org/lkml/20230412082743.350699-1-mgorny@gentoo.org/#t
Desc: kheaders: make it possible to override TAR
+Patch: 2940_handle-gcc-14-last-stmt-rename.patch
+From: https://lore.kernel.org/all/20230811060545.never.564-kees@kernel.org/#Z31scripts:gcc-plugins:gcc-common.h
+Desc: gcc-plugins: Rename last_stmt() for GCC 14+
+
Patch: 3000_Support-printing-firmware-info.patch
From: https://bugs.gentoo.org/732852
Desc: Print firmware info (Reqs CONFIG_GENTOO_PRINT_FIRMWARE_INFO). Thanks to Georgy Yakovlev
diff --git a/2940_handle-gcc-14-last-stmt-rename.patch b/2940_handle-gcc-14-last-stmt-rename.patch
new file mode 100644
index 00000000..b04ce8da
--- /dev/null
+++ b/2940_handle-gcc-14-last-stmt-rename.patch
@@ -0,0 +1,31 @@
+From: Kees Cook <keescook@chromium.org>
+To: linux-hardening@vger.kernel.org
+Cc: Kees Cook <keescook@chromium.org>, linux-kernel@vger.kernel.org
+Subject: [PATCH] gcc-plugins: Rename last_stmt() for GCC 14+
+Date: Thu, 10 Aug 2023 23:05:49 -0700 [thread overview]
+Message-ID: <20230811060545.never.564-kees@kernel.org> (raw)
+
+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>
+---
+ scripts/gcc-plugins/gcc-common.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
+index 84c730da36dd..1ae39b9f4a95 100644
+--- a/scripts/gcc-plugins/gcc-common.h
++++ b/scripts/gcc-plugins/gcc-common.h
+@@ -440,4 +440,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
+--
+2.34.1