summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2015-09-12 16:41:59 +1000
committerNathan Rossi <nathan@nathanrossi.com>2015-09-14 18:10:53 +1000
commit390aa7085d87d5d9ec44f4c76b50350befbd3b76 (patch)
tree17f4e4001fed3d6ed73717c2751ebf01cba06bba
parent2c2ce63ea1cd3a968c85d587e212c7afe0b9811d (diff)
downloadmeta-xilinx-390aa7085d87d5d9ec44f4c76b50350befbd3b76.tar.gz
linux-xlnx_3.14: Add patches to support GCC 5.x
* Backport upstream patches to support GCC 5.x Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
-rw-r--r--recipes-kernel/linux/linux-xlnx/3.14/kernel-add-support-for-gcc-5.patch97
-rw-r--r--recipes-kernel/linux/linux-xlnx/3.14/kernel-use-the-gnu89-standard-explicitly.patch66
-rw-r--r--recipes-kernel/linux/linux-xlnx_3.14.bb2
3 files changed, 165 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-xlnx/3.14/kernel-add-support-for-gcc-5.patch b/recipes-kernel/linux/linux-xlnx/3.14/kernel-add-support-for-gcc-5.patch
new file mode 100644
index 00000000..bfebf72c
--- /dev/null
+++ b/recipes-kernel/linux/linux-xlnx/3.14/kernel-add-support-for-gcc-5.patch
@@ -0,0 +1,97 @@
1From: Sasha Levin <sasha.levin@oracle.com>
2Date: Mon, 13 Oct 2014 15:51:05 -0700
3Subject: [PATCH] kernel: add support for gcc 5
4
5We're missing include/linux/compiler-gcc5.h which is required now
6because gcc branched off to v5 in trunk.
7
8Just copy the relevant bits out of include/linux/compiler-gcc4.h,
9no new code is added as of now.
10
11This fixes a build error when using gcc 5.
12
13Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
14Cc: <stable@vger.kernel.org>
15Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
16Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17Upstream-Status: Backport
18---
19 include/linux/compiler-gcc5.h | 66 +++++++++++++++++++++++++++++++++++++++++++
20 1 file changed, 66 insertions(+)
21 create mode 100644 include/linux/compiler-gcc5.h
22
23diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h
24new file mode 100644
25index 0000000..cdd1cc2
26--- /dev/null
27+++ b/include/linux/compiler-gcc5.h
28@@ -0,0 +1,66 @@
29+#ifndef __LINUX_COMPILER_H
30+#error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead."
31+#endif
32+
33+#define __used __attribute__((__used__))
34+#define __must_check __attribute__((warn_unused_result))
35+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
36+
37+/* Mark functions as cold. gcc will assume any path leading to a call
38+ to them will be unlikely. This means a lot of manual unlikely()s
39+ are unnecessary now for any paths leading to the usual suspects
40+ like BUG(), printk(), panic() etc. [but let's keep them for now for
41+ older compilers]
42+
43+ Early snapshots of gcc 4.3 don't support this and we can't detect this
44+ in the preprocessor, but we can live with this because they're unreleased.
45+ Maketime probing would be overkill here.
46+
47+ gcc also has a __attribute__((__hot__)) to move hot functions into
48+ a special section, but I don't see any sense in this right now in
49+ the kernel context */
50+#define __cold __attribute__((__cold__))
51+
52+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
53+
54+#ifndef __CHECKER__
55+# define __compiletime_warning(message) __attribute__((warning(message)))
56+# define __compiletime_error(message) __attribute__((error(message)))
57+#endif /* __CHECKER__ */
58+
59+/*
60+ * Mark a position in code as unreachable. This can be used to
61+ * suppress control flow warnings after asm blocks that transfer
62+ * control elsewhere.
63+ *
64+ * Early snapshots of gcc 4.5 don't support this and we can't detect
65+ * this in the preprocessor, but we can live with this because they're
66+ * unreleased. Really, we need to have autoconf for the kernel.
67+ */
68+#define unreachable() __builtin_unreachable()
69+
70+/* Mark a function definition as prohibited from being cloned. */
71+#define __noclone __attribute__((__noclone__))
72+
73+/*
74+ * Tell the optimizer that something else uses this function or variable.
75+ */
76+#define __visible __attribute__((externally_visible))
77+
78+/*
79+ * GCC 'asm goto' miscompiles certain code sequences:
80+ *
81+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
82+ *
83+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
84+ * Fixed in GCC 4.8.2 and later versions.
85+ *
86+ * (asm goto is automatically volatile - the naming reflects this.)
87+ */
88+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
89+
90+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
91+#define __HAVE_BUILTIN_BSWAP32__
92+#define __HAVE_BUILTIN_BSWAP64__
93+#define __HAVE_BUILTIN_BSWAP16__
94+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
95--
962.5.1
97
diff --git a/recipes-kernel/linux/linux-xlnx/3.14/kernel-use-the-gnu89-standard-explicitly.patch b/recipes-kernel/linux/linux-xlnx/3.14/kernel-use-the-gnu89-standard-explicitly.patch
new file mode 100644
index 00000000..9f7b3b8e
--- /dev/null
+++ b/recipes-kernel/linux/linux-xlnx/3.14/kernel-use-the-gnu89-standard-explicitly.patch
@@ -0,0 +1,66 @@
1From: "Kirill A. Shutemov" <kirill@shutemov.name>
2Date: Mon, 20 Oct 2014 12:23:12 +0300
3Subject: [PATCH] kernel: use the gnu89 standard explicitly
4
5Sasha Levin reports:
6 "gcc5 changes the default standard to c11, which makes kernel build
7 unhappy
8
9 Explicitly define the kernel standard to be gnu89 which should keep
10 everything working exactly like it was before gcc5"
11
12There are multiple small issues with the new default, but the biggest
13issue seems to be that the old - and very useful - GNU extension to
14allow a cast in front of an initializer has gone away.
15
16Patch updated by Kirill:
17 "I'm pretty sure all gcc versions you can build kernel with supports
18 -std=gnu89. cc-option is redunrant.
19
20 We also need to adjust HOSTCFLAGS otherwise allmodconfig fails for me"
21
22Note by Andrew Pinski:
23 "Yes it was reported and both problems relating to this extension has
24 been added to gnu99 and gnu11. Though there are other issues with the
25 kernel dealing with extern inline have different semantics between
26 gnu89 and gnu99/11"
27
28End result: we may be able to move up to a newer stdc model eventually,
29but right now the newer models have some annoying deficiencies, so the
30traditional "gnu89" model ends up being the preferred one.
31
32Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
33Singed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
34Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
35Upstream-Status: Backport [Minor merge conflict resolution]
36---
37 Makefile | 6 ++++--
38 1 file changed, 4 insertions(+), 2 deletions(-)
39
40diff --git a/Makefile b/Makefile
41index b2f7de8..6af4c22 100644
42--- a/Makefile
43+++ b/Makefile
44@@ -244,7 +244,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
45
46 HOSTCC = gcc
47 HOSTCXX = g++
48-HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
49+HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
50 HOSTCXXFLAGS = -O2
51
52 # Decide whether to build built-in, modular, or both.
53@@ -382,7 +382,9 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
54 -fno-strict-aliasing -fno-common \
55 -Werror-implicit-function-declaration \
56 -Wno-format-security \
57- -fno-delete-null-pointer-checks
58+ -fno-delete-null-pointer-checks \
59+ -std=gnu89
60+
61 KBUILD_AFLAGS_KERNEL :=
62 KBUILD_CFLAGS_KERNEL :=
63 KBUILD_AFLAGS := -D__ASSEMBLY__
64--
652.5.1
66
diff --git a/recipes-kernel/linux/linux-xlnx_3.14.bb b/recipes-kernel/linux/linux-xlnx_3.14.bb
index 1f8ddd15..71827067 100644
--- a/recipes-kernel/linux/linux-xlnx_3.14.bb
+++ b/recipes-kernel/linux/linux-xlnx_3.14.bb
@@ -9,6 +9,8 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/linux-xlnx/3.14:"
9SRC_URI_append += " \ 9SRC_URI_append += " \
10 file://usb-host-zynq-dr-of-PHY-reset-during-probe.patch \ 10 file://usb-host-zynq-dr-of-PHY-reset-during-probe.patch \
11 file://tty-xuartps-Fix-RX-hang-and-TX-corruption-in-set_termios.patch \ 11 file://tty-xuartps-Fix-RX-hang-and-TX-corruption-in-set_termios.patch \
12 file://kernel-add-support-for-gcc-5.patch \
13 file://kernel-use-the-gnu89-standard-explicitly.patch \
12 " 14 "
13 15
14# This kernel's Zynq USB driver cannot handle a seperate USB PHY device. 16# This kernel's Zynq USB driver cannot handle a seperate USB PHY device.