summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauren Post <lauren.post@nxp.com>2016-08-01 17:53:33 -0500
committerOtavio Salvador <otavio@ossystems.com.br>2016-08-04 10:22:19 -0300
commit8be121ee311690daccac3c6e25963be0fd21fb0e (patch)
treedcdab66dec626bdae9f02583079520b53aea075c
parent80144950435d93635256a1b3a07ace8385672a69 (diff)
downloadmeta-fsl-arm-8be121ee311690daccac3c6e25963be0fd21fb0e.tar.gz
linux-imx: patches to file build errors with GCC6
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
-rw-r--r--recipes-kernel/linux/linux-imx-4.1.15/imx/bcmhd_gcc6_indent_warning_error_fix.patch28
-rw-r--r--recipes-kernel/linux/linux-imx-4.1.15/imx/gcc6_integrate_fix.patch369
-rw-r--r--recipes-kernel/linux/linux-imx-4.1.15/imx/gpu-viv_gcc6_indent_warning_error_fix.patch30
-rw-r--r--recipes-kernel/linux/linux-imx_4.1.15.bb5
4 files changed, 432 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-imx-4.1.15/imx/bcmhd_gcc6_indent_warning_error_fix.patch b/recipes-kernel/linux/linux-imx-4.1.15/imx/bcmhd_gcc6_indent_warning_error_fix.patch
new file mode 100644
index 0000000..4946930
--- /dev/null
+++ b/recipes-kernel/linux/linux-imx-4.1.15/imx/bcmhd_gcc6_indent_warning_error_fix.patch
@@ -0,0 +1,28 @@
1From 86e5baf037a03464e56ee1edcebb598c43ffb1f6 Mon Sep 17 00:00:00 2001
2From: Lauren Post <lauren.post@nxp.com>
3Date: Wed, 13 Jul 2016 01:37:31 -0500
4Subject: [PATCH] bcmdhd: dhd_sdio: Fix indent for gcc 6.0 error
5
6Upstream-Status: Pending
7
8Signed-off-by: Lauren Post <lauren.post@nxp.com>
9---
10 drivers/net/wireless/bcmdhd/dhd_sdio.c | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/drivers/net/wireless/bcmdhd/dhd_sdio.c b/drivers/net/wireless/bcmdhd/dhd_sdio.c
14index 8cb8796..09e1f32 100644
15--- a/drivers/net/wireless/bcmdhd/dhd_sdio.c
16+++ b/drivers/net/wireless/bcmdhd/dhd_sdio.c
17@@ -8046,7 +8046,7 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
18 } else
19 bcmerror = BCME_SDIO_ERROR;
20
21- dhd_os_sdunlock(dhdp);
22+ dhd_os_sdunlock(dhdp);
23 } else {
24 bcmerror = BCME_SDIO_ERROR;
25 DHD_INFO(("%s called when dongle is not in reset\n",
26--
271.9.1
28
diff --git a/recipes-kernel/linux/linux-imx-4.1.15/imx/gcc6_integrate_fix.patch b/recipes-kernel/linux/linux-imx-4.1.15/imx/gcc6_integrate_fix.patch
new file mode 100644
index 0000000..98f21e2
--- /dev/null
+++ b/recipes-kernel/linux/linux-imx-4.1.15/imx/gcc6_integrate_fix.patch
@@ -0,0 +1,369 @@
1From e9809ecf104f0c584c9c00917037a864e9f2ffba Mon Sep 17 00:00:00 2001
2From: Joe Perches <joe@perches.com>
3Date: Thu, 25 Jun 2015 15:01:02 -0700
4Subject: [PATCH] compiler-gcc: integrate the various compiler-gcc[345].h files
5
6[ Upstream commit cb984d101b30eb7478d32df56a0023e4603cba7f ]
7
8As gcc major version numbers are going to advance rather rapidly in the
9future, there's no real value in separate files for each compiler
10version.
11
12Deduplicate some of the macros #defined in each file too.
13
14Neaten comments using normal kernel commenting style.
15
16Signed-off-by: Joe Perches <joe@perches.com>
17Cc: Andi Kleen <andi@firstfloor.org>
18Cc: Michal Marek <mmarek@suse.cz>
19Cc: Segher Boessenkool <segher@kernel.crashing.org>
20Cc: Sasha Levin <levinsasha928@gmail.com>
21Cc: Anton Blanchard <anton@samba.org>
22Cc: Alan Modra <amodra@gmail.com>
23Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
24Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
25Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
26(cherry picked from commit f320793e52aee78f0fbb8bcaf10e6614d2e67bfc)
27---
28 include/linux/compiler-gcc.h | 120 ++++++++++++++++++++++++++++++++++++++++--
29 include/linux/compiler-gcc3.h | 23 --------
30 include/linux/compiler-gcc4.h | 91 --------------------------------
31 include/linux/compiler-gcc5.h | 67 -----------------------
32 4 files changed, 116 insertions(+), 185 deletions(-)
33 delete mode 100644 include/linux/compiler-gcc3.h
34 delete mode 100644 include/linux/compiler-gcc4.h
35 delete mode 100644 include/linux/compiler-gcc5.h
36
37diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
38index 371e560..484ef6e 100644
39--- a/include/linux/compiler-gcc.h
40+++ b/include/linux/compiler-gcc.h
41@@ -115,10 +115,122 @@
42 #define __maybe_unused __attribute__((unused))
43 #define __always_unused __attribute__((unused))
44
45-#define __gcc_header(x) #x
46-#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
47-#define gcc_header(x) _gcc_header(x)
48-#include gcc_header(__GNUC__)
49+/* gcc version specific checks */
50+
51+#if GCC_VERSION < 30200
52+# error Sorry, your compiler is too old - please upgrade it.
53+#endif
54+
55+#if GCC_VERSION < 30300
56+# define __used __attribute__((__unused__))
57+#else
58+# define __used __attribute__((__used__))
59+#endif
60+
61+#ifdef CONFIG_GCOV_KERNEL
62+# if GCC_VERSION < 30400
63+# error "GCOV profiling support for gcc versions below 3.4 not included"
64+# endif /* __GNUC_MINOR__ */
65+#endif /* CONFIG_GCOV_KERNEL */
66+
67+#if GCC_VERSION >= 30400
68+#define __must_check __attribute__((warn_unused_result))
69+#endif
70+
71+#if GCC_VERSION >= 40000
72+
73+/* GCC 4.1.[01] miscompiles __weak */
74+#ifdef __KERNEL__
75+# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101
76+# error Your version of gcc miscompiles the __weak directive
77+# endif
78+#endif
79+
80+#define __used __attribute__((__used__))
81+#define __compiler_offsetof(a, b) \
82+ __builtin_offsetof(a, b)
83+
84+#if GCC_VERSION >= 40100 && GCC_VERSION < 40600
85+# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
86+#endif
87+
88+#if GCC_VERSION >= 40300
89+/* Mark functions as cold. gcc will assume any path leading to a call
90+ * to them will be unlikely. This means a lot of manual unlikely()s
91+ * are unnecessary now for any paths leading to the usual suspects
92+ * like BUG(), printk(), panic() etc. [but let's keep them for now for
93+ * older compilers]
94+ *
95+ * Early snapshots of gcc 4.3 don't support this and we can't detect this
96+ * in the preprocessor, but we can live with this because they're unreleased.
97+ * Maketime probing would be overkill here.
98+ *
99+ * gcc also has a __attribute__((__hot__)) to move hot functions into
100+ * a special section, but I don't see any sense in this right now in
101+ * the kernel context
102+ */
103+#define __cold __attribute__((__cold__))
104+
105+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
106+
107+#ifndef __CHECKER__
108+# define __compiletime_warning(message) __attribute__((warning(message)))
109+# define __compiletime_error(message) __attribute__((error(message)))
110+#endif /* __CHECKER__ */
111+#endif /* GCC_VERSION >= 40300 */
112+
113+#if GCC_VERSION >= 40500
114+/*
115+ * Mark a position in code as unreachable. This can be used to
116+ * suppress control flow warnings after asm blocks that transfer
117+ * control elsewhere.
118+ *
119+ * Early snapshots of gcc 4.5 don't support this and we can't detect
120+ * this in the preprocessor, but we can live with this because they're
121+ * unreleased. Really, we need to have autoconf for the kernel.
122+ */
123+#define unreachable() __builtin_unreachable()
124+
125+/* Mark a function definition as prohibited from being cloned. */
126+#define __noclone __attribute__((__noclone__))
127+
128+#endif /* GCC_VERSION >= 40500 */
129+
130+#if GCC_VERSION >= 40600
131+/*
132+ * Tell the optimizer that something else uses this function or variable.
133+ */
134+#define __visible __attribute__((externally_visible))
135+#endif
136+
137+/*
138+ * GCC 'asm goto' miscompiles certain code sequences:
139+ *
140+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
141+ *
142+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
143+ *
144+ * (asm goto is automatically volatile - the naming reflects this.)
145+ */
146+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
147+
148+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
149+#if GCC_VERSION >= 40400
150+#define __HAVE_BUILTIN_BSWAP32__
151+#define __HAVE_BUILTIN_BSWAP64__
152+#endif
153+#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600)
154+#define __HAVE_BUILTIN_BSWAP16__
155+#endif
156+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
157+
158+#if GCC_VERSION >= 50000
159+#define KASAN_ABI_VERSION 4
160+#elif GCC_VERSION >= 40902
161+#define KASAN_ABI_VERSION 3
162+#endif
163+
164+#endif /* gcc version >= 40000 specific checks */
165
166 #if !defined(__noclone)
167 #define __noclone /* not needed */
168diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h
169deleted file mode 100644
170index 7d89feb..0000000
171--- a/include/linux/compiler-gcc3.h
172+++ /dev/null
173@@ -1,23 +0,0 @@
174-#ifndef __LINUX_COMPILER_H
175-#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead."
176-#endif
177-
178-#if GCC_VERSION < 30200
179-# error Sorry, your compiler is too old - please upgrade it.
180-#endif
181-
182-#if GCC_VERSION >= 30300
183-# define __used __attribute__((__used__))
184-#else
185-# define __used __attribute__((__unused__))
186-#endif
187-
188-#if GCC_VERSION >= 30400
189-#define __must_check __attribute__((warn_unused_result))
190-#endif
191-
192-#ifdef CONFIG_GCOV_KERNEL
193-# if GCC_VERSION < 30400
194-# error "GCOV profiling support for gcc versions below 3.4 not included"
195-# endif /* __GNUC_MINOR__ */
196-#endif /* CONFIG_GCOV_KERNEL */
197diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
198deleted file mode 100644
199index 769e198..0000000
200--- a/include/linux/compiler-gcc4.h
201+++ /dev/null
202@@ -1,91 +0,0 @@
203-#ifndef __LINUX_COMPILER_H
204-#error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead."
205-#endif
206-
207-/* GCC 4.1.[01] miscompiles __weak */
208-#ifdef __KERNEL__
209-# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101
210-# error Your version of gcc miscompiles the __weak directive
211-# endif
212-#endif
213-
214-#define __used __attribute__((__used__))
215-#define __must_check __attribute__((warn_unused_result))
216-#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
217-
218-#if GCC_VERSION >= 40100 && GCC_VERSION < 40600
219-# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
220-#endif
221-
222-#if GCC_VERSION >= 40300
223-/* Mark functions as cold. gcc will assume any path leading to a call
224- to them will be unlikely. This means a lot of manual unlikely()s
225- are unnecessary now for any paths leading to the usual suspects
226- like BUG(), printk(), panic() etc. [but let's keep them for now for
227- older compilers]
228-
229- Early snapshots of gcc 4.3 don't support this and we can't detect this
230- in the preprocessor, but we can live with this because they're unreleased.
231- Maketime probing would be overkill here.
232-
233- gcc also has a __attribute__((__hot__)) to move hot functions into
234- a special section, but I don't see any sense in this right now in
235- the kernel context */
236-#define __cold __attribute__((__cold__))
237-
238-#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
239-
240-#ifndef __CHECKER__
241-# define __compiletime_warning(message) __attribute__((warning(message)))
242-# define __compiletime_error(message) __attribute__((error(message)))
243-#endif /* __CHECKER__ */
244-#endif /* GCC_VERSION >= 40300 */
245-
246-#if GCC_VERSION >= 40500
247-/*
248- * Mark a position in code as unreachable. This can be used to
249- * suppress control flow warnings after asm blocks that transfer
250- * control elsewhere.
251- *
252- * Early snapshots of gcc 4.5 don't support this and we can't detect
253- * this in the preprocessor, but we can live with this because they're
254- * unreleased. Really, we need to have autoconf for the kernel.
255- */
256-#define unreachable() __builtin_unreachable()
257-
258-/* Mark a function definition as prohibited from being cloned. */
259-#define __noclone __attribute__((__noclone__))
260-
261-#endif /* GCC_VERSION >= 40500 */
262-
263-#if GCC_VERSION >= 40600
264-/*
265- * Tell the optimizer that something else uses this function or variable.
266- */
267-#define __visible __attribute__((externally_visible))
268-#endif
269-
270-/*
271- * GCC 'asm goto' miscompiles certain code sequences:
272- *
273- * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
274- *
275- * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
276- *
277- * (asm goto is automatically volatile - the naming reflects this.)
278- */
279-#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
280-
281-#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
282-#if GCC_VERSION >= 40400
283-#define __HAVE_BUILTIN_BSWAP32__
284-#define __HAVE_BUILTIN_BSWAP64__
285-#endif
286-#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600)
287-#define __HAVE_BUILTIN_BSWAP16__
288-#endif
289-#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
290-
291-#if GCC_VERSION >= 40902
292-#define KASAN_ABI_VERSION 3
293-#endif
294diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h
295deleted file mode 100644
296index efee493..0000000
297--- a/include/linux/compiler-gcc5.h
298+++ /dev/null
299@@ -1,67 +0,0 @@
300-#ifndef __LINUX_COMPILER_H
301-#error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead."
302-#endif
303-
304-#define __used __attribute__((__used__))
305-#define __must_check __attribute__((warn_unused_result))
306-#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
307-
308-/* Mark functions as cold. gcc will assume any path leading to a call
309- to them will be unlikely. This means a lot of manual unlikely()s
310- are unnecessary now for any paths leading to the usual suspects
311- like BUG(), printk(), panic() etc. [but let's keep them for now for
312- older compilers]
313-
314- Early snapshots of gcc 4.3 don't support this and we can't detect this
315- in the preprocessor, but we can live with this because they're unreleased.
316- Maketime probing would be overkill here.
317-
318- gcc also has a __attribute__((__hot__)) to move hot functions into
319- a special section, but I don't see any sense in this right now in
320- the kernel context */
321-#define __cold __attribute__((__cold__))
322-
323-#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
324-
325-#ifndef __CHECKER__
326-# define __compiletime_warning(message) __attribute__((warning(message)))
327-# define __compiletime_error(message) __attribute__((error(message)))
328-#endif /* __CHECKER__ */
329-
330-/*
331- * Mark a position in code as unreachable. This can be used to
332- * suppress control flow warnings after asm blocks that transfer
333- * control elsewhere.
334- *
335- * Early snapshots of gcc 4.5 don't support this and we can't detect
336- * this in the preprocessor, but we can live with this because they're
337- * unreleased. Really, we need to have autoconf for the kernel.
338- */
339-#define unreachable() __builtin_unreachable()
340-
341-/* Mark a function definition as prohibited from being cloned. */
342-#define __noclone __attribute__((__noclone__))
343-
344-/*
345- * Tell the optimizer that something else uses this function or variable.
346- */
347-#define __visible __attribute__((externally_visible))
348-
349-/*
350- * GCC 'asm goto' miscompiles certain code sequences:
351- *
352- * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
353- *
354- * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
355- *
356- * (asm goto is automatically volatile - the naming reflects this.)
357- */
358-#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
359-
360-#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
361-#define __HAVE_BUILTIN_BSWAP32__
362-#define __HAVE_BUILTIN_BSWAP64__
363-#define __HAVE_BUILTIN_BSWAP16__
364-#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
365-
366-#define KASAN_ABI_VERSION 4
367--
3681.9.1
369
diff --git a/recipes-kernel/linux/linux-imx-4.1.15/imx/gpu-viv_gcc6_indent_warning_error_fix.patch b/recipes-kernel/linux/linux-imx-4.1.15/imx/gpu-viv_gcc6_indent_warning_error_fix.patch
new file mode 100644
index 0000000..b48606c
--- /dev/null
+++ b/recipes-kernel/linux/linux-imx-4.1.15/imx/gpu-viv_gcc6_indent_warning_error_fix.patch
@@ -0,0 +1,30 @@
1From 8d0142efbfcfe4e3998f748496ceba62890c47f0 Mon Sep 17 00:00:00 2001
2From: Lauren Post <lauren.post@nxp.com>
3Date: Wed, 13 Jul 2016 03:07:23 -0500
4Subject: [PATCH] gpu-viv: Fix gcc 6.0 indent warning error in gc_hal_kernel_platform_imx6ql4.c
5
6Upstream-Status: Pending
7
8Signed-off-by: Lauren Post <lauren.post@nxp.com>
9---
10 .../linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c | 4 ++--
11 1 file changed, 2 insertions(+), 2 deletions(-)
12
13diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c
14index e436ada..d98c2f8 100644
15--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c
16+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c
17@@ -475,8 +475,8 @@ gckPLATFORM_AdjustParam(
18
19 Args->gpu3DMinClock = initgpu3DMinClock;
20
21- if(Args->physSize == 0)
22- Args->physSize = 0x80000000;
23+ if(Args->physSize == 0)
24+ Args->physSize = 0x80000000;
25
26 return gcvSTATUS_OK;
27 }
28--
291.9.1
30
diff --git a/recipes-kernel/linux/linux-imx_4.1.15.bb b/recipes-kernel/linux/linux-imx_4.1.15.bb
index 63dfcd0..8fce40b 100644
--- a/recipes-kernel/linux/linux-imx_4.1.15.bb
+++ b/recipes-kernel/linux/linux-imx_4.1.15.bb
@@ -14,6 +14,11 @@ SRCBRANCH = "imx_4.1.15_1.0.0_ga"
14LOCALVERSION = "-1.2.0" 14LOCALVERSION = "-1.2.0"
15SRCREV = "77f61547834c4f127b44b13e43c59133a35880dc" 15SRCREV = "77f61547834c4f127b44b13e43c59133a35880dc"
16 16
17# Add patches for gcc 6 compiler issue
18SRC_URI += "file://gcc6_integrate_fix.patch \
19 file://bcmhd_gcc6_indent_warning_error_fix.patch \
20 file://gpu-viv_gcc6_indent_warning_error_fix.patch"
21
17DEFAULT_PREFERENCE = "1" 22DEFAULT_PREFERENCE = "1"
18 23
19COMPATIBLE_MACHINE = "(mx6|mx6ul|mx7)" 24COMPATIBLE_MACHINE = "(mx6|mx6ul|mx7)"