[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <71d8f8448d29c3ce5a7fd883e56c0edeb2f4106b.1727185783.git.geert+renesas@glider.be>
Date: Tue, 24 Sep 2024 15:55:20 +0200
From: Geert Uytterhoeven <geert+renesas@...der.be>
To: Tony Ambardar <tony.ambardar@...il.com>,
Daniel Borkmann <daniel@...earbox.net>,
Miguel Ojeda <ojeda@...nel.org>,
Jiri Olsa <jolsa@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Arnd Bergmann <arnd@...db.de>
Cc: linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert+renesas@...der.be>
Subject: [PATCH] compiler-gcc.h: Disable __retain on gcc-11
All my gcc-11 compilers (Ubuntu 11.4.0-1ubuntu1~22.04) claim to support
the __retain__ attribute, but only riscv64-linux-gnu-gcc-11 and
x86_64-linux-gnu-gcc-11 (not x86_64-linux-gnux32-gcc-11!) actually do.
The arm-linux-gnueabi-gcc-11.5.0 compiler from kernel.org crosstool
fails in the same way:
error: ‘retain’ attribute ignored [-Werror=attributes]
All my gcc-12 compilers seem to support the attribute.
Play it safe, and disable __retain unconditionally on gcc-11.
Fixes: 0a5d3258d7c97295 ("compiler_types.h: Define __retain for __attribute__((__retain__))")
Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
---
include/linux/compiler-gcc.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index f805adaa316e9a21..bedeb76b63a34745 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -145,3 +145,12 @@
#if GCC_VERSION < 90100
#undef __alloc_size__
#endif
+
+/*
+ * Most 11.x compilers claim to support it, but only riscv64-linux-gnu-gcc and
+ * x86_64-linux-gnu-gcc actually do.
+ */
+#if GCC_VERSION < 120000
+#undef __retain
+#define __retain
+#endif
--
2.34.1
Powered by blists - more mailing lists