Author: jow
Date: 2015-01-25 16:55:03 +0100 (Sun, 25 Jan 2015)
New Revision: 44133

Added:
   trunk/target/linux/generic/patches-3.10/062-mips_decompressor_build_fix.patch
Log:
xburst: fix kernel build

Changeset r43049 removed the "062-mips_decompressor_build_fix.patch" which is
still required to properly build the xburst kernel.

Fix the syntax error in the preprocessed code by explicitely undefining the
"memcpy" and "memset" macros prior to declaring the replacements functions.

Signed-off-by: Jo-Philipp Wich <[email protected]>

Copied: 
trunk/target/linux/generic/patches-3.10/062-mips_decompressor_build_fix.patch 
(from rev 44132, 
trunk/target/linux/generic/patches-3.14/062-mips_decompressor_build_fix.patch)
===================================================================
--- 
trunk/target/linux/generic/patches-3.10/062-mips_decompressor_build_fix.patch   
                            (rev 0)
+++ 
trunk/target/linux/generic/patches-3.10/062-mips_decompressor_build_fix.patch   
    2015-01-25 15:55:03 UTC (rev 44133)
@@ -0,0 +1,64 @@
+From 0db3db45f5bd6df4bdc03bbd5dec672e16164c4e Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <[email protected]>
+Date: Mon, 12 Nov 2012 12:31:55 +0100
+Subject: [PATCH] MIPS: decompressor: fix build failure on memcpy() in
+ decompress.c
+
+The decompress.c file includes linux/kernel.h which causes the following
+inclusion chain to be pulled:
+linux/kernel.h ->
+       linux/dynamic_debug.h ->
+               linux/string.h ->
+                       asm/string.h
+
+We end up having a the GCC builtin + architecture specific memcpy() expanding
+into this:
+
+void *({ size_t __len = (size_t n); void *__ret; if
+(__builtin_constant_p(size_t n) && __len >= 64) __ret = memcpy((void *dest),
+(const void *src), __len); else __ret = __builtin_memcpy((void *dest), (const
+void *src), __len); __ret; })
+{
+ [memcpy implementation in decompress.c starts here]
+ int i;
+ const char *s = src;
+ char *d = dest;
+
+ for (i = 0; i < n; i++)
+  d[i] = s[i];
+ return dest;
+}
+
+raising the following compilation error:
+arch/mips/boot/compressed/decompress.c:46:8: error: expected identifier or '('
+before '{' token
+
+There are at least three possibilities to fix this issue:
+
+1) define _LINUX_STRING_H_ at the beginning of decompress.c to prevent
+   further linux/string.h definitions and declarations from being used, and add
+   an explicit strstr() declaration for linux/dynamic_debug.h
+
+2) remove the inclusion of linux/kernel.h because we actually use no definition
+   or declaration from this header file
+
+3) undefine memcpy or re-define memcpy to memcpy thus resulting in picking up
+   the local memcpy() implementation to this compilation unit
+
+This patch uses the second option which is the less intrusive one.
+
+Signed-off-by: Florian Fainelli <[email protected]>
+---
+ arch/mips/boot/compressed/decompress.c |    2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/arch/mips/boot/compressed/decompress.c
++++ b/arch/mips/boot/compressed/decompress.c
+@@ -12,7 +12,6 @@
+  */
+ 
+ #include <linux/types.h>
+-#include <linux/kernel.h>
+ #include <linux/string.h>
+ 
+ #include <asm/addrspace.h>
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to