All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/lrzsz: fix build with musl
@ 2025-06-20 22:18 Fiona Klute via buildroot
  2025-07-20 10:35 ` Julien Olivain via buildroot
  2025-08-07 18:23 ` Thomas Perale via buildroot
  0 siblings, 2 replies; 5+ messages in thread
From: Fiona Klute via buildroot @ 2025-06-20 22:18 UTC (permalink / raw)
  To: buildroot; +Cc: Fiona Klute, Thomas Petazzoni

lib/long-options.c failed to compile with musl for the same reason
0002-lib-long-options.c-include-stdlib.h.patch was added to fix,
exit() being undefined. The fix is the same as well: include stdlib.h.

Fixes: b6784a1f1f ("package/lrzsz: fix build with GCC >= 14.x")
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
---
This compiles with uClibc-ng, too (without even a warning, I didn't
test at runtime), so I'm not sure what those "non-GNU C libraries"
where things break are. There are similar comments all over the getopt
code, so with the age of the code maybe way outdated ones, or
non-Linux platforms.

 .../0002-lib-long-options.c-include-stdlib.h.patch     | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch b/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch
index 6229114e0a..f0532bd036 100644
--- a/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch
+++ b/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch
@@ -15,6 +15,8 @@ long-options.c:70:11: error: implicit declaration of function ‘exit’
 
 Upstream: https://github.com/UweOhse/lrzsz/pull/4
 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+[Fiona: remove conditional on __GNU_LIBRARY__ to fix build with musl]
+Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
 ---
  lib/long-options.c | 9 +++++++++
  1 file changed, 9 insertions(+)
@@ -23,18 +25,12 @@ diff --git a/lib/long-options.c b/lib/long-options.c
 index 76b9796..19c84e0 100644
 --- a/lib/long-options.c
 +++ b/lib/long-options.c
-@@ -22,6 +22,15 @@
+@@ -22,6 +22,9 @@
  #endif
  
  #include <stdio.h>
 +
-+/* This needs to come after some library #include
-+   to get __GNU_LIBRARY__ defined.  */
-+#ifdef	__GNU_LIBRARY__
-+/* Don't include stdlib.h for non-GNU C libraries because some of them
-+   contain conflicting prototypes for getopt.  */
 +#include <stdlib.h>
-+#endif	/* GNU C library.  */
 +
  #include <getopt.h>
  #include "long-options.h"
-- 
2.50.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/lrzsz: fix build with musl
  2025-06-20 22:18 [Buildroot] [PATCH 1/1] package/lrzsz: fix build with musl Fiona Klute via buildroot
