summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-fslc-imx/0001-Backport-minimal-compiler_attributes.h-to-support-GC.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-fslc-imx/0001-Backport-minimal-compiler_attributes.h-to-support-GC.patch')
-rw-r--r--recipes-kernel/linux/linux-fslc-imx/0001-Backport-minimal-compiler_attributes.h-to-support-GC.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-fslc-imx/0001-Backport-minimal-compiler_attributes.h-to-support-GC.patch b/recipes-kernel/linux/linux-fslc-imx/0001-Backport-minimal-compiler_attributes.h-to-support-GC.patch
new file mode 100644
index 00000000..aef97ea6
--- /dev/null
+++ b/recipes-kernel/linux/linux-fslc-imx/0001-Backport-minimal-compiler_attributes.h-to-support-GC.patch
@@ -0,0 +1,47 @@
1From fe5844365ec6c4d61838f289926f4d55da94d2fb Mon Sep 17 00:00:00 2001
2From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
3Date: Fri, 2 Aug 2019 12:37:56 +0200
4Subject: [PATCH 1/2] Backport minimal compiler_attributes.h to support GCC 9
5
6This adds support for __copy to v4.9.y so that we can use it in
7init/exit_module to avoid -Werror=missing-attributes errors on GCC 9.
8
9Link: https://lore.kernel.org/lkml/259986242.BvXPX32bHu@devpool35/
10Cc: <stable@vger.kernel.org>
11Suggested-by: Rolf Eike Beer <eb@emlix.com>
12Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
13Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14---
15 include/linux/compiler.h | 16 ++++++++++++++++
16 1 file changed, 16 insertions(+)
17
18diff --git a/include/linux/compiler.h b/include/linux/compiler.h
19index 3050de0dac96..0020ee1cab37 100644
20--- a/include/linux/compiler.h
21+++ b/include/linux/compiler.h
22@@ -54,6 +54,22 @@ extern void __chk_io_ptr(const volatile void __iomem *);
23
24 #ifdef __KERNEL__
25
26+/*
27+ * Minimal backport of compiler_attributes.h to add support for __copy
28+ * to v4.9.y so that we can use it in init/exit_module to avoid
29+ * -Werror=missing-attributes errors on GCC 9.
30+ */
31+#ifndef __has_attribute
32+# define __has_attribute(x) __GCC4_has_attribute_##x
33+# define __GCC4_has_attribute___copy__ 0
34+#endif
35+
36+#if __has_attribute(__copy__)
37+# define __copy(symbol) __attribute__((__copy__(symbol)))
38+#else
39+# define __copy(symbol)
40+#endif
41+
42 #ifdef __GNUC__
43 #include <linux/compiler-gcc.h>
44 #endif
45--
462.17.1
47