[meta-freescale] [meta-fsl-arm][PATCH 02/17] linux-imx: Patches to fix gcc 5.2 build issues

Lauren Post lauren.post at freescale.com
Thu Sep 17 12:27:36 PDT 2015


Cherry picked patches from future kernel versions to fix gcc5.2
build errors

Signed-off-by: Lauren Post <lauren.post at freescale.com>
---
 ...LLVMLinux-use-static-inline-in-ARM-ftrace.patch | 48 ++++++++++++++++++
 ...nux-Change-extern-inline-to-static-inline.patch | 59 ++++++++++++++++++++++
 recipes-kernel/linux/linux-imx_3.14.38.bb          |  2 +
 3 files changed, 109 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-imx-3.14.38/0001-ARM-8158-LLVMLinux-use-static-inline-in-ARM-ftrace.patch
 create mode 100644 recipes-kernel/linux/linux-imx-3.14.38/0001-ARM-LLVMLinux-Change-extern-inline-to-static-inline.patch

diff --git a/recipes-kernel/linux/linux-imx-3.14.38/0001-ARM-8158-LLVMLinux-use-static-inline-in-ARM-ftrace.patch b/recipes-kernel/linux/linux-imx-3.14.38/0001-ARM-8158-LLVMLinux-use-static-inline-in-ARM-ftrace.patch
new file mode 100644
index 0000000..47f13c7
--- /dev/null
+++ b/recipes-kernel/linux/linux-imx-3.14.38/0001-ARM-8158-LLVMLinux-use-static-inline-in-ARM-ftrace.patch
@@ -0,0 +1,48 @@
+From aeea3592a13bf12861943e44fc48f1f270941f8d Mon Sep 17 00:00:00 2001
+From: Behan Webster <behanw at converseincode.com>
+Date: Wed, 24 Sep 2014 01:06:46 +0100
+Subject: ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h
+
+With compilers which follow the C99 standard (like modern versions of gcc and
+clang), "extern inline" does the wrong thing (emits code for an externally
+linkable version of the inline function). In this case using static inline
+and removing the NULL version of return_address in return_address.c does
+the right thing.
+
+Signed-off-by: Behan Webster <behanw at converseincode.com>
+Reviewed-by: Mark Charlebois <charlebm at gmail.com>
+Acked-by: Steven Rostedt <rostedt at goodmis.org>
+Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
+
+diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
+index 39eb16b..bfe2a2f 100644
+--- a/arch/arm/include/asm/ftrace.h
++++ b/arch/arm/include/asm/ftrace.h
+@@ -45,7 +45,7 @@ void *return_address(unsigned int);
+ 
+ #else
+ 
+-extern inline void *return_address(unsigned int level)
++static inline void *return_address(unsigned int level)
+ {
+ 	return NULL;
+ }
+diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c
+index fafedd8..f6aa84d 100644
+--- a/arch/arm/kernel/return_address.c
++++ b/arch/arm/kernel/return_address.c
+@@ -63,11 +63,6 @@ void *return_address(unsigned int level)
+ #warning "TODO: return_address should use unwind tables"
+ #endif
+ 
+-void *return_address(unsigned int level)
+-{
+-	return NULL;
+-}
+-
+ #endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) / else */
+ 
+ EXPORT_SYMBOL_GPL(return_address);
+-- 
+cgit v0.10.2
+
diff --git a/recipes-kernel/linux/linux-imx-3.14.38/0001-ARM-LLVMLinux-Change-extern-inline-to-static-inline.patch b/recipes-kernel/linux/linux-imx-3.14.38/0001-ARM-LLVMLinux-Change-extern-inline-to-static-inline.patch
new file mode 100644
index 0000000..0ab03fb
--- /dev/null
+++ b/recipes-kernel/linux/linux-imx-3.14.38/0001-ARM-LLVMLinux-Change-extern-inline-to-static-inline.patch
@@ -0,0 +1,59 @@
+From a2561791169351cbf1ac5ca0c4299a0eef7eca65 Mon Sep 17 00:00:00 2001
+From: Behan Webster <behanw at converseincode.com>
+Date: Tue, 3 Sep 2013 22:27:26 -0400
+Subject: [PATCH] ARM: LLVMLinux: Change "extern inline" to "static inline" in
+ glue-cache.h
+
+With compilers which follow the C99 standard (like modern versions of gcc and
+clang), "extern inline" does the wrong thing (emits code for an externally
+linkable version of the inline function). "static inline" is the correct choice
+instead.
+
+Author: Behan Webster <behanw at converseincode.com>
+Signed-off-by: Behan Webster <behanw at converseincode.com>
+Reviewed-by: Mark Charlebois <charlebm at gmail.com>
+---
+ arch/arm/include/asm/glue-cache.h | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/arch/arm/include/asm/glue-cache.h b/arch/arm/include/asm/glue-cache.h
+index c81adc0..a3c24cd 100644
+--- a/arch/arm/include/asm/glue-cache.h
++++ b/arch/arm/include/asm/glue-cache.h
+@@ -130,22 +130,22 @@
+ #endif
+ 
+ #ifndef __ASSEMBLER__
+-extern inline void nop_flush_icache_all(void) { }
+-extern inline void nop_flush_kern_cache_all(void) { }
+-extern inline void nop_flush_kern_cache_louis(void) { }
+-extern inline void nop_flush_user_cache_all(void) { }
+-extern inline void nop_flush_user_cache_range(unsigned long a,
++static inline void nop_flush_icache_all(void) { }
++static inline void nop_flush_kern_cache_all(void) { }
++static inline void nop_flush_kern_cache_louis(void) { }
++static inline void nop_flush_user_cache_all(void) { }
++static inline void nop_flush_user_cache_range(unsigned long a,
+ 		unsigned long b, unsigned int c) { }
+ 
+-extern inline void nop_coherent_kern_range(unsigned long a, unsigned long b) { }
+-extern inline int nop_coherent_user_range(unsigned long a,
++static inline void nop_coherent_kern_range(unsigned long a, unsigned long b) { }
++static inline int nop_coherent_user_range(unsigned long a,
+ 		unsigned long b) { return 0; }
+-extern inline void nop_flush_kern_dcache_area(void *a, size_t s) { }
++static inline void nop_flush_kern_dcache_area(void *a, size_t s) { }
+ 
+-extern inline void nop_dma_flush_range(const void *a, const void *b) { }
++static inline void nop_dma_flush_range(const void *a, const void *b) { }
+ 
+-extern inline void nop_dma_map_area(const void *s, size_t l, int f) { }
+-extern inline void nop_dma_unmap_area(const void *s, size_t l, int f) { }
++static inline void nop_dma_map_area(const void *s, size_t l, int f) { }
++static inline void nop_dma_unmap_area(const void *s, size_t l, int f) { }
+ #endif
+ 
+ #ifndef MULTI_CACHE
+-- 
+2.1.4
+
diff --git a/recipes-kernel/linux/linux-imx_3.14.38.bb b/recipes-kernel/linux/linux-imx_3.14.38.bb
index fd816e7..886298f 100644
--- a/recipes-kernel/linux/linux-imx_3.14.38.bb
+++ b/recipes-kernel/linux/linux-imx_3.14.38.bb
@@ -36,6 +36,8 @@ SRCREV_mx7 = "e4944a51c4bb950a8f13e421eefc000a87350e23"
 
 SRC_URI += " \
     file://0004-mmc-sdhci-esdhc-imx-Fixup-runtime-PM-conditions-duri.patch \
+    file://0001-ARM-LLVMLinux-Change-extern-inline-to-static-inline.patch \
+    file://0001-ARM-8158-LLVMLinux-use-static-inline-in-ARM-ftrace.patch \
 "
 
 COMPATIBLE_MACHINE = "(mx6|mx6ul|mx7)"
-- 
2.1.4



More information about the meta-freescale mailing list