* [meta-oe][PATCH] libnfc: Fix build with musl
@ 2019-05-21 5:21 Khem Raj
2019-05-21 6:02 ` Adrian Bunk
0 siblings, 1 reply; 2+ messages in thread
From: Khem Raj @ 2019-05-21 5:21 UTC (permalink / raw)
To: openembedded-devel
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
...-usbbus-Include-stdint.h-for-uintX_t.patch | 33 +++++++++++++++++++
meta-oe/recipes-core/libnfc/libnfc_git.bb | 4 ++-
2 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 meta-oe/recipes-core/libnfc/libnfc/0001-usbbus-Include-stdint.h-for-uintX_t.patch
diff --git a/meta-oe/recipes-core/libnfc/libnfc/0001-usbbus-Include-stdint.h-for-uintX_t.patch b/meta-oe/recipes-core/libnfc/libnfc/0001-usbbus-Include-stdint.h-for-uintX_t.patch
new file mode 100644
index 0000000000..b1e9be7c35
--- /dev/null
+++ b/meta-oe/recipes-core/libnfc/libnfc/0001-usbbus-Include-stdint.h-for-uintX_t.patch
@@ -0,0 +1,33 @@
+From cb2a3991545ba9e885704226ed3e831bd5e4cb27 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 20 May 2019 22:10:05 -0700
+Subject: [PATCH] usbbus: Include stdint.h for uintX_t
+
+stdint.h is needed for uintX_t typedefs which are
+used to replace u_intX_t in libusb API headers in the cmake files
+
+Define _GNU_SOURCE since thats not defined by default for musl
+C library on linux
+
+Upstream-Status: Submitted [https://github.com/nfc-tools/libnfc/pull/544]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libnfc/buses/usbbus.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libnfc/buses/usbbus.h b/libnfc/buses/usbbus.h
+index 87f6a85..d18bf8b 100644
+--- a/libnfc/buses/usbbus.h
++++ b/libnfc/buses/usbbus.h
+@@ -35,6 +35,8 @@
+
+ #ifndef _WIN32
+ // Under POSIX system, we use libusb (>= 0.1.12)
++#define _GNU_SOURCE
++#include <stdint.h>
+ #include <usb.h>
+ #define USB_TIMEDOUT ETIMEDOUT
+ #define _usb_strerror( X ) strerror(-X)
+--
+2.21.0
+
diff --git a/meta-oe/recipes-core/libnfc/libnfc_git.bb b/meta-oe/recipes-core/libnfc/libnfc_git.bb
index d00733bf58..040ac2145c 100644
--- a/meta-oe/recipes-core/libnfc/libnfc_git.bb
+++ b/meta-oe/recipes-core/libnfc/libnfc_git.bb
@@ -9,6 +9,8 @@ inherit autotools pkgconfig
S = "${WORKDIR}/git"
SRCREV = "c42e2502d4627d3ea62f83c32677b100bb3cebdc"
-SRC_URI = "git://github.com/nfc-tools/libnfc.git"
+SRC_URI = "git://github.com/nfc-tools/libnfc.git \
+ file://0001-usbbus-Include-stdint.h-for-uintX_t.patch \
+ "
DEPENDS = "libusb"
--
2.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [meta-oe][PATCH] libnfc: Fix build with musl
2019-05-21 5:21 [meta-oe][PATCH] libnfc: Fix build with musl Khem Raj
@ 2019-05-21 6:02 ` Adrian Bunk
0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2019-05-21 6:02 UTC (permalink / raw)
To: Khem Raj; +Cc: openembedded-devel
On Mon, May 20, 2019 at 10:21:03PM -0700, Khem Raj wrote:
>...
> +--- a/libnfc/buses/usbbus.h
> ++++ b/libnfc/buses/usbbus.h
> +@@ -35,6 +35,8 @@
> +
> + #ifndef _WIN32
> + // Under POSIX system, we use libusb (>= 0.1.12)
> ++#define _GNU_SOURCE
> ++#include <stdint.h>
>...
Defining feature test macros after headers have already been included is
documented to be wrong, and can lead to nasty runtime breakages.
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-21 6:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-21 5:21 [meta-oe][PATCH] libnfc: Fix build with musl Khem Raj
2019-05-21 6:02 ` Adrian Bunk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.