summaryrefslogtreecommitdiffstats
path: root/recipes-kernel
diff options
context:
space:
mode:
authorAndrei Gherzan <andrei@gherzan.ro>2016-06-15 00:50:20 +0100
committerAndrei Gherzan <andrei@gherzan.ro>2016-07-08 11:33:44 +0100
commitf38938f6ca6feea677da8b8fe9577868d310d2a7 (patch)
tree3329fb258c43b7ec56e4685b70e6512d5172a2d7 /recipes-kernel
parent4fb1a155dc7365de2a2b4ee3cd9329ec25023e3c (diff)
downloadmeta-raspberrypi-f38938f6ca6feea677da8b8fe9577868d310d2a7.tar.gz
linux-raspberrypi: Fix v4.1 with GCC6
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
Diffstat (limited to 'recipes-kernel')
-rw-r--r--recipes-kernel/linux/linux-raspberrypi-4.1/0002-vmcs-Remove-unused-sm_cache_map_vector-definition.patch31
-rw-r--r--recipes-kernel/linux/linux-raspberrypi-4.1/0003-fix-gcc6.patch78
-rw-r--r--recipes-kernel/linux/linux-raspberrypi_4.1.bb2
3 files changed, 111 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-raspberrypi-4.1/0002-vmcs-Remove-unused-sm_cache_map_vector-definition.patch b/recipes-kernel/linux/linux-raspberrypi-4.1/0002-vmcs-Remove-unused-sm_cache_map_vector-definition.patch
new file mode 100644
index 0000000..8d4a900
--- /dev/null
+++ b/recipes-kernel/linux/linux-raspberrypi-4.1/0002-vmcs-Remove-unused-sm_cache_map_vector-definition.patch
@@ -0,0 +1,31 @@
1The code using it also ifdef'ed with 0, anyyd gcc 6
2complains
3
4error: 'sm_cache_map_vector' defined but not used
5
6The code using it also ifdef'ed out
7
8Upstream-status: Denied [https://github.com/raspberrypi/linux/pull/1528]
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 drivers/char/broadcom/vc_sm/vmcs_sm.c | 2 ++
13 1 file changed, 2 insertions(+)
14
15--- a/drivers/char/broadcom/vc_sm/vmcs_sm.c
16+++ b/drivers/char/broadcom/vc_sm/vmcs_sm.c
17@@ -197,12 +197,14 @@ struct SM_STATE_T {
18 static struct SM_STATE_T *sm_state;
19 static int sm_inited;
20
21+#if 0
22 static const char *const sm_cache_map_vector[] = {
23 "(null)",
24 "host",
25 "videocore",
26 "host+videocore",
27 };
28+#endif
29
30 /* ---- Private Function Prototypes -------------------------------------- */
31
diff --git a/recipes-kernel/linux/linux-raspberrypi-4.1/0003-fix-gcc6.patch b/recipes-kernel/linux/linux-raspberrypi-4.1/0003-fix-gcc6.patch
new file mode 100644
index 0000000..61ec2fb
--- /dev/null
+++ b/recipes-kernel/linux/linux-raspberrypi-4.1/0003-fix-gcc6.patch
@@ -0,0 +1,78 @@
1Fix compile with GCC6
2
3Upstream-status: Denied [https://github.com/raspberrypi/linux/pull/1528]
4
5Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
6
7Index: source/include/linux/compiler-gcc6.h
8===================================================================
9--- /dev/null
10+++ source/include/linux/compiler-gcc6.h
11@@ -0,0 +1,67 @@
12+#ifndef __LINUX_COMPILER_H
13+#error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead."
14+#endif
15+
16+#define __used __attribute__((__used__))
17+#define __must_check __attribute__((warn_unused_result))
18+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
19+
20+/* Mark functions as cold. gcc will assume any path leading to a call
21+ to them will be unlikely. This means a lot of manual unlikely()s
22+ are unnecessary now for any paths leading to the usual suspects
23+ like BUG(), printk(), panic() etc. [but let's keep them for now for
24+ older compilers]
25+
26+ Early snapshots of gcc 4.3 don't support this and we can't detect this
27+ in the preprocessor, but we can live with this because they're unreleased.
28+ Maketime probing would be overkill here.
29+
30+ gcc also has a __attribute__((__hot__)) to move hot functions into
31+ a special section, but I don't see any sense in this right now in
32+ the kernel context */
33+#define __cold __attribute__((__cold__))
34+
35+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
36+
37+#ifndef __CHECKER__
38+# define __compiletime_warning(message) __attribute__((warning(message)))
39+# define __compiletime_error(message) __attribute__((error(message)))
40+#endif /* __CHECKER__ */
41+
42+/*
43+ * Mark a position in code as unreachable. This can be used to
44+ * suppress control flow warnings after asm blocks that transfer
45+ * control elsewhere.
46+ *
47+ * Early snapshots of gcc 4.5 don't support this and we can't detect
48+ * this in the preprocessor, but we can live with this because they're
49+ * unreleased. Really, we need to have autoconf for the kernel.
50+ */
51+#define unreachable() __builtin_unreachable()
52+
53+/* Mark a function definition as prohibited from being cloned. */
54+#define __noclone __attribute__((__noclone__))
55+
56+/*
57+ * Tell the optimizer that something else uses this function or variable.
58+ */
59+#define __visible __attribute__((externally_visible))
60+
61+/*
62+ * GCC 'asm goto' miscompiles certain code sequences:
63+ *
64+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
65+ *
66+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
67+ *
68+ * (asm goto is automatically volatile - the naming reflects this.)
69+ */
70+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
71+
72+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
73+#define __HAVE_BUILTIN_BSWAP32__
74+#define __HAVE_BUILTIN_BSWAP64__
75+#define __HAVE_BUILTIN_BSWAP16__
76+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
77+
78+#define KASAN_ABI_VERSION 4
diff --git a/recipes-kernel/linux/linux-raspberrypi_4.1.bb b/recipes-kernel/linux/linux-raspberrypi_4.1.bb
index 79fac66..87c77b8 100644
--- a/recipes-kernel/linux/linux-raspberrypi_4.1.bb
+++ b/recipes-kernel/linux/linux-raspberrypi_4.1.bb
@@ -5,6 +5,8 @@ LINUX_VERSION ?= "4.1.21"
5SRCREV = "ff45bc0e8917c77461b2901e2743e6339bb70413" 5SRCREV = "ff45bc0e8917c77461b2901e2743e6339bb70413"
6SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.1.y \ 6SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.1.y \
7 file://0001-dts-add-overlay-for-pitft22.patch \ 7 file://0001-dts-add-overlay-for-pitft22.patch \
8 file://0002-vmcs-Remove-unused-sm_cache_map_vector-definition.patch \
9 file://0003-fix-gcc6.patch \
8 " 10 "
9 11
10require linux-raspberrypi.inc 12require linux-raspberrypi.inc