summaryrefslogtreecommitdiff
path: root/target/linux
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-01-30 10:04:23 +0000
committerJo-Philipp Wich <jow@openwrt.org>2015-01-30 10:04:23 +0000
commit9d7651b528738e9ee62b5e182f565dea24b6f09d (patch)
tree0543e19ad961b98f8d81909260181282bb95c223 /target/linux
parent00a548aea80da62f2f5fb88a85f85c0ee16885d6 (diff)
downloadmtk-20170518-9d7651b528738e9ee62b5e182f565dea24b6f09d.zip
mtk-20170518-9d7651b528738e9ee62b5e182f565dea24b6f09d.tar.gz
mtk-20170518-9d7651b528738e9ee62b5e182f565dea24b6f09d.tar.bz2
linux: fix mips boot decompressor build
Replace the now defunct 062-mips_decompressor_build_fix.patch with another patch that simply undefines the arch memset and memcpy defines to avoid syntax errors in the redeclaration. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 44223
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/generic/patches-3.10/062-mips_decompressor_build_fix.patch64
-rw-r--r--target/linux/generic/patches-3.10/062-mips_decompressor_memcpy_memset_redefinition.patch18
2 files changed, 18 insertions, 64 deletions
diff --git a/target/linux/generic/patches-3.10/062-mips_decompressor_build_fix.patch b/target/linux/generic/patches-3.10/062-mips_decompressor_build_fix.patch
deleted file mode 100644
index 4ddcbb4..0000000
--- a/target/linux/generic/patches-3.10/062-mips_decompressor_build_fix.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 0db3db45f5bd6df4bdc03bbd5dec672e16164c4e Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <florian@openwrt.org>
-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 <florian@openwrt.org>
----
- 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>
diff --git a/target/linux/generic/patches-3.10/062-mips_decompressor_memcpy_memset_redefinition.patch b/target/linux/generic/patches-3.10/062-mips_decompressor_memcpy_memset_redefinition.patch
new file mode 100644
index 0000000..4a9a714
--- /dev/null
+++ b/target/linux/generic/patches-3.10/062-mips_decompressor_memcpy_memset_redefinition.patch
@@ -0,0 +1,18 @@
+--- a/arch/mips/boot/compressed/decompress.c
++++ b/arch/mips/boot/compressed/decompress.c
+@@ -45,6 +45,7 @@ void error(char *x)
+ #define STATIC static
+
+ #ifdef CONFIG_KERNEL_GZIP
++#undef memcpy
+ void *memcpy(void *dest, const void *src, size_t n)
+ {
+ int i;
+@@ -59,6 +60,7 @@ void *memcpy(void *dest, const void *src
+ #endif
+
+ #ifdef CONFIG_KERNEL_BZIP2
++#undef memset
+ void *memset(void *s, int c, size_t n)
+ {
+ int i;