Skip to contentSkip to conversation

package/hidapi: select glibc gconv libs copy

PATCH New Dan Walkes 4 participants 6 messages Jun 17, 2018 – Jul 19, 2018

lore
Share & tools
lore

Dan Walkes

author
#0 lore raw

PATCH 1/1 package/hidapi: select glibc gconv libs copy

Hidapi source uses iconv_open UTF-16 conversion [1] which requires gconv libararies when buiding with glibc in order to successfully find serial number, manufacturer and product strings [2].

Use select in the config file to autmatically select gconv libararies for inclusion on the target when building with glibc

Tested with ./utils/test-pkg -c hidapi.cfg -p hidapi and hidapi.cfg file contents:
BR2_PACKAGE_HIDAPI=y
BR2_PACKAGE_EUDEV=y BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_USE_MMU=y
BR2_USE_WCHAR=y

Also tested on x86-64 build target with application using hidapi

[1]: https://github.com/signal11/hidapi/blob/a6a622ffb680c55da0de787ff93b80280498330f/libusb/hid.c#L446
[2]: https://www.silabs.com/community/interface/forum.topic.html/cp2114_linux_sta-RtWg

---
 package/hidapi/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/hidapi/Config.in +1 -0
index f6a31ba..d02ec23 100644
@@ -5,6 +5,7 @@ config BR2_PACKAGE_HIDAPI
 	select BR2_PACKAGE_LIBUSB
 	select BR2_PACKAGE_LIBGUDEV
 	select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
+	select BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY if BR2_TOOLCHAIN_USES_GLIBC # runtime UTF conversion support
 	help
 	  HIDAPI is a multi-platform library which allows an application
 	  to interface with USB and Bluetooth HID-Class devices on
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 package/hidapi: select glibc gconv libs copy

Hi Dan,

Quoted 31 lines · Dan Walkes

Hidapi source uses iconv_open UTF-16 conversion [1] which requires gconv libararies when buiding with glibc in order to successfully find serial number, manufacturer and product strings [2].

Use select in the config file to autmatically select gconv libararies for inclusion on the target when building with glibc

Tested with ./utils/test-pkg -c hidapi.cfg -p hidapi and hidapi.cfg file contents:
BR2_PACKAGE_HIDAPI=y
BR2_PACKAGE_EUDEV=y BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_USE_MMU=y
BR2_USE_WCHAR=y

Also tested on x86-64 build target with application using hidapi

[1]: https://github.com/signal11/hidapi/blob/a6a622ffb680c55da0de787ff93b80280498330f/libusb/hid.c#L446
[2]: https://www.silabs.com/community/interface/forum.topic.html/cp2114_linux_sta-RtWg

---
 package/hidapi/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/hidapi/Config.in +0 -0
index f6a31ba..d02ec23 100644

package/hidapi/Config.in config BR2_PACKAGE_HIDAPI · line 8

Quoted 4 lines
package/hidapi/Config.in +1 -0
@@ -5,6 +5,7 @@ config BR2_PACKAGE_HIDAPI
 	select BR2_PACKAGE_LIBUSB
 	select BR2_PACKAGE_LIBGUDEV
 	select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
+	select BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY if BR2_TOOLCHAIN_USES_GLIBC # runtime UTF conversion support

This does not work for external toolchains.

Maybe just add a comment in the help text saying that fully featured build requires BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY.

package/hidapi/Config.in config BR2_PACKAGE_HIDAPI · line 11

Quoted 3 lines
package/hidapi/Config.in +0 -0
 	help
 	  HIDAPI is a multi-platform library which allows an application
 	  to interface with USB and Bluetooth HID-Class devices on

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
author
#2 lore raw

PATCH 1/1 package/hidapi: select glibc gconv libs copy

Hi Baruch,

Quoted 12 lines

package/hidapi/Config.in config BR2_PACKAGE_HIDAPI · line 8

Quoted 9 lines
package/hidapi/Config.in +1 -0
index f6a31ba..d02ec23 100644
@@ -5,6 +5,7 @@ config BR2_PACKAGE_HIDAPI
      select BR2_PACKAGE_LIBUSB
      select BR2_PACKAGE_LIBGUDEV
      select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