@ 2025-07-20 10:35 ` Julien Olivain via buildroot
  2025-07-21  9:14   ` Fiona Klute via buildroot
  2025-08-07 18:23 ` Thomas Perale via buildroot
  1 sibling, 1 reply; 5+ messages in thread
From: Julien Olivain via buildroot @ 2025-07-20 10:35 UTC (permalink / raw)
  To: Fiona Klute; +Cc: buildroot, Thomas Petazzoni

Hi Fiona,

Thanks for the patch!

On 21/06/2025 00:18, Fiona Klute via buildroot wrote:
> lib/long-options.c failed to compile with musl for the same reason
> 0002-lib-long-options.c-include-stdlib.h.patch was added to fix,
> exit() being undefined. The fix is the same as well: include stdlib.h.

Before we merge this patch, could you add a comment in the upstream
pull request linked in the patch in [1] proposing your change?

I know lrzsz is an ancient package, and this fork did not received
commits in the past years, but we never know ;)

For the record, there was an alternate proposal in:
https://patchwork.ozlabs.org/project/buildroot/patch/20250326170814.2393-1-uuidxx@163.com/
but since all the 3 libcs seems to support that, we can go with your 
proposal.

> Fixes: b6784a1f1f ("package/lrzsz: fix build with GCC >= 14.x")
> Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
> ---
> This compiles with uClibc-ng, too (without even a warning, I didn't
> test at runtime), so I'm not sure what those "non-GNU C libraries"
> where things break are. There are similar comments all over the getopt
> code, so with the age of the code maybe way outdated ones, or
> non-Linux platforms.

Finally, if you want to runtime test, there a simple runtime test:
https://gitlab.com/buildroot.org/buildroot/-/blob/master/support/testing/tests/package/test_lrzsz.py
the long-opt will be a bit tested with the --help.

>  .../0002-lib-long-options.c-include-stdlib.h.patch     | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git 
> a/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch 
> b/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch
> index 6229114e0a..f0532bd036 100644
> --- a/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch
> +++ b/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch
> @@ -15,6 +15,8 @@ long-options.c:70:11: error: implicit declaration of 
> function ‘exit’
> 
>  Upstream: https://github.com/UweOhse/lrzsz/pull/4
>  Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> +[Fiona: remove conditional on __GNU_LIBRARY__ to fix build with musl]
> +Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
>  ---
>   lib/long-options.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> @@ -23,18 +25,12 @@ diff --git a/lib/long-options.c 
> b/lib/long-options.c
>  index 76b9796..19c84e0 100644
>  --- a/lib/long-options.c
>  +++ b/lib/long-options.c
> -@@ -22,6 +22,15 @@
> +@@ -22,6 +22,9 @@
>   #endif
> 
>   #include <stdio.h>
>  +
> -+/* This needs to come after some library #include
> -+   to get __GNU_LIBRARY__ defined.  */
> -+#ifdef	__GNU_LIBRARY__
> -+/* Don't include stdlib.h for non-GNU C libraries because some of 
> them
> -+   contain conflicting prototypes for getopt.  */
>  +#include <stdlib.h>
> -+#endif	/* GNU C library.  */
>  +
>   #include <getopt.h>
>   #include "long-options.h"
> --
> 2.50.0

Best regards,

Julien.

[1] https://github.com/UweOhse/lrzsz/pull/4
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/lrzsz: fix build with musl
  2025-07-20 10:35 ` Julien Olivain via buildroot
@ 2025-07-21  9:14   ` Fiona Klute via buildroot
  2025-07-22 17:20     ` Julien Olivain via buildroot
  0 siblings, 1 reply; 5+ messages in thread
From: Fiona Klute via buildroot @ 2025-07-21  9:14 UTC (permalink / raw)
  To: Julien Olivain; +Cc: buildroot, Thomas Petazzoni

Hi Julien,

thanks for the review!

Am 20.07.25 um 13:35 schrieb Julien Olivain:
> On 21/06/2025 00:18, Fiona Klute via buildroot wrote:
>> lib/long-options.c failed to compile with musl for the same reason
>> 0002-lib-long-options.c-include-stdlib.h.patch was added to fix,
>> exit() being undefined. The fix is the same as well: include stdlib.h.
> 
> Before we merge this patch, could you add a comment in the upstream
> pull request linked in the patch in [1] proposing your change?
> 
> I know lrzsz is an ancient package, and this fork did not received
> commits in the past years, but we never know ;)

Sure, I've just done that:
https://github.com/UweOhse/lrzsz/pull/4#issuecomment-3095797981

> For the record, there was an alternate proposal in:
> https://patchwork.ozlabs.org/project/buildroot/ 
> patch/20250326170814.2393-1-uuidxx@163.com/
> but since all the 3 libcs seems to support that, we can go with your 
> proposal.
> 
>> Fixes: b6784a1f1f ("package/lrzsz: fix build with GCC >= 14.x")
>> Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
>> ---
>> This compiles with uClibc-ng, too (without even a warning, I didn't
>> test at runtime), so I'm not sure what those "non-GNU C libraries"
>> where things break are. There are similar comments all over the getopt
>> code, so with the age of the code maybe way outdated ones, or
>> non-Linux platforms.
> 
> Finally, if you want to runtime test, there a simple runtime test:
> https://gitlab.com/buildroot.org/buildroot/-/blob/master/support/ 
> testing/tests/package/test_lrzsz.py
> the long-opt will be a bit tested with the --help.

