From ac3620551872d8196505425648eaef9ee0bb771f Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Tue, 12 Apr 2016 14:05:39 +0300 Subject: smarc-samx6i: fix kernel build Cherry-pick needed changes to make kernel build with gcc5 Change-Id: Ib930f4cc2601318d98f9bac246a209333859289f Reviewed-by: Teemu Holappa --- ...LLVMLinux-use-static-inline-in-ARM-ftrace.patch | 52 +++++++++++++++++++ ...ux-Change-extern-inline-to-static-inline-.patch | 59 ++++++++++++++++++++++ .../recipes/linux/linux-smx6_3.14.28.bbappend | 6 +++ 3 files changed, 117 insertions(+) create mode 100644 meta-smx6-extras/recipes/linux/linux-smx6/0001-ARM-8158-1-LLVMLinux-use-static-inline-in-ARM-ftrace.patch create mode 100644 meta-smx6-extras/recipes/linux/linux-smx6/0001-ARM-LLVMLinux-Change-extern-inline-to-static-inline-.patch (limited to 'meta-smx6-extras') diff --git a/meta-smx6-extras/recipes/linux/linux-smx6/0001-ARM-8158-1-LLVMLinux-use-static-inline-in-ARM-ftrace.patch b/meta-smx6-extras/recipes/linux/linux-smx6/0001-ARM-8158-1-LLVMLinux-use-static-inline-in-ARM-ftrace.patch new file mode 100644 index 0000000..ee61a74 --- /dev/null +++ b/meta-smx6-extras/recipes/linux/linux-smx6/0001-ARM-8158-1-LLVMLinux-use-static-inline-in-ARM-ftrace.patch @@ -0,0 +1,52 @@ +From ef372125fd64fc181869be4cf528488f9e8b46c2 Mon Sep 17 00:00:00 2001 +From: Behan Webster +Date: Wed, 24 Sep 2014 01:06:46 +0100 +Subject: [PATCH] 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 +Reviewed-by: Mark Charlebois +Acked-by: Steven Rostedt +Signed-off-by: Russell King +--- + arch/arm/include/asm/ftrace.h | 2 +- + arch/arm/kernel/return_address.c | 5 ----- + 2 files changed, 1 insertion(+), 6 deletions(-) + +diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h +index f89515a..2bb8cac 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); +-- +1.9.1 + diff --git a/meta-smx6-extras/recipes/linux/linux-smx6/0001-ARM-LLVMLinux-Change-extern-inline-to-static-inline-.patch b/meta-smx6-extras/recipes/linux/linux-smx6/0001-ARM-LLVMLinux-Change-extern-inline-to-static-inline-.patch new file mode 100644 index 0000000..064e28b --- /dev/null +++ b/meta-smx6-extras/recipes/linux/linux-smx6/0001-ARM-LLVMLinux-Change-extern-inline-to-static-inline-.patch @@ -0,0 +1,59 @@ +From eb38d22ea05961666878dfb88c68629eacfb1399 Mon Sep 17 00:00:00 2001 +From: Behan Webster +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 +Signed-off-by: Behan Webster +Reviewed-by: Mark Charlebois +--- + 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 +-- +1.9.1 + diff --git a/meta-smx6-extras/recipes/linux/linux-smx6_3.14.28.bbappend b/meta-smx6-extras/recipes/linux/linux-smx6_3.14.28.bbappend index 330a4f1..4f05ca1 100644 --- a/meta-smx6-extras/recipes/linux/linux-smx6_3.14.28.bbappend +++ b/meta-smx6-extras/recipes/linux/linux-smx6_3.14.28.bbappend @@ -19,6 +19,12 @@ ## ############################################################################## +FILESEXTRAPATHS_append := "${THISDIR}/${PN}:" +SRC_URI += " \ + file://0001-ARM-8158-1-LLVMLinux-use-static-inline-in-ARM-ftrace.patch \ + file://0001-ARM-LLVMLinux-Change-extern-inline-to-static-inline-.patch \ + " + do_configure_prepend() { sed -e '/CONFIG_USB_FUNCTIONFS_ETH=/d' \ -e '/CONFIG_USB_FUNCTIONFS_RNDIS=/d' \ -- cgit v1.2.3-54-g00ecf