+     select BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY if BR2_TOOLCHAIN_USES_GLIBC # runtime UTF conversion support

This does not work for external toolchains.

Quoted 7 lines

Maybe just add a comment in the help text saying that fully featured build requires BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY.

Quoted 3 lines
package/hidapi/Config.in +0 -0
      help
        HIDAPI is a multi-platform library which allows an application
        to interface with USB and Bluetooth HID-Class devices on

Sure, I could resubmit the patch with this text in addition:

---

package/hidapi/Config.in +1 -0
index d02ec23..7d79dab 100644
@@ -11,6 +11,9 @@ config BR2_PACKAGE_HIDAPI
          to interface with USB and Bluetooth HID-Class devices on
          Windows, Linux, and Mac OS X.
 
+         When using an external toolchain configuration

BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY must be configured
+ to support parsing of USB string descriptors.
+

          http://www.signal11.us/oss/hidapi/

comment "hidapi needs udev /dev management and a toolchain w/ NPTL threads"
---

Should I also add this comment to the kodi/Config.in at [1] as I used this as the example?

[1]: https://github.com/buildroot/buildroot/commit/48a717343deabbf9aa8b09f0c2b6944bcb5a81d9

#3 lore raw

PATCH 1/1 package/hidapi: select glibc gconv libs copy

In reply to Baruch Siach

Hello,

Quoted 11 lines · Baruch Siach

package/hidapi/Config.in config BR2_PACKAGE_HIDAPI · line 8

Quoted 9 lines
package/hidapi/Config.in +1 -0
index f6a31ba..d02ec23 100644
@@ -5,6 +5,7 @@ config BR2_PACKAGE_HIDAPI
 	select BR2_PACKAGE_LIBUSB
 	select BR2_PACKAGE_LIBGUDEV
 	select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
+	select BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY if BR2_TOOLCHAIN_USES_GLIBC # runtime UTF conversion support  

This does not work for external toolchains.

Why ?

The TOOLCHAIN_GLIBC_COPY_GCONV_LIBS hook is called for both internal and external toolchains, and the BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY option exists for both internal and external toolchains.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 1/1 package/hidapi: select glibc gconv libs copy

In reply to Dan Walkes

Hello,

Quoted 17 lines · Dan Walkes

Hidapi source uses iconv_open UTF-16 conversion [1] which requires gconv libararies when buiding with glibc in order to successfully find serial number, manufacturer and product strings [2].

Use select in the config file to autmatically select gconv libararies for inclusion on the target when building with glibc

Tested with ./utils/test-pkg -c hidapi.cfg -p hidapi and hidapi.cfg file contents:
BR2_PACKAGE_HIDAPI=y
BR2_PACKAGE_EUDEV=y BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_USE_MMU=y
BR2_USE_WCHAR=y

Also tested on x86-64 build target with application using hidapi

Quoted 8 lines

[1]: https://github.com/signal11/hidapi/blob/a6a622ffb680c55da0de787ff93b80280498330f/libusb/hid.c#L446
[2]: https://www.silabs.com/community/interface/forum.topic.html/cp2114_linux_sta-RtWg

---
 package/hidapi/Config.in | 1 +
 1 file changed, 1 insertion(+)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH 1/1 package/hidapi: select glibc gconv libs copy

In reply to Dan Walkes
Quoted 17 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Dan" == Dan Walkes <[email protected]> writes:

Hidapi source uses iconv_open UTF-16 conversion [1] which requires gconv libararies when buiding with glibc in order to successfully find serial number, manufacturer and product strings [2].

Use select in the config file to autmatically select gconv libararies for inclusion on the target when building with glibc

Tested with ./utils/test-pkg -c hidapi.cfg -p hidapi and hidapi.cfg file contents:
BR2_PACKAGE_HIDAPI=y
BR2_PACKAGE_EUDEV=y BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_USE_MMU=y
BR2_USE_WCHAR=y

Quoted 7 lines

Also tested on x86-64 build target with application using hidapi

[1]: https://github.com/signal11/hidapi/blob/a6a622ffb680c55da0de787ff93b80280498330f/libusb/hid.c#L446
[2]: https://www.silabs.com/community/interface/forum.topic.html/cp2114_linux_sta-RtWg

Committed to 2018.02.x and 2018.05.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard