diff mbox series

[meta-oe,5/5] libimobiledevice: Fix build with clang

Message ID 20230510032504.457574-5-raj.khem@gmail.com
State New
Headers show
Series [meta-oe,1/5] packagegroup-meta-oe: Add kpatch for glibc + x86_64 only | expand

Commit Message

Khem Raj May 10, 2023, 3:25 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../0001-include-unistd.h-for-usleep.patch    | 31 +++++++++++++++++++
 .../libimobiledevice/libimobiledevice_git.bb  |  3 +-
 2 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-connectivity/libimobiledevice/libimobiledevice/0001-include-unistd.h-for-usleep.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-connectivity/libimobiledevice/libimobiledevice/0001-include-unistd.h-for-usleep.patch b/meta-oe/recipes-connectivity/libimobiledevice/libimobiledevice/0001-include-unistd.h-for-usleep.patch
new file mode 100644
index 0000000000..424a203e56
--- /dev/null
+++ b/meta-oe/recipes-connectivity/libimobiledevice/libimobiledevice/0001-include-unistd.h-for-usleep.patch
@@ -0,0 +1,31 @@ 
+From 6cb8069cfe08114f1dc7b50a7fcd4dc040cd1bbb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 9 May 2023 20:19:23 -0700
+Subject: [PATCH] include unistd.h for usleep()
+
+clang16 flags the missing header
+
+Fixes
+../../git/tools/idevicedevmodectl.c:363:2: error: call to undeclared function 'usleep'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
+
+Upstream-Status: Submitted [https://github.com/libimobiledevice/libimobiledevice/pull/1444]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tools/idevicedevmodectl.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tools/idevicedevmodectl.c b/tools/idevicedevmodectl.c
+index 739bc13..9fe8d6a 100644
+--- a/tools/idevicedevmodectl.c
++++ b/tools/idevicedevmodectl.c
+@@ -34,6 +34,7 @@
+ #ifndef WIN32
+ #include <signal.h>
+ #endif
++#include <unistd.h>
+ 
+ #ifdef WIN32
+ #include <windows.h>
+-- 
+2.40.1
+
diff --git a/meta-oe/recipes-connectivity/libimobiledevice/libimobiledevice_git.bb b/meta-oe/recipes-connectivity/libimobiledevice/libimobiledevice_git.bb
index c17c7224f8..1a0590c57b 100644
--- a/meta-oe/recipes-connectivity/libimobiledevice/libimobiledevice_git.bb
+++ b/meta-oe/recipes-connectivity/libimobiledevice/libimobiledevice_git.bb
@@ -11,7 +11,8 @@  DEPENDS = "libplist usbmuxd libusbmuxd libtasn1 gnutls libgcrypt libimobiledevic
 PV = "1.3.0+git${SRCPV}"
 
 SRCREV = "860ffb707af3af94467d2ece4ad258dda957c6cd"
-SRC_URI = "git://github.com/libimobiledevice/libimobiledevice;protocol=https;branch=master"
+SRC_URI = "git://github.com/libimobiledevice/libimobiledevice;protocol=https;branch=master \
+           file://0001-include-unistd.h-for-usleep.patch"
 
 S = "${WORKDIR}/git"
 inherit autotools pkgconfig