All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] libusb-compat: fix a build issue with undefined PATH_MAX
@ 2017-07-03 14:16 Bartosz Golaszewski
  2017-07-03 15:11 ` Arnout Vandecappelle
  2017-07-04 16:45 ` Thomas Petazzoni
  0 siblings, 2 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2017-07-03 14:16 UTC (permalink / raw)
  To: buildroot

libsigrok build failed because of PATH_MAX not being defined in usb.h.
On linux it is defined in linux/limits.h, but usb.h only includes
limit.h. Add a patch fixing the header in libusb-compat.

While we're at it: remove the patch numbering from previous patch.

Fixes: http://autobuild.buildroot.net/results/535/5353c2418c0c3311ef9ecb1f1ddc3ce769369b96/
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 ...andard-fixed-width-integer-types-in-usb.h.patch |  7 +++--
 .../0002-fix-a-build-issue-on-linux.patch          | 32 ++++++++++++++++++++++
 2 files changed, 36 insertions(+), 3 deletions(-)
 create mode 100644 package/libusb-compat/0002-fix-a-build-issue-on-linux.patch

diff --git a/package/libusb-compat/0001-Use-C99-standard-fixed-width-integer-types-in-usb.h.patch b/package/libusb-compat/0001-Use-C99-standard-fixed-width-integer-types-in-usb.h.patch
index ad71199..35872a9 100644
--- a/package/libusb-compat/0001-Use-C99-standard-fixed-width-integer-types-in-usb.h.patch
+++ b/package/libusb-compat/0001-Use-C99-standard-fixed-width-integer-types-in-usb.h.patch
@@ -1,7 +1,7 @@
-From 2e9b6bbebb7cf1ef0095516ec6d5203deb3822e8 Mon Sep 17 00:00:00 2001
+From 87adda6abc3467ede45a6d2a87df2b9efdf5bb33 Mon Sep 17 00:00:00 2001
 From: Nathan Hjelm <hjelmn@me.com>
 Date: Fri, 9 Oct 2015 15:03:10 -0600
-Subject: [PATCH 1/1] Use C99 standard fixed width integer types in usb.h
+Subject: [PATCH] Use C99 standard fixed width integer types in usb.h
 
 This patch modifies the integer types in usb.h of the form u_int* to the
 C99 standard uint* types.
@@ -13,6 +13,7 @@ https://github.com/libusb/libusb-compat-0.1/commit/2e9b6bbebb7cf1ef0095516ec6d52
 
 Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
 Signed-off-by: Nathan Hjelm <hjelmn@me.com>
+Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
 ---
  libusb/usb.h | 130 ++++++++++++++++++++++++++++++++---------------------------
  1 file changed, 70 insertions(+), 60 deletions(-)
@@ -232,5 +233,5 @@ index 84e730f..d2c30aa 100644
    struct usb_device *root_dev;
  };
 -- 
-2.4.9
+2.9.3
 