That test currently uses only a glibc build config. Do you mean I could 
modify it locally to test with uClibc, or that I should add test 
variants with musl and uClibc? The latter would certainly be good for 
reliability, but also add a lot of build time to the tests (that's why 
I'm hesitating).

Best regards,
Fiona

>>  .../0002-lib-long-options.c-include-stdlib.h.patch     | 10 +++-------
>>  1 file changed, 3 insertions(+), 7 deletions(-)
>>
>> diff --git a/package/lrzsz/0002-lib-long-options.c-include- 
>> stdlib.h.patch b/package/lrzsz/0002-lib-long-options.c-include- 
>> stdlib.h.patch
>> index 6229114e0a..f0532bd036 100644
>> --- a/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch
>> +++ b/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch
>> @@ -15,6 +15,8 @@ long-options.c:70:11: error: implicit declaration of 
>> function ‘exit’
>>
>>  Upstream: https://github.com/UweOhse/lrzsz/pull/4
>>  Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
>> +[Fiona: remove conditional on __GNU_LIBRARY__ to fix build with musl]
>> +Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
>>  ---
>>   lib/long-options.c | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>> @@ -23,18 +25,12 @@ diff --git a/lib/long-options.c b/lib/long-options.c
>>  index 76b9796..19c84e0 100644
>>  --- a/lib/long-options.c
>>  +++ b/lib/long-options.c
>> -@@ -22,6 +22,15 @@
>> +@@ -22,6 +22,9 @@
>>   #endif
>>
>>   #include <stdio.h>
>>  +
>> -+/* This needs to come after some library #include
>> -+   to get __GNU_LIBRARY__ defined.  */
>> -+#ifdef    __GNU_LIBRARY__
>> -+/* Don't include stdlib.h for non-GNU C libraries because some of them
>> -+   contain conflicting prototypes for getopt.  */
>>  +#include <stdlib.h>
>> -+#endif    /* GNU C library.  */
>>  +
>>   #include <getopt.h>
>>   #include "long-options.h"
>> -- 
>> 2.50.0
> 
> Best regards,
> 
> Julien.
> 
> [1] https://github.com/UweOhse/lrzsz/pull/4


_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/lrzsz: fix build with musl
  2025-07-21  9:14   ` Fiona Klute via buildroot
@ 2025-07-22 17:20     ` Julien Olivain via buildroot
  0 siblings, 0 replies; 5+ messages in thread
From: Julien Olivain via buildroot @ 2025-07-22 17:20 UTC (permalink / raw)
  To: Fiona Klute; +Cc: buildroot, Thomas Petazzoni

Hi Fiona,

On 21/07/2025 11:14, Fiona Klute wrote:
> Hi Julien,
> 
> thanks for the review!
> 
> Am 20.07.25 um 13:35 schrieb Julien Olivain:
>> On 21/06/2025 00:18, Fiona Klute via buildroot wrote:
>>> lib/long-options.c failed to compile with musl for the same reason
>>> 0002-lib-long-options.c-include-stdlib.h.patch was added to fix,
>>> exit() being undefined. The fix is the same as well: include 
>>> stdlib.h.
>> 
>> Before we merge this patch, could you add a comment in the upstream
>> pull request linked in the patch in [1] proposing your change?
>> 
>> I know lrzsz is an ancient package, and this fork did not received
>> commits in the past years, but we never know ;)
> 
> Sure, I've just done that:
> https://github.com/UweOhse/lrzsz/pull/4#issuecomment-3095797981

With that, I applied to master, thanks.

