summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@theqtcompany.com>2016-04-14 11:55:38 +0300
committerSamuli Piippo <samuli.piippo@theqtcompany.com>2016-04-18 06:46:29 +0000
commit64d0d088725b7ad70080068c3eb9f5dccec9bd32 (patch)
tree9b57e6855219ebed213e85bcd433d71f29059663
parent746ebaa87f5f2bf8722b4d5e84822e065daa4266 (diff)
downloadmeta-boot2qt-64d0d088725b7ad70080068c3eb9f5dccec9bd32.tar.gz
BBB: enable kernel to build with gcc5
Change-Id: Iee04165267b5aa8e0056abb1b8210eb1789ba669 Reviewed-by: Teemu Holappa <teemu.holappa@theqtcompany.com>
-rw-r--r--conf/distro/include/beaglebone.conf2
-rw-r--r--meta-beagleboard-extras/recipes/linux/linux-mainline/0001-ARM-8158-1-LLVMLinux-use-static-inline-in-ARM-ftrace.patch52
-rw-r--r--meta-beagleboard-extras/recipes/linux/linux-mainline/0001-Change-extern-inline-to-static-inline.patch133
-rw-r--r--meta-beagleboard-extras/recipes/linux/linux-mainline/0001-kernel-add-support-for-gcc-5.patch99
-rw-r--r--meta-beagleboard-extras/recipes/linux/linux-mainline_3.8.bbappend4
5 files changed, 289 insertions, 1 deletions
diff --git a/conf/distro/include/beaglebone.conf b/conf/distro/include/beaglebone.conf
index 8a2c3e2..c034200 100644
--- a/conf/distro/include/beaglebone.conf
+++ b/conf/distro/include/beaglebone.conf
@@ -40,7 +40,7 @@ PREFERRED_VERSION_omap3-sgx-modules = "4.10.00.01"
40PREFERRED_PROVIDER_virtual/egl = "libgles-omap3" 40PREFERRED_PROVIDER_virtual/egl = "libgles-omap3"
41PREFERRED_PROVIDER_virtual/libgles2 = "libgles-omap3" 41PREFERRED_PROVIDER_virtual/libgles2 = "libgles-omap3"
42 42
43PREFERRED_PROVIDER_u-boot = "u-boot" 43PREFERRED_PROVIDER_u-boot = "u-boot-ti-staging"
44EXTRA_IMAGEDEPENDS_remove = "u-boot-denx" 44EXTRA_IMAGEDEPENDS_remove = "u-boot-denx"
45UBOOT_MACHINE = "am335x_boneblack_config" 45UBOOT_MACHINE = "am335x_boneblack_config"
46KERNEL_IMAGETYPE = "zImage" 46KERNEL_IMAGETYPE = "zImage"
diff --git a/meta-beagleboard-extras/recipes/linux/linux-mainline/0001-ARM-8158-1-LLVMLinux-use-static-inline-in-ARM-ftrace.patch b/meta-beagleboard-extras/recipes/linux/linux-mainline/0001-ARM-8158-1-LLVMLinux-use-static-inline-in-ARM-ftrace.patch
new file mode 100644
index 0000000..ee61a74
--- /dev/null
+++ b/meta-beagleboard-extras/recipes/linux/linux-mainline/0001-ARM-8158-1-LLVMLinux-use-static-inline-in-ARM-ftrace.patch
@@ -0,0 +1,52 @@
1From ef372125fd64fc181869be4cf528488f9e8b46c2 Mon Sep 17 00:00:00 2001
2From: Behan Webster <behanw@converseincode.com>
3Date: Wed, 24 Sep 2014 01:06:46 +0100
4Subject: [PATCH] ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h
5
6With compilers which follow the C99 standard (like modern versions of gcc and
7clang), "extern inline" does the wrong thing (emits code for an externally
8linkable version of the inline function). In this case using static inline
9and removing the NULL version of return_address in return_address.c does
10the right thing.
11
12Signed-off-by: Behan Webster <behanw@converseincode.com>
13Reviewed-by: Mark Charlebois <charlebm@gmail.com>
14Acked-by: Steven Rostedt <rostedt@goodmis.org>
15Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16---
17 arch/arm/include/asm/ftrace.h | 2 +-
18 arch/arm/kernel/return_address.c | 5 -----
19 2 files changed, 1 insertion(+), 6 deletions(-)
20
21diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
22index f89515a..2bb8cac 100644
23--- a/arch/arm/include/asm/ftrace.h
24+++ b/arch/arm/include/asm/ftrace.h
25@@ -45,7 +45,7 @@ void *return_address(unsigned int);
26
27 #else
28
29-extern inline void *return_address(unsigned int level)
30+static inline void *return_address(unsigned int level)
31 {
32 return NULL;
33 }
34diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c
35index fafedd8..f6aa84d 100644
36--- a/arch/arm/kernel/return_address.c
37+++ b/arch/arm/kernel/return_address.c
38@@ -63,11 +63,6 @@ void *return_address(unsigned int level)
39 #warning "TODO: return_address should use unwind tables"
40 #endif
41
42-void *return_address(unsigned int level)
43-{
44- return NULL;
45-}
46-
47 #endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) / else */
48
49 EXPORT_SYMBOL_GPL(return_address);
50--
511.9.1
52
diff --git a/meta-beagleboard-extras/recipes/linux/linux-mainline/0001-Change-extern-inline-to-static-inline.patch b/meta-beagleboard-extras/recipes/linux/linux-mainline/0001-Change-extern-inline-to-static-inline.patch
new file mode 100644
index 0000000..66f031f
--- /dev/null
+++ b/meta-beagleboard-extras/recipes/linux/linux-mainline/0001-Change-extern-inline-to-static-inline.patch
@@ -0,0 +1,133 @@
1From 0873625fb43dda5a54919b7414f235cdfdd98ddc Mon Sep 17 00:00:00 2001
2From: Samuli Piippo <samuli.piippo@theqtcompany.com>
3Date: Wed, 13 Apr 2016 15:42:49 +0300
4Subject: [PATCH] Change "extern inline" to "static inline"
5
6With compilers which follow the C99 standard (like modern versions of gcc and
7clang), "extern inline" does the wrong thing (emits code for an externally
8linkable version of the inline function). "static inline" is the correct choice
9instead.
10---
11 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 10 +++++-----
12 drivers/staging/rtl8712/ieee80211.h | 4 ++--
13 lib/mpi/mpi-inline.h | 2 +-
14 lib/mpi/mpi-internal.h | 16 ++++++++--------
15 4 files changed, 16 insertions(+), 16 deletions(-)
16
17diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
18index 502bfdb..1c8d026 100644
19--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
20+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
21@@ -2254,7 +2254,7 @@ static inline void *ieee80211_priv(struct net_device *dev)
22 return ((struct ieee80211_device *)netdev_priv(dev))->priv;
23 }
24
25-extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
26+static inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
27 {
28 /* Single white space is for Linksys APs */
29 if (essid_len == 1 && essid[0] == ' ')
30@@ -2270,7 +2270,7 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
31 return 1;
32 }
33
34-extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode)
35+static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode)
36 {
37 /*
38 * It is possible for both access points and our device to support
39@@ -2296,7 +2296,7 @@ extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mod
40 return 0;
41 }
42
43-extern inline int ieee80211_get_hdrlen(u16 fc)
44+static inline int ieee80211_get_hdrlen(u16 fc)
45 {
46 int hdrlen = IEEE80211_3ADDR_LEN;
47
48@@ -2582,12 +2582,12 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee);
49
50 extern const long ieee80211_wlan_frequencies[];
51
52-extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
53+static inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
54 {
55 ieee->scans++;
56 }
57
58-extern inline int ieee80211_get_scans(struct ieee80211_device *ieee)
59+static inline int ieee80211_get_scans(struct ieee80211_device *ieee)
60 {
61 return ieee->scans;
62 }
63diff --git a/drivers/staging/rtl8712/ieee80211.h b/drivers/staging/rtl8712/ieee80211.h
64index 21515c3..7518061 100644
65--- a/drivers/staging/rtl8712/ieee80211.h
66+++ b/drivers/staging/rtl8712/ieee80211.h
67@@ -734,7 +734,7 @@ enum ieee80211_state {
68 #define IEEE_G (1<<2)
69 #define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G)
70
71-extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
72+static inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
73 {
74 /* Single white space is for Linksys APs */
75 if (essid_len == 1 && essid[0] == ' ')
76@@ -748,7 +748,7 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
77 return 1;
78 }
79
80-extern inline int ieee80211_get_hdrlen(u16 fc)
81+static inline int ieee80211_get_hdrlen(u16 fc)
82 {
83 int hdrlen = 24;
84
85diff --git a/lib/mpi/mpi-inline.h b/lib/mpi/mpi-inline.h
86index e2b3985..c245ea3 100644
87--- a/lib/mpi/mpi-inline.h
88+++ b/lib/mpi/mpi-inline.h
89@@ -30,7 +30,7 @@
90 #define G10_MPI_INLINE_H
91
92 #ifndef G10_MPI_INLINE_DECL
93-#define G10_MPI_INLINE_DECL extern inline
94+#define G10_MPI_INLINE_DECL static inline
95 #endif
96
97 G10_MPI_INLINE_DECL mpi_limb_t
98diff --git a/lib/mpi/mpi-internal.h b/lib/mpi/mpi-internal.h
99index 77adcf6..4566d11 100644
100--- a/lib/mpi/mpi-internal.h
101+++ b/lib/mpi/mpi-internal.h
102@@ -172,20 +172,20 @@ void mpi_rshift_limbs(MPI a, unsigned int count);
103 int mpi_lshift_limbs(MPI a, unsigned int count);
104
105 /*-- mpihelp-add.c --*/
106-mpi_limb_t mpihelp_add_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
107- mpi_size_t s1_size, mpi_limb_t s2_limb);
108+//mpi_limb_t mpihelp_add_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
109+// mpi_size_t s1_size, mpi_limb_t s2_limb);
110 mpi_limb_t mpihelp_add_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
111 mpi_ptr_t s2_ptr, mpi_size_t size);
112-mpi_limb_t mpihelp_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
113- mpi_ptr_t s2_ptr, mpi_size_t s2_size);
114+//mpi_limb_t mpihelp_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
115+// mpi_ptr_t s2_ptr, mpi_size_t s2_size);
116
117 /*-- mpihelp-sub.c --*/
118-mpi_limb_t mpihelp_sub_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
119- mpi_size_t s1_size, mpi_limb_t s2_limb);
120+//mpi_limb_t mpihelp_sub_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
121+// mpi_size_t s1_size, mpi_limb_t s2_limb);
122 mpi_limb_t mpihelp_sub_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
123 mpi_ptr_t s2_ptr, mpi_size_t size);
124-mpi_limb_t mpihelp_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
125- mpi_ptr_t s2_ptr, mpi_size_t s2_size);
126+//mpi_limb_t mpihelp_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
127+// mpi_ptr_t s2_ptr, mpi_size_t s2_size);
128
129 /*-- mpihelp-cmp.c --*/
130 int mpihelp_cmp(mpi_ptr_t op1_ptr, mpi_ptr_t op2_ptr, mpi_size_t size);
131--
1321.9.1
133
diff --git a/meta-beagleboard-extras/recipes/linux/linux-mainline/0001-kernel-add-support-for-gcc-5.patch b/meta-beagleboard-extras/recipes/linux/linux-mainline/0001-kernel-add-support-for-gcc-5.patch
new file mode 100644
index 0000000..13a89fb
--- /dev/null
+++ b/meta-beagleboard-extras/recipes/linux/linux-mainline/0001-kernel-add-support-for-gcc-5.patch
@@ -0,0 +1,99 @@
1From 376075b9598d602950b73cc78743735585c0a18c Mon Sep 17 00:00:00 2001
2From: Sasha Levin <sasha.levin@oracle.com>
3Date: Mon, 13 Oct 2014 15:51:05 -0700
4Subject: [PATCH] kernel: add support for gcc 5
5
6commit 71458cfc782eafe4b27656e078d379a34e472adf upstream.
7
8We're missing include/linux/compiler-gcc5.h which is required now
9because gcc branched off to v5 in trunk.
10
11Just copy the relevant bits out of include/linux/compiler-gcc4.h,
12no new code is added as of now.
13
14This fixes a build error when using gcc 5.
15
16Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
17Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
18Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20---
21 include/linux/compiler-gcc5.h | 66 +++++++++++++++++++++++++++++++++++++++++++
22 1 file changed, 66 insertions(+)
23 create mode 100644 include/linux/compiler-gcc5.h
24
25diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h
26new file mode 100644
27index 0000000..cdd1cc2
28--- /dev/null
29+++ b/include/linux/compiler-gcc5.h
30@@ -0,0 +1,66 @@
31+#ifndef __LINUX_COMPILER_H
32+#error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead."
33+#endif
34+
35+#define __used __attribute__((__used__))
36+#define __must_check __attribute__((warn_unused_result))
37+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
38+
39+/* Mark functions as cold. gcc will assume any path leading to a call
40+ to them will be unlikely. This means a lot of manual unlikely()s
41+ are unnecessary now for any paths leading to the usual suspects
42+ like BUG(), printk(), panic() etc. [but let's keep them for now for
43+ older compilers]
44+
45+ Early snapshots of gcc 4.3 don't support this and we can't detect this
46+ in the preprocessor, but we can live with this because they're unreleased.
47+ Maketime probing would be overkill here.
48+
49+ gcc also has a __attribute__((__hot__)) to move hot functions into
50+ a special section, but I don't see any sense in this right now in
51+ the kernel context */
52+#define __cold __attribute__((__cold__))
53+
54+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
55+
56+#ifndef __CHECKER__
57+# define __compiletime_warning(message) __attribute__((warning(message)))
58+# define __compiletime_error(message) __attribute__((error(message)))
59+#endif /* __CHECKER__ */
60+
61+/*
62+ * Mark a position in code as unreachable. This can be used to
63+ * suppress control flow warnings after asm blocks that transfer
64+ * control elsewhere.
65+ *
66+ * Early snapshots of gcc 4.5 don't support this and we can't detect
67+ * this in the preprocessor, but we can live with this because they're
68+ * unreleased. Really, we need to have autoconf for the kernel.
69+ */
70+#define unreachable() __builtin_unreachable()
71+
72+/* Mark a function definition as prohibited from being cloned. */
73+#define __noclone __attribute__((__noclone__))
74+
75+/*
76+ * Tell the optimizer that something else uses this function or variable.
77+ */
78+#define __visible __attribute__((externally_visible))
79+
80+/*
81+ * GCC 'asm goto' miscompiles certain code sequences:
82+ *
83+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
84+ *
85+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
86+ * Fixed in GCC 4.8.2 and later versions.
87+ *
88+ * (asm goto is automatically volatile - the naming reflects this.)
89+ */
90+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
91+
92+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
93+#define __HAVE_BUILTIN_BSWAP32__
94+#define __HAVE_BUILTIN_BSWAP64__
95+#define __HAVE_BUILTIN_BSWAP16__
96+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
97--
981.9.1
99
diff --git a/meta-beagleboard-extras/recipes/linux/linux-mainline_3.8.bbappend b/meta-beagleboard-extras/recipes/linux/linux-mainline_3.8.bbappend
index a945ea8..0e6d423 100644
--- a/meta-beagleboard-extras/recipes/linux/linux-mainline_3.8.bbappend
+++ b/meta-beagleboard-extras/recipes/linux/linux-mainline_3.8.bbappend
@@ -26,6 +26,9 @@ SRC_URI += "\
26 file://0003-video-da8xx-fb-Add-API-to-register-wait-for-vsync-ca.patch \ 26 file://0003-video-da8xx-fb-Add-API-to-register-wait-for-vsync-ca.patch \
27 file://ARM-perf-add-support-for-perf-registers-API.diff \ 27 file://ARM-perf-add-support-for-perf-registers-API.diff \
28 file://ARM-perf-wire-up-perf_regs-and-unwind-support-for-AR.patch \ 28 file://ARM-perf-wire-up-perf_regs-and-unwind-support-for-AR.patch \
29 file://0001-ARM-8158-1-LLVMLinux-use-static-inline-in-ARM-ftrace.patch \
30 file://0001-kernel-add-support-for-gcc-5.patch \
31 file://0001-Change-extern-inline-to-static-inline.patch \
29 " 32 "
30 33
31INSANE_SKIP_${PN} = "installed-vs-shipped" 34INSANE_SKIP_${PN} = "installed-vs-shipped"
@@ -37,4 +40,5 @@ do_configure_prepend() {
37 -e '/CONFIG_USB_FUNCTIONFS_RNDIS=/d' \ 40 -e '/CONFIG_USB_FUNCTIONFS_RNDIS=/d' \
38 -i ${WORKDIR}/defconfig 41 -i ${WORKDIR}/defconfig
39 echo "CONFIG_FHANDLE=y" >> ${WORKDIR}/defconfig 42 echo "CONFIG_FHANDLE=y" >> ${WORKDIR}/defconfig
43 echo "CONFIG_MOUSE_PS2=n" >> ${WORKDIR}/defconfig
40} 44}