aboutsummaryrefslogtreecommitdiffstats
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
meta-xilinx-390aa7085d87d5d9ec44f4c76b50350befbd3b76.tar.bz2
meta-xilinx-390aa7085d87d5d9ec44f4c76b50350befbd3b76.zip
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 @@
+From: Sasha Levin <sasha.levin@oracle.com>
+Date: Mon, 13 Oct 2014 15:51:05 -0700
+Subject: [PATCH] kernel: add support for gcc 5
+
+We're missing include/linux/compiler-gcc5.h which is required now
+because gcc branched off to v5 in trunk.
+
+Just copy the relevant bits out of include/linux/compiler-gcc4.h,
+no new code is added as of now.
+
+This fixes a build error when using gcc 5.
+
+Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Upstream-Status: Backport
+---
+ include/linux/compiler-gcc5.h | 66 +++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 66 insertions(+)
+ create mode 100644 include/linux/compiler-gcc5.h
+
+diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h
+new file mode 100644
+index 0000000..cdd1cc2
+--- /dev/null
++++ b/include/linux/compiler-gcc5.h
+@@ -0,0 +1,66 @@
++#ifndef __LINUX_COMPILER_H
++#error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead."
++#endif
++
++#define __used __attribute__((__used__))
++#define __must_check __attribute__((warn_unused_result))
++#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
++
++/* Mark functions as cold. gcc will assume any path leading to a call
++ to them will be unlikely. This means a lot of manual unlikely()s
++ are unnecessary now for any paths leading to the usual suspects
++ like BUG(), printk(), panic() etc. [but let's keep them for now for
++ older compilers]
++
++ Early snapshots of gcc 4.3 don't support this and we can't detect this
++ in the preprocessor, but we can live with this because they're unreleased.
++ Maketime probing would be overkill here.
++
++ gcc also has a __attribute__((__hot__)) to move hot functions into
++ a special section, but I don't see any sense in this right now in
++ the kernel context */
++#define __cold __attribute__((__cold__))
++
++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
++
++#ifndef __CHECKER__
++# define __compiletime_warning(message) __attribute__((warning(message)))
++# define __compiletime_error(message) __attribute__((error(message)))
++#endif /* __CHECKER__ */
++
++/*
++ * Mark a position in code as unreachable. This can be used to
++ * suppress control flow warnings after asm blocks that transfer
++ * control elsewhere.
++ *
++ * Early snapshots of gcc 4.5 don't support this and we can't detect
++ * this in the preprocessor, but we can live with this because they're
++ * unreleased. Really, we need to have autoconf for the kernel.
++ */
++#define unreachable() __builtin_unreachable()
++
++/* Mark a function definition as prohibited from being cloned. */
++#define __noclone __attribute__((__noclone__))
++
++/*
++ * Tell the optimizer that something else uses this function or variable.
++ */
++#define __visible __attribute__((externally_visible))
++
++/*
++ * GCC 'asm goto' miscompiles certain code sequences:
++ *
++ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
++ *
++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
++ * Fixed in GCC 4.8.2 and later versions.
++ *
++ * (asm goto is automatically volatile - the naming reflects this.)
++ */
++#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
++
++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
++#define __HAVE_BUILTIN_BSWAP32__
++#define __HAVE_BUILTIN_BSWAP64__
++#define __HAVE_BUILTIN_BSWAP16__
++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
+--
+2.5.1
+
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 @@
+From: "Kirill A. Shutemov" <kirill@shutemov.name>
+Date: Mon, 20 Oct 2014 12:23:12 +0300
+Subject: [PATCH] kernel: use the gnu89 standard explicitly
+
+Sasha Levin reports:
+ "gcc5 changes the default standard to c11, which makes kernel build
+ unhappy
+
+ Explicitly define the kernel standard to be gnu89 which should keep
+ everything working exactly like it was before gcc5"
+
+There are multiple small issues with the new default, but the biggest
+issue seems to be that the old - and very useful - GNU extension to
+allow a cast in front of an initializer has gone away.
+
+Patch updated by Kirill:
+ "I'm pretty sure all gcc versions you can build kernel with supports
+ -std=gnu89. cc-option is redunrant.
+
+ We also need to adjust HOSTCFLAGS otherwise allmodconfig fails for me"
+
+Note by Andrew Pinski:
+ "Yes it was reported and both problems relating to this extension has
+ been added to gnu99 and gnu11. Though there are other issues with the
+ kernel dealing with extern inline have different semantics between
+ gnu89 and gnu99/11"
+
+End result: we may be able to move up to a newer stdc model eventually,
+but right now the newer models have some annoying deficiencies, so the
+traditional "gnu89" model ends up being the preferred one.
+
+Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
+Singed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Upstream-Status: Backport [Minor merge conflict resolution]
+---
+ Makefile | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index b2f7de8..6af4c22 100644
+--- a/Makefile
++++ b/Makefile
+@@ -244,7 +244,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
+
+ HOSTCC = gcc
+ HOSTCXX = g++
+-HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
++HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
+ HOSTCXXFLAGS = -O2
+
+ # Decide whether to build built-in, modular, or both.
+@@ -382,7 +382,9 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
+ -fno-strict-aliasing -fno-common \
+ -Werror-implicit-function-declaration \
+ -Wno-format-security \
+- -fno-delete-null-pointer-checks
++ -fno-delete-null-pointer-checks \
++ -std=gnu89
++
+ KBUILD_AFLAGS_KERNEL :=
+ KBUILD_CFLAGS_KERNEL :=
+ KBUILD_AFLAGS := -D__ASSEMBLY__
+--
+2.5.1
+
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:"
SRC_URI_append += " \
file://usb-host-zynq-dr-of-PHY-reset-during-probe.patch \
file://tty-xuartps-Fix-RX-hang-and-TX-corruption-in-set_termios.patch \
+ file://kernel-add-support-for-gcc-5.patch \
+ file://kernel-use-the-gnu89-standard-explicitly.patch \
"
# This kernel's Zynq USB driver cannot handle a seperate USB PHY device.