summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2015-11-18 23:24:32 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-12 23:31:44 +0000
commit9a4ab3b1ad45a556b845530a12ec865be2278c78 (patch)
treeb52995222684153eae81e9b7fee53bf885fcb713 /meta
parent87376746d64aea47cce327d951692c31d4acf872 (diff)
downloadopenembedded-core-9a4ab3b1ad45a556b845530a12ec865be2278c78.tar.gz
openembedded-core-9a4ab3b1ad45a556b845530a12ec865be2278c78.tar.bz2
openembedded-core-9a4ab3b1ad45a556b845530a12ec865be2278c78.zip
mtd-utils: Backport and create patches to support musl
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch53
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch56
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch24
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils_git.bb4
4 files changed, 137 insertions, 0 deletions
diff --git a/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch b/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch
new file mode 100644
index 0000000000..d3699c65d6
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch
@@ -0,0 +1,53 @@
+From e16fa28bc57c29923ab60af2ac343da83e1992d8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 6 Oct 2015 23:51:34 +0000
+Subject: [PATCH] Fix build with musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ mkfs.jffs2.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
+ recv_image.c | 1 -
+ serve_image.c | 1 -
+ 3 files changed, 42 insertions(+), 4 deletions(-)
+
+diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c
+index f09c0b2..ed2dc43 100644
+--- a/mkfs.jffs2.c
++++ b/mkfs.jffs2.c
+@@ -72,6 +72,7 @@
+ #include <byteswap.h>
+ #include <crc32.h>
+ #include <inttypes.h>
++#include <limits.h>
+
+ #include "rbtree.h"
+ #include "common.h"
+diff --git a/recv_image.c b/recv_image.c
+index 26a8361..0093831 100644
+--- a/recv_image.c
++++ b/recv_image.c
+@@ -4,7 +4,6 @@
+ #define _BSD_SOURCE /* struct ip_mreq */
+
+ #include <errno.h>
+-#include <error.h>
+ #include <stdio.h>
+ #include <netdb.h>
+ #include <stdlib.h>
+diff --git a/serve_image.c b/serve_image.c
+index 38549a1..4f0e946 100644
+--- a/serve_image.c
++++ b/serve_image.c
+@@ -3,7 +3,6 @@
+
+ #include <time.h>
+ #include <errno.h>
+-#include <error.h>
+ #include <netdb.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+--
+2.6.1
+
diff --git a/meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch b/meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch
new file mode 100644
index 0000000000..46ed956d0e
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch
@@ -0,0 +1,56 @@
+From 26cc709291fc6c5d2e45b26c602407706d9142df Mon Sep 17 00:00:00 2001
+From: Imre Kaloz <kaloz@openwrt.org>
+Date: Mon, 4 May 2015 15:36:34 +0200
+Subject: [PATCH] mtd-utils: libfec: use standard C type instead of u_long
+
+Fixes compilation on hosts with the musl C library.
+Also drops the unused u_short typedef.
+
+Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+---
+Upstream-Status: Backport
+
+ lib/libfec.c | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/lib/libfec.c b/lib/libfec.c
+index ff5a127..bf68381 100644
+--- a/lib/libfec.c
++++ b/lib/libfec.c
+@@ -61,8 +61,6 @@ struct timeval {
+ };
+ #define gettimeofday(x, dummy) { (x)->ticks = clock() ; }
+ #define DIFF_T(a,b) (1+ 1000000*(a.ticks - b.ticks) / CLOCKS_PER_SEC )
+-typedef unsigned long u_long ;
+-typedef unsigned short u_short ;
+ #else /* typically, unix systems */
+ #include <sys/time.h>
+ #define DIFF_T(a,b) \
+@@ -75,12 +73,12 @@ typedef unsigned short u_short ;
+ t = x.tv_usec + 1000000* (x.tv_sec & 0xff ) ; \
+ }
+ #define TOCK(t) \
+- { u_long t1 ; TICK(t1) ; \
++ { unsigned long t1 ; TICK(t1) ; \
+ if (t1 < t) t = 256000000 + t1 - t ; \
+ else t = t1 - t ; \
+ if (t == 0) t = 1 ;}
+
+-u_long ticks[10]; /* vars for timekeeping */
++unsigned long ticks[10]; /* vars for timekeeping */
+ #else
+ #define DEB(x)
+ #define DDB(x)
+@@ -625,7 +623,7 @@ init_fec(void)
+ #define FEC_MAGIC 0xFECC0DEC
+
+ struct fec_parms {
+- u_long magic ;
++ unsigned long magic ;
+ int k, n ; /* parameters of the code */
+ gf *enc_matrix ;
+ } ;
+--
+2.6.0
+
diff --git a/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch b/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
new file mode 100644
index 0000000000..7d783e7a5c
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
@@ -0,0 +1,24 @@
+Replace rpmatch() usage with checking first character of line
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/include/common.h
++++ b/include/common.h
+@@ -122,10 +122,12 @@
+ }
+
+ if (strcmp("\n", line) != 0) {
+- switch (rpmatch(line)) {
+- case 0: ret = false; break;
+- case 1: ret = true; break;
+- case -1:
++ switch (line[0]) {
++ case 'N':
++ case 'n': ret = false; break;
++ case 'Y':
++ case 'y': ret = true; break;
++ default:
+ puts("unknown response; please try again");
+ continue;
+ }
diff --git a/meta/recipes-devtools/mtd/mtd-utils_git.bb b/meta/recipes-devtools/mtd/mtd-utils_git.bb
index 17dca77609..bc15ddd82c 100644
--- a/meta/recipes-devtools/mtd/mtd-utils_git.bb
+++ b/meta/recipes-devtools/mtd/mtd-utils_git.bb
@@ -15,8 +15,12 @@ SRC_URI = "git://git.infradead.org/mtd-utils.git \
file://fix-armv7-neon-alignment.patch \
file://0001-hashtable-Remove-duplicate-hashtable_iterator_value-.patch \
file://mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch \
+ file://0001-Fix-build-with-musl.patch \
+ file://0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch \
"
+SRC_URI_append_libc-musl = " file://010-fix-rpmatch.patch "
+
S = "${WORKDIR}/git/"
# xattr support creates an additional compile-time dependency on acl because