All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH V2 1/2] libnfc: Fix build with musl
@ 2019-05-21  6:55 Khem Raj
  2019-05-21  6:55 ` [meta-oe][PATCH 2/2] openocd: Fix build on x86_64 Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: Khem Raj @ 2019-05-21  6:55 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Pass _GNU_SOURCE on cmdline

 ...-usbbus-Include-stdint.h-for-uintX_t.patch | 24 +++++++++++++++++++
 meta-oe/recipes-core/libnfc/libnfc_git.bb     |  5 +++-
 2 files changed, 28 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..b8ed87aa0f
--- /dev/null
+++ b/meta-oe/recipes-core/libnfc/libnfc/0001-usbbus-Include-stdint.h-for-uintX_t.patch
@@ -0,0 +1,24 @@
+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
+
+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(+)
+
+--- a/libnfc/buses/usbbus.h
++++ b/libnfc/buses/usbbus.h
+@@ -35,6 +35,7 @@
+ 
+ #ifndef _WIN32
+ // Under POSIX system, we use libusb (>= 0.1.12)
++#include <stdint.h>
+ #include <usb.h>
+ #define USB_TIMEDOUT ETIMEDOUT
+ #define _usb_strerror( X ) strerror(-X)
diff --git a/meta-oe/recipes-core/libnfc/libnfc_git.bb b/meta-oe/recipes-core/libnfc/libnfc_git.bb
index d00733bf58..7efd3443dd 100644
--- a/meta-oe/recipes-core/libnfc/libnfc_git.bb
+++ b/meta-oe/recipes-core/libnfc/libnfc_git.bb
@@ -9,6 +9,9 @@ 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 \
+          "
 
+CFLAGS_append_libc-musl = " -D_GNU_SOURCE"
 DEPENDS = "libusb"
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [meta-oe][PATCH 2/2] openocd: Fix build on x86_64
  2019-05-21  6:55 [meta-oe][PATCH V2 1/2] libnfc: Fix build with musl Khem Raj
@ 2019-05-21  6:55 ` Khem Raj
  2019-05-21  7:19   ` Adrian Bunk
  0 siblings, 1 reply; 4+ messages in thread
From: Khem Raj @ 2019-05-21  6:55 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...fine-PAGE_SIZE-if-its-not-already-de.patch | 37 +++++++++++++++++++
 .../recipes-devtools/openocd/openocd_git.bb   |  1 +
 2 files changed, 38 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/openocd/openocd/0001-esirisc_flash-Define-PAGE_SIZE-if-its-not-already-de.patch

diff --git a/meta-oe/recipes-devtools/openocd/openocd/0001-esirisc_flash-Define-PAGE_SIZE-if-its-not-already-de.patch b/meta-oe/recipes-devtools/openocd/openocd/0001-esirisc_flash-Define-PAGE_SIZE-if-its-not-already-de.patch
new file mode 100644
index 0000000000..6fe5b27891
--- /dev/null
+++ b/meta-oe/recipes-devtools/openocd/openocd/0001-esirisc_flash-Define-PAGE_SIZE-if-its-not-already-de.patch
@@ -0,0 +1,37 @@
+From 531c96b4fd99ea046750591af36c5b3f92479fa6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 20 May 2019 23:24:26 -0700
+Subject: [PATCH] esirisc_flash: Define PAGE_SIZE if its not already defined
+
+Fixes
+| src/flash/nor/esirisc_flash.c:95:9: error: 'PAGE_SIZE' macro redefined [-Werror,-Wmacro-redefined]
+| #define PAGE_SIZE                       4096
+|         ^
+| /mnt/a/yoe/build/tmp/work/core2-64-yoe-linux-musl/openocd/0.10+gitrAUTOINC+7ee618692f-r0/recipe-sysroot/usr/inclu
+de/limits.h:89:9: note: previous definition is here
+| #define PAGE_SIZE PAGESIZE
+
+Change-Id: I195b303fc88a7c848ca4e55fd6ba893796df55cc
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Submitted [http://openocd.zylin.com/#/c/5180/]
+---
+ src/flash/nor/esirisc_flash.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/flash/nor/esirisc_flash.c b/src/flash/nor/esirisc_flash.c
+index 4e33b9429..90661b77b 100644
+--- a/src/flash/nor/esirisc_flash.c
++++ b/src/flash/nor/esirisc_flash.c
+@@ -92,7 +92,9 @@
+ #endif
+ 
+ #define CONTROL_TIMEOUT		5000		/* 5s    */
++#ifndef PAGE_SIZE
+ #define PAGE_SIZE			4096
++#endif
+ #define PB_MAX				32
+ 
+ #define NUM_NS_PER_S		1000000000ULL
+-- 
+2.21.0
+
diff --git a/meta-oe/recipes-devtools/openocd/openocd_git.bb b/meta-oe/recipes-devtools/openocd/openocd_git.bb
index 9a8a09a913..9054e69b6c 100644
--- a/meta-oe/recipes-devtools/openocd/openocd_git.bb
+++ b/meta-oe/recipes-devtools/openocd/openocd_git.bb
@@ -9,6 +9,7 @@ SRC_URI = " \
     git://repo.or.cz/r/git2cl.git;protocol=http;destsuffix=tools/git2cl;name=git2cl \
     git://repo.or.cz/r/jimtcl.git;protocol=http;destsuffix=git/jimtcl;name=jimtcl \
     git://repo.or.cz/r/libjaylink.git;protocol=http;destsuffix=git/src/jtag/drivers/libjaylink;name=libjaylink \
+    file://0001-esirisc_flash-Define-PAGE_SIZE-if-its-not-already-de.patch \
 "
 
 SRCREV_FORMAT = "openocd"
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [meta-oe][PATCH 2/2] openocd: Fix build on x86_64
  2019-05-21  6:55 ` [meta-oe][PATCH 2/2] openocd: Fix build on x86_64 Khem Raj
