Re: comms/sigrok/*: conflict between usbhid(3) and comms/libhidapi
On 2021/04/11 13:56, Kurt Mosiejczuk wrote: > On Sun, Apr 11, 2021 at 03:50:27PM +0200, Charlene Wendling wrote: > > Ping. > > Sorry. I did run a build with this and it fixed the issues. > > ok kmos OK. I guess it is also broken on amd64 but only at runtime. > > > It looks like it happens because our usbhid defines hid_init(3), > > > but the libhidapi's one must be used instead. As mentioned in > > > comms/libhidapi/patches/patch-hidapi_hidapi_h, we should use > > > hidapi_hid_init(). It would be a good idea to add that as a comment to comms/libhidapi/Makefile where it's a bit more visible than a header in a patch.
Re: comms/sigrok/*: conflict between usbhid(3) and comms/libhidapi
On Sun, Apr 11, 2021 at 03:50:27PM +0200, Charlene Wendling wrote: > Ping. Sorry. I did run a build with this and it fixed the issues. ok kmos --Kurt > On Sun, 4 Apr 2021 00:14:56 +0200 > Charlene Wendling wrote: > > > Hi, > > > > > http://build-failures.rhaalovely.net/powerpc/2021-03-11/comms/sigrok/pulseview.log > > > http://build-failures.rhaalovely.net/powerpc/2021-03-11/comms/sigrok/sigrok-cli.log > > > http://build-failures.rhaalovely.net/sparc64/2021-03-31/comms/sigrok/pulseview.log > > > http://build-failures.rhaalovely.net/sparc64/2021-03-31/comms/sigrok/sigrok-cli.log > > > > It looks like it happens because our usbhid defines hid_init(3), > > but the libhidapi's one must be used instead. As mentioned in > > comms/libhidapi/patches/patch-hidapi_hidapi_h, we should use > > hidapi_hid_init(). > > > > That diff fixes the concerned libsigrok [0] consumers' build [1] [2] > > on macppc, and amd64 is still fine. > > > > As far as macppc go, i may not be able to apply this patch for the > > current bulk. > > > > Comments/feedback are welcome, > > > > Charlène. > > > > > > [0] https://bin.charlenew.xyz/libsigrok.log > > [1] https://bin.charlenew.xyz/sigrok-cli.log > > [2] https://bin.charlenew.xyz/pulseview.log > > > Index: Makefile > === > RCS file: /cvs/ports/comms/sigrok/libsigrok/Makefile,v > retrieving revision 1.11 > diff -u -p -u -p -r1.11 Makefile > --- Makefile 6 Mar 2021 22:42:43 - 1.11 > +++ Makefile 11 Apr 2021 13:49:35 - > @@ -5,7 +5,7 @@ COMMENT = sigrok hardware driver librar > SIGROK_PROJECT = libsigrok > SIGROK_VERSION = 0.5.2 > MODPY_EGG_VERSION = ${SIGROK_VERSION} > -REVISION = 0 > +REVISION = 1 > > SHARED_LIBS += sigrok0.1 # 0.0 > SHARED_LIBS += sigrokcxx 0.1 # 4.0 > Index: patches/patch-src_backend_c > === > RCS file: patches/patch-src_backend_c > diff -N patches/patch-src_backend_c > --- /dev/null 1 Jan 1970 00:00:00 - > +++ patches/patch-src_backend_c 11 Apr 2021 13:49:35 - > @@ -0,0 +1,22 @@ > +$OpenBSD$ > + > +Fix for: > +src/backend.c:613:6: warning: implicit declaration of function 'hid_init' > +is invalid in C99 > +On ld.bfd arches, this led to undefined references at build time. > + > +It appears that comms/libhidapi redefines hid_init(3) to hidapi_hid_init(). > + > +Index: src/backend.c > +--- src/backend.c.orig > src/backend.c > +@@ -23,6 +23,9 @@ > + #ifdef _WIN32 > + #include > + #endif > ++#ifdef __OpenBSD__ > ++#define hid_init hidapi_hid_init > ++#endif > + #include > + #include "libsigrok-internal.h" > +
Re: comms/sigrok/*: conflict between usbhid(3) and comms/libhidapi
Ping. On Sun, 4 Apr 2021 00:14:56 +0200 Charlene Wendling wrote: > Hi, > > > http://build-failures.rhaalovely.net/powerpc/2021-03-11/comms/sigrok/pulseview.log > > http://build-failures.rhaalovely.net/powerpc/2021-03-11/comms/sigrok/sigrok-cli.log > > http://build-failures.rhaalovely.net/sparc64/2021-03-31/comms/sigrok/pulseview.log > > http://build-failures.rhaalovely.net/sparc64/2021-03-31/comms/sigrok/sigrok-cli.log > > It looks like it happens because our usbhid defines hid_init(3), > but the libhidapi's one must be used instead. As mentioned in > comms/libhidapi/patches/patch-hidapi_hidapi_h, we should use > hidapi_hid_init(). > > That diff fixes the concerned libsigrok [0] consumers' build [1] [2] > on macppc, and amd64 is still fine. > > As far as macppc go, i may not be able to apply this patch for the > current bulk. > > Comments/feedback are welcome, > > Charlène. > > > [0] https://bin.charlenew.xyz/libsigrok.log > [1] https://bin.charlenew.xyz/sigrok-cli.log > [2] https://bin.charlenew.xyz/pulseview.log Index: Makefile === RCS file: /cvs/ports/comms/sigrok/libsigrok/Makefile,v retrieving revision 1.11 diff -u -p -u -p -r1.11 Makefile --- Makefile6 Mar 2021 22:42:43 - 1.11 +++ Makefile11 Apr 2021 13:49:35 - @@ -5,7 +5,7 @@ COMMENT = sigrok hardware driver librar SIGROK_PROJECT = libsigrok SIGROK_VERSION = 0.5.2 MODPY_EGG_VERSION =${SIGROK_VERSION} -REVISION = 0 +REVISION = 1 SHARED_LIBS += sigrok0.1 # 0.0 SHARED_LIBS += sigrokcxx 0.1 # 4.0 Index: patches/patch-src_backend_c === RCS file: patches/patch-src_backend_c diff -N patches/patch-src_backend_c --- /dev/null 1 Jan 1970 00:00:00 - +++ patches/patch-src_backend_c 11 Apr 2021 13:49:35 - @@ -0,0 +1,22 @@ +$OpenBSD$ + +Fix for: +src/backend.c:613:6: warning: implicit declaration of function 'hid_init' +is invalid in C99 +On ld.bfd arches, this led to undefined references at build time. + +It appears that comms/libhidapi redefines hid_init(3) to hidapi_hid_init(). + +Index: src/backend.c +--- src/backend.c.orig src/backend.c +@@ -23,6 +23,9 @@ + #ifdef _WIN32 + #include + #endif ++#ifdef __OpenBSD__ ++#define hid_init hidapi_hid_init ++#endif + #include + #include "libsigrok-internal.h" +
comms/sigrok/*: conflict between usbhid(3) and comms/libhidapi
Hi, > http://build-failures.rhaalovely.net/powerpc/2021-03-11/comms/sigrok/pulseview.log > http://build-failures.rhaalovely.net/powerpc/2021-03-11/comms/sigrok/sigrok-cli.log > http://build-failures.rhaalovely.net/sparc64/2021-03-31/comms/sigrok/pulseview.log > http://build-failures.rhaalovely.net/sparc64/2021-03-31/comms/sigrok/sigrok-cli.log It looks like it happens because our usbhid defines hid_init(3), but the libhidapi's one must be used instead. As mentioned in comms/libhidapi/patches/patch-hidapi_hidapi_h, we should use hidapi_hid_init(). That diff fixes the concerned libsigrok [0] consumers' build [1] [2] on macppc, and amd64 is still fine. As far as macppc go, i may not be able to apply this patch for the current bulk. Comments/feedback are welcome, Charlène. [0] https://bin.charlenew.xyz/libsigrok.log [1] https://bin.charlenew.xyz/sigrok-cli.log [2] https://bin.charlenew.xyz/pulseview.log Index: Makefile === RCS file: /cvs/ports/comms/sigrok/libsigrok/Makefile,v retrieving revision 1.11 diff -u -p -u -p -r1.11 Makefile --- Makefile6 Mar 2021 22:42:43 - 1.11 +++ Makefile3 Apr 2021 20:57:49 - @@ -5,7 +5,7 @@ COMMENT = sigrok hardware driver librar SIGROK_PROJECT = libsigrok SIGROK_VERSION = 0.5.2 MODPY_EGG_VERSION =${SIGROK_VERSION} -REVISION = 0 +REVISION = 1 SHARED_LIBS += sigrok0.1 # 0.0 SHARED_LIBS += sigrokcxx 0.1 # 4.0 Index: patches/patch-src_backend_c === RCS file: patches/patch-src_backend_c diff -N patches/patch-src_backend_c --- /dev/null 1 Jan 1970 00:00:00 - +++ patches/patch-src_backend_c 3 Apr 2021 20:57:49 - @@ -0,0 +1,23 @@ +$OpenBSD$ + +Fix for: +src/backend.c:613:6: warning: implicit declaration of function 'hid_init' +is invalid in C99 +On ld.bfd arches, this led to undefined references at build time. + +It appears that comms/libhidapi redefines hid_init(3) to hidapi_hid_init() +to avoid clashes with base usbhid(3). + +Index: src/backend.c +--- src/backend.c.orig src/backend.c +@@ -23,6 +23,9 @@ + #ifdef _WIN32 + #include + #endif ++#ifdef __OpenBSD__ ++#define hid_init hidapi_hid_init ++#endif + #include + #include "libsigrok-internal.h" +