>> For the record, there was an alternate proposal in:
>> https://patchwork.ozlabs.org/project/buildroot/ 
>> patch/20250326170814.2393-1-uuidxx@163.com/
>> but since all the 3 libcs seems to support that, we can go with your 
>> proposal.
>> 
>>> Fixes: b6784a1f1f ("package/lrzsz: fix build with GCC >= 14.x")
>>> Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
>>> ---
>>> This compiles with uClibc-ng, too (without even a warning, I didn't
>>> test at runtime), so I'm not sure what those "non-GNU C libraries"
>>> where things break are. There are similar comments all over the 
>>> getopt
>>> code, so with the age of the code maybe way outdated ones, or
>>> non-Linux platforms.
>> 
>> Finally, if you want to runtime test, there a simple runtime test:
>> https://gitlab.com/buildroot.org/buildroot/-/blob/master/support/ 
>> testing/tests/package/test_lrzsz.py
>> the long-opt will be a bit tested with the --help.
> 
> That test currently uses only a glibc build config. Do you mean I could 
> modify it locally to test with uClibc, or that I should add test 
> variants with musl and uClibc? The latter would certainly be good for 
> reliability, but also add a lot of build time to the tests (that's why 
> I'm hesitating).

I meant to modify the test locally, or sneak the to command sequence to 
quickly
reproduce those in a qemu build with the right config.

I agree that lrzsz does not really need more testing (one is already 
enough).
Autobuilders will cover the rest...

> Best regards,
> Fiona

Best regards,

Julien.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/lrzsz: fix build with musl
  2025-06-20 22:18 [Buildroot] [PATCH 1/1] package/lrzsz: fix build with musl Fiona Klute via buildroot
  2025-07-20 10:35 ` Julien Olivain via buildroot
@ 2025-08-07 18:23 ` Thomas Perale via buildroot
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Perale via buildroot @ 2025-08-07 18:23 UTC (permalink / raw)
  To: Fiona Klute; +Cc: Thomas Perale, buildroot

In reply of:
> lib/long-options.c failed to compile with musl for the same reason
> 0002-lib-long-options.c-include-stdlib.h.patch was added to fix,
> exit() being undefined. The fix is the same as well: include stdlib.h.
> 
> Fixes: b6784a1f1f ("package/lrzsz: fix build with GCC >= 14.x")
> Signed-off-by: Fiona Klute <fiona.klute@gmx.de>

Applied to 2025.02.x & 2025.05.x. Thanks

> ---
> This compiles with uClibc-ng, too (without even a warning, I didn't
> test at runtime), so I'm not sure what those "non-GNU C libraries"
> where things break are. There are similar comments all over the getopt
> code, so with the age of the code maybe way outdated ones, or
> non-Linux platforms.
> 
>  .../0002-lib-long-options.c-include-stdlib.h.patch     | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch b/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch
> index 6229114e0a..f0532bd036 100644
> --- a/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch
> +++ b/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch
> @@ -15,6 +15,8 @@ long-options.c:70:11: error: implicit declaration of function ‘exit’
>  
>  Upstream: https://github.com/UweOhse/lrzsz/pull/4
>  Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> +[Fiona: remove conditional on __GNU_LIBRARY__ to fix build with musl]
> +Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
>  ---
>   lib/long-options.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> @@ -23,18 +25,12 @@ diff --git a/lib/long-options.c b/lib/long-options.c
>  index 76b9796..19c84e0 100644
>  --- a/lib/long-options.c
>  +++ b/lib/long-options.c
> -@@ -22,6 +22,15 @@
> +@@ -22,6 +22,9 @@
>   #endif
>   
>   #include <stdio.h>
>  +
> -+/* This needs to come after some library #include
> -+   to get __GNU_LIBRARY__ defined.  */
> -+#ifdef	__GNU_LIBRARY__
> -+/* Don't include stdlib.h for non-GNU C libraries because some of them
> -+   contain conflicting prototypes for getopt.  */
>  +#include <stdlib.h>
> -+#endif	/* GNU C library.  */
>  +
>   #include <getopt.h>
>   #include "long-options.h"
> -- 
> 2.50.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2025-08-07 18:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-20 22:18 [Buildroot] [PATCH 1/1] package/lrzsz: fix build with musl Fiona Klute via buildroot
2025-07-20 10:35 ` Julien Olivain via buildroot
2025-07-21  9:14   ` Fiona Klute via buildroot
2025-07-22 17:20     ` Julien Olivain via buildroot
2025-08-07 18:23 ` Thomas Perale via buildroot

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.