@ 2019-05-21  7:19   ` Adrian Bunk
  2019-05-21 17:42     ` Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2019-05-21  7:19 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-devel

On Mon, May 20, 2019 at 11:55:29PM -0700, Khem Raj wrote:
>...
> +Fixes
> +| src/flash/nor/esirisc_flash.c:95:9: error: 'PAGE_SIZE' macro redefined [-Werror,-Wmacro-redefined]
> +| #define PAGE_SIZE                       4096
> +|         ^
> +| /mnt/a/yoe/build/tmp/work/core2-64-yoe-linux-musl/openocd/0.10+gitrAUTOINC+7ee618692f-r0/recipe-sysroot/usr/inclu
> +de/limits.h:89:9: note: previous definition is here
> +| #define PAGE_SIZE PAGESIZE
>...
> +--- a/src/flash/nor/esirisc_flash.c
> ++++ b/src/flash/nor/esirisc_flash.c
> +@@ -92,7 +92,9 @@
> + #endif
> + 
> + #define CONTROL_TIMEOUT		5000		/* 5s    */
> ++#ifndef PAGE_SIZE
> + #define PAGE_SIZE			4096
> ++#endif
> + #define PB_MAX				32
>...

Are you sure this is correct?
This looks like two completely unrelated defines that just happen to 
have the same name.
And it worked by chance since they have the same value on x86_64.

Renaming to something like ESIRISC_PAGE_SIZE would be a proper fix.

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] 4+ messages in thread

* Re: [meta-oe][PATCH 2/2] openocd: Fix build on x86_64
  2019-05-21  7:19   ` Adrian Bunk
@ 2019-05-21 17:42     ` Khem Raj
  0 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2019-05-21 17:42 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: openembeded-devel

On Tue, May 21, 2019 at 12:19 AM Adrian Bunk <bunk@stusta.de> wrote:
>
> On Mon, May 20, 2019 at 11:55:29PM -0700, Khem Raj wrote:
> >...
> > +Fixes
> > +| src/flash/nor/esirisc_flash.c:95:9: error: 'PAGE_SIZE' macro redefined [-Werror,-Wmacro-redefined]
> > +| #define PAGE_SIZE                       4096
> > +|         ^
> > +| /mnt/a/yoe/build/tmp/work/core2-64-yoe-linux-musl/openocd/0.10+gitrAUTOINC+7ee618692f-r0/recipe-sysroot/usr/inclu
> > +de/limits.h:89:9: note: previous definition is here
> > +| #define PAGE_SIZE PAGESIZE
> >...
> > +--- a/src/flash/nor/esirisc_flash.c
> > ++++ b/src/flash/nor/esirisc_flash.c
> > +@@ -92,7 +92,9 @@
> > + #endif
> > +
> > + #define CONTROL_TIMEOUT             5000            /* 5s    */
> > ++#ifndef PAGE_SIZE
> > + #define PAGE_SIZE                   4096
> > ++#endif
> > + #define PB_MAX                              32
> >...
>
> Are you sure this is correct?
> This looks like two completely unrelated defines that just happen to
> have the same name.
> And it worked by chance since they have the same value on x86_64.
>
> Renaming to something like ESIRISC_PAGE_SIZE would be a proper fix.
>

yes, upstream clarified that too. v2 is on cards.

> 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] 4+ messages in thread

end of thread, other threads:[~2019-05-21 17:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-21  6:55 [meta-oe][PATCH V2 1/2] libnfc: Fix build with musl Khem Raj
2019-05-21  6:55 ` [meta-oe][PATCH 2/2] openocd: Fix build on x86_64 Khem Raj
2019-05-21  7:19   ` Adrian Bunk
2019-05-21 17:42     ` Khem Raj

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.