[meta-oe,v2,2/4] libimobiledevice-glue: fix undefined bswap error

Message ID 20220331021648.16582-3-potin.lai@quantatw.com
State New
Headers show
Series add idevicerestore support | expand

Commit Message

Potin Lai March 31, 2022, 2:16 a.m. UTC
Add patch for fixing undefiened bswap32 & bswap64 error on MIPS machine

Signed-off-by: Potin Lai <potin.lai@quantatw.com>
---
 ...wap32-and-bswap64-errors-for-MIPS-ma.patch | 32 +++++++++++++++++++
 .../libimobiledevice-glue_git.bb              |  5 ++-
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-connectivity/libimobiledevice-glue/files/0001-fix-undefined-bswap32-and-bswap64-errors-for-MIPS-ma.patch

Patch

diff --git a/meta-oe/recipes-connectivity/libimobiledevice-glue/files/0001-fix-undefined-bswap32-and-bswap64-errors-for-MIPS-ma.patch b/meta-oe/recipes-connectivity/libimobiledevice-glue/files/0001-fix-undefined-bswap32-and-bswap64-errors-for-MIPS-ma.patch
new file mode 100644
index 000000000..cff37fb5d
--- /dev/null
+++ b/meta-oe/recipes-connectivity/libimobiledevice-glue/files/0001-fix-undefined-bswap32-and-bswap64-errors-for-MIPS-ma.patch
@@ -0,0 +1,32 @@ 
+From 73fcf0b54f4c1fc07a2aa003dddaeb5a97177cce Mon Sep 17 00:00:00 2001
+From: Potin Lai <potin.lai@quantatw.com>
+Date: Thu, 31 Mar 2022 08:44:31 +0800
+Subject: [PATCH 1/1] fix undefined bswap32 and bswap64 errors for MIPS machine
+
+Replace bswap32 and bswap64 with internal defined version (__bswap_X)
+
+Upstream Status: Submitted [libimobiledevice-devel@libimobiledevice.org]
+
+Signed-off-by: Potin Lai <potin.lai@quantatw.com>
+---
+ include/endianness.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/endianness.h b/include/endianness.h
+index 099877a..88b63db 100644
+--- a/include/endianness.h
++++ b/include/endianness.h
+@@ -113,8 +113,8 @@
+      && !defined(__FLOAT_WORD_ORDER__)) \
+  || (defined(__FLOAT_WORD_ORDER__) \
+      && __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__)
+-#define float_bswap64(x) bswap64(x)
+-#define float_bswap32(x) bswap32(x)
++#define float_bswap64(x) __bswap_64(x)
++#define float_bswap32(x) __bswap_32(x)
+ #else
+ #define float_bswap64(x) (x)
+ #define float_bswap32(x) (x)
+-- 
+2.17.1
+
diff --git a/meta-oe/recipes-connectivity/libimobiledevice-glue/libimobiledevice-glue_git.bb b/meta-oe/recipes-connectivity/libimobiledevice-glue/libimobiledevice-glue_git.bb
index 28303d082..297a7d427 100644
--- a/meta-oe/recipes-connectivity/libimobiledevice-glue/libimobiledevice-glue_git.bb
+++ b/meta-oe/recipes-connectivity/libimobiledevice-glue/libimobiledevice-glue_git.bb
@@ -9,7 +9,10 @@  HOMEPAGE = "http://www.libimobiledevice.org/"
 DEPENDS = "libplist"
 
 SRCREV = "ecb0996fd2a3b0539153dd3ef901d137bf498ffe"
-SRC_URI = "git://github.com/libimobiledevice/libimobiledevice-glue;protocol=https;branch=master"
+SRC_URI = "\
+    git://github.com/libimobiledevice/libimobiledevice-glue;protocol=https;branch=master \
+    file://0001-fix-undefined-bswap32-and-bswap64-errors-for-MIPS-ma.patch \
+"
 
 S = "${WORKDIR}/git"
 inherit autotools pkgconfig