diff --git a/package/libusb-compat/0002-fix-a-build-issue-on-linux.patch b/package/libusb-compat/0002-fix-a-build-issue-on-linux.patch
new file mode 100644
index 0000000..d2e26b3
--- /dev/null
+++ b/package/libusb-compat/0002-fix-a-build-issue-on-linux.patch
@@ -0,0 +1,32 @@
+From af07587e8775c25450cda8ba9e9a8b1a58072634 Mon Sep 17 00:00:00 2001
+From: Bartosz Golaszewski <brgl@bgdev.pl>
+Date: Mon, 3 Jul 2017 15:55:00 +0200
+Subject: [PATCH] fix a build issue on linux
+
+On linux PATH_MAX is defined in linux/limits.h. If we include usb.h
+without previously having indirectly included it, the build fails.
+
+Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
+---
+ libusb/usb.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/libusb/usb.h b/libusb/usb.h
+index d2c30aa..7ad9a66 100644
+--- a/libusb/usb.h
++++ b/libusb/usb.h
+@@ -41,6 +41,11 @@ typedef unsigned __int32  uint32_t;
+ #include <stdint.h>
+ #endif
+ 
++/* On linux PATH_MAX is defined in linux/limits.h. */
++#if defined(__linux__)
++#include <linux/limits.h>
++#endif
++
+ /*
+  * USB spec information
+  *
+-- 
+2.9.3
+
-- 
2.9.3

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

* [Buildroot] [PATCH] libusb-compat: fix a build issue with undefined PATH_MAX
  2017-07-03 14:16 [Buildroot] [PATCH] libusb-compat: fix a build issue with undefined PATH_MAX Bartosz Golaszewski
@ 2017-07-03 15:11 ` Arnout Vandecappelle
  2017-07-03 15:48   ` Arnout Vandecappelle
  2017-07-04 16:45 ` Thomas Petazzoni
  1 sibling, 1 reply; 8+ messages in thread
From: Arnout Vandecappelle @ 2017-07-03 15:11 UTC (permalink / raw)
  To: buildroot

 Hi Bartosz,

On 03-07-17 16:16, Bartosz Golaszewski wrote:
> libsigrok build failed because of PATH_MAX not being defined in usb.h.
> On linux it is defined in linux/limits.h, but usb.h only includes
> limit.h. Add a patch fixing the header in libusb-compat.

 This doesn't sound right: according to POSIX [1], limits.h should define
PATH_MAX. And indeed, if you do

echo '#include <usb.h>' | host/usr/bin/x86_64-amd-linux-gnu-gcc -x c -E -

you'll see that PATH_MAX gets properly expanded to 4096. So something else is
going on.


> 
> While we're at it: remove the patch numbering from previous patch.

 Good idea, but no need to add your SoB just for that.

 Regards,
 Arnout

> Fixes: http://autobuild.buildroot.net/results/535/5353c2418c0c3311ef9ecb1f1ddc3ce769369b96/
> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>

[1] http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html

[snip]

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH] libusb-compat: fix a build issue with undefined PATH_MAX
  2017-07-03 15:11 ` Arnout Vandecappelle
@ 2017-07-03 15:48   ` Arnout Vandecappelle
  2017-07-03 16:50     ` Bartosz Golaszewski
  0 siblings, 1 reply; 8+ messages in thread
From: Arnout Vandecappelle @ 2017-07-03 15:48 UTC (permalink / raw)
  To: buildroot



On 03-07-17 17:11, Arnout Vandecappelle wrote:
>  Hi Bartosz,
> 
> On 03-07-17 16:16, Bartosz Golaszewski wrote:
>> libsigrok build failed because of PATH_MAX not being defined in usb.h.
>> On linux it is defined in linux/limits.h, but usb.h only includes
>> limit.h. Add a patch fixing the header in libusb-compat.
> 
>  This doesn't sound right: according to POSIX [1], limits.h should define
> PATH_MAX. And indeed, if you do
> 
> echo '#include <usb.h>' | host/usr/bin/x86_64-amd-linux-gnu-gcc -x c -E -
> 
> you'll see that PATH_MAX gets properly expanded to 4096. So something else is
> going on.

 OK so I investigated a little more, and it turns out that -std=c99 is the
culprit. And apparently people on the 'net are advising to use linux/limits.h to
get at PATH_MAX. So perhaps this is the right approach after all.

 What's the upstream status of this patch?

 Regards,
 Arnout

> 
> 
>>
>> While we're at it: remove the patch numbering from previous patch.
> 
>  Good idea, but no need to add your SoB just for that.
> 
>  Regards,
>  Arnout
> 
>> Fixes: http://autobuild.buildroot.net/results/535/5353c2418c0c3311ef9ecb1f1ddc3ce769369b96/
>> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> 
> [1] http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html
> 
> [snip]
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH] libusb-compat: fix a build issue with undefined PATH_MAX
  2017-07-03 15:48   ` Arnout Vandecappelle
@ 2017-07-03 16:50     ` Bartosz Golaszewski
  2017-07-19 13:08       ` Peter Korsgaard
  0 siblings, 1 reply; 8+ messages in thread
From: Bartosz Golaszewski @ 2017-07-03 16:50 UTC (permalink / raw)
  To: buildroot

2017-07-03 17:48 GMT+02:00 Arnout Vandecappelle <arnout@mind.be>:
>
>
> On 03-07-17 17:11, Arnout Vandecappelle wrote:
>>  Hi Bartosz,
>>
>> On 03-07-17 16:16, Bartosz Golaszewski wrote:
>>> libsigrok build failed because of PATH_MAX not being defined in usb.h.
>>> On linux it is defined in linux/limits.h, but usb.h only includes
>>> limit.h. Add a patch fixing the header in libusb-compat.
>>
>>  This doesn't sound right: according to POSIX [1], limits.h should define
>> PATH_MAX. And indeed, if you do
>>
>> echo '#include <usb.h>' | host/usr/bin/x86_64-amd-linux-gnu-gcc -x c -E -
>>
>> you'll see that PATH_MAX gets properly expanded to 4096. So something else is
>> going on.
>
>  OK so I investigated a little more, and it turns out that -std=c99 is the
> culprit. And apparently people on the 'net are advising to use linux/limits.h to
> get at PATH_MAX. So perhaps this is the right approach after all.
>
>  What's the upstream status of this patch?
>
>  Regards,
>  Arnout

Submitted, no answer yet.

Thanks,
Bartosz

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

* [Buildroot] [PATCH] libusb-compat: fix a build issue with undefined PATH_MAX
  2017-07-03 14:16 [Buildroot] [PATCH] libusb-compat: fix a build issue with undefined PATH_MAX Bartosz Golaszewski
  2017-07-03 15:11 ` Arnout Vandecappelle
@ 2017-07-04 16:45 ` Thomas Petazzoni
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2017-07-04 16:45 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon,  3 Jul 2017 16:16:52 +0200, Bartosz Golaszewski wrote:
> libsigrok build failed because of PATH_MAX not being defined in usb.h.
> On linux it is defined in linux/limits.h, but usb.h only includes
> limit.h. Add a patch fixing the header in libusb-compat.
> 
> While we're at it: remove the patch numbering from previous patch.
> 
> Fixes: http://autobuild.buildroot.net/results/535/5353c2418c0c3311ef9ecb1f1ddc3ce769369b96/
> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> ---
>  ...andard-fixed-width-integer-types-in-usb.h.patch |  7 +++--
>  .../0002-fix-a-build-issue-on-linux.patch          | 32 ++++++++++++++++++++++
>  2 files changed, 36 insertions(+), 3 deletions(-)
>  create mode 100644 package/libusb-compat/0002-fix-a-build-issue-on-linux.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] libusb-compat: fix a build issue with undefined PATH_MAX
  2017-07-03 16:50     ` Bartosz Golaszewski
@ 2017-07-19 13:08       ` Peter Korsgaard
  2017-07-19 13:10         ` Bartosz Golaszewski
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Korsgaard @ 2017-07-19 13:08 UTC (permalink / raw)
  To: buildroot

>>>>> "Bartosz" == Bartosz Golaszewski <brgl@bgdev.pl> writes:

Hi,

 >> OK so I investigated a little more, and it turns out that -std=c99 is the
 >> culprit. And apparently people on the 'net are advising to use linux/limits.h to
 >> get at PATH_MAX. So perhaps this is the right approach after all.
 >> 
 >> What's the upstream status of this patch?

 > Submitted, no answer yet.

Out of interest, where did you submit it? I don't seem to find a pull
request or a patch on the libusb-devel list?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH] libusb-compat: fix a build issue with undefined PATH_MAX
  2017-07-19 13:08       ` Peter Korsgaard
@ 2017-07-19 13:10         ` Bartosz Golaszewski
  2017-07-19 18:52           ` Peter Korsgaard
  0 siblings, 1 reply; 8+ messages in thread
From: Bartosz Golaszewski @ 2017-07-19 13:10 UTC (permalink / raw)
  To: buildroot

2017-07-19 15:08 GMT+02:00 Peter Korsgaard <peter@korsgaard.com>:
>>>>>> "Bartosz" == Bartosz Golaszewski <brgl@bgdev.pl> writes:
>
> Hi,
>
>  >> OK so I investigated a little more, and it turns out that -std=c99 is the
>  >> culprit. And apparently people on the 'net are advising to use linux/limits.h to
>  >> get at PATH_MAX. So perhaps this is the right approach after all.
>  >>
>  >> What's the upstream status of this patch?
>
>  > Submitted, no answer yet.
>
> Out of interest, where did you submit it? I don't seem to find a pull
> request or a patch on the libusb-devel list?
>
> --
> Bye, Peter Korsgaard

It's here: http://marc.info/?l=libusb-devel&m=149909307123038&w=2

Thanks,
Bartosz

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

* [Buildroot] [PATCH] libusb-compat: fix a build issue with undefined PATH_MAX
  2017-07-19 13:10         ` Bartosz Golaszewski
@ 2017-07-19 18:52           ` Peter Korsgaard
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Korsgaard @ 2017-07-19 18:52 UTC (permalink / raw)
  To: buildroot

>>>>> "Bartosz" == Bartosz Golaszewski <brgl@bgdev.pl> writes:

Hi,

 >> >> What's the upstream status of this patch?
 >> 
 >> > Submitted, no answer yet.
 >> 
 >> Out of interest, where did you submit it? I don't seem to find a pull
 >> request or a patch on the libusb-devel list?
 >> 
 >> --
 >> Bye, Peter Korsgaard

 > It's here: http://marc.info/?l=libusb-devel&m=149909307123038&w=2

Sorry, I must have missed it - Thanks for the heads up!

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2017-07-19 18:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-03 14:16 [Buildroot] [PATCH] libusb-compat: fix a build issue with undefined PATH_MAX Bartosz Golaszewski
2017-07-03 15:11 ` Arnout Vandecappelle
2017-07-03 15:48   ` Arnout Vandecappelle
2017-07-03 16:50     ` Bartosz Golaszewski
2017-07-19 13:08       ` Peter Korsgaard
2017-07-19 13:10         ` Bartosz Golaszewski
2017-07-19 18:52           ` Peter Korsgaard
2017-07-04 16:45 ` Thomas Petazzoni

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.