Skip to contentSkip to conversation

package/lrzsz: fix build with GCC >= 14.x

PATCH Applied Thomas Petazzoni via buildroot 2 participants 2 messages Sep 15, 2024 – Oct 25, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/lrzsz: fix build with GCC >= 14.x

The lrzsz package currently fails to build with GCC >= 14.x. In [1], Fabrice had proposed to update the package to what's available on a Github repository from the upstream maintainer at [2], but in this very repository (not updated since 4 years), the maintainer writes:

NOTE:

Do not use the repository until further notice.
It contains work in progress and at least one change i am unhappy with.

Use either http://ohse.de/uwe/testing/lrzsz-0.12.21rc.tar.gz (over 20 years in rc state, so it's good enough), or 0.12.20 from
https://ohse.de/uwe/software/lrzsz.html (do not expect me to update that old site ever again).

So, let's stick to the 0.12.20 version we have, and add a few patches.

Patch 0001 is patching the configure script, which we obviously don't normally like. However, the configure.in script is very old and no longer autoreconfs properly with modern autoconf. Since the patch is trivial, and upstream seems almost dead, we take the route of patching the configure script.

[1] https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
[2] https://github.com/UweOhse/lrzsz

Fixes:

http://autobuild.buildroot.net/results/3eb94eac3e0e1a04d41c618ed9ea2e4e398ea48a/

---
 .../0001-configure-fix-main-prototype.patch   | 32 ++++++++++++++
 ...-lib-long-options.c-include-stdlib.h.patch | 44 +++++++++++++++++++
 ...03-include-stdio.h-to-remove-warning.patch | 26 +++++++++++
 3 files changed, 102 insertions(+)
 create mode 100644 package/lrzsz/0001-configure-fix-main-prototype.patch
 create mode 100644 package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch
 create mode 100644 package/lrzsz/0003-include-stdio.h-to-remove-warning.patch
package/lrzsz/0001-configure-fix-main-prototype.patch new file +32 -0
new file mode 100644
index 0000000000..46b7aade00
@@ -0,0 +1,32 @@
+From 43b2b711fedd3a28d497b3a5c0e9054fa203ef3d Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Sun, 15 Sep 2024 15:12:07 +0200
+Subject: [PATCH] configure: fix main() prototype
+
+The pre-generated configure script has a check that doesn't work with
+GCC >= 14.x due to a partial main() prototype. Doing AUTORECONF = YES
+doesn't work as the configure.in is very old, so let's fix the
+configure script directly.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+Upstream: N/A, patching generated file
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index db26726..d160e27 100755
+--- a/configure
++++ b/configure
+@@ -1008,7 +1008,7 @@ cross_compiling=$ac_cv_prog_cc_cross
+ cat > conftest.$ac_ext <<EOF
+ #line 1010 "configure"
+ #include "confdefs.h"
+-main(){return(0);}
++int main(){return(0);}
+ EOF
+ if { (eval echo configure:1014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+   ac_cv_prog_cc_works=yes
+-- 
+2.46.0
+
package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch new file +44 -0

44 lines not on this page · raw message

package/lrzsz/0003-include-stdio.h-to-remove-warning.patch new file +26 -0
new file mode 100644
index 0000000000..e4a958cdfa
@@ -0,0 +1,26 @@
+From e164c9cd3207321e162f054357fcd37b06cb0b8a Mon Sep 17 00:00:00 2001
+From: Uwe Ohse <[email protected]>
+Date: Mon, 2 Mar 2020 22:38:16 +0000
+Subject: [PATCH] include stdio.h to remove warning
+
+Upstream: https://github.com/UweOhse/lrzsz/commit/937a2ff696fb600672eb0e8fab87f75d5e4fbc25
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ src/lsyslog.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/lsyslog.c b/src/lsyslog.c
+index 6baf4a2..d21ab35 100644
+--- a/src/lsyslog.c
++++ b/src/lsyslog.c
+@@ -24,6 +24,7 @@
+ #include <pwd.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <stdio.h>
+ #endif
+ 
+ #if __STDC__
+-- 
+2.46.0
+
Signature · 6 lines
2.46.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 27 lines · Thomas Petazzoni via buildroot

The lrzsz package currently fails to build with GCC >= 14.x. In [1], Fabrice had proposed to update the package to what's available on a Github repository from the upstream maintainer at [2], but in this very repository (not updated since 4 years), the maintainer writes:

NOTE:

Do not use the repository until further notice.
It contains work in progress and at least one change i am unhappy
with.

Use either http://ohse.de/uwe/testing/lrzsz-0.12.21rc.tar.gz (over 20 years in rc state, so it's good enough), or 0.12.20 from
https://ohse.de/uwe/software/lrzsz.html (do not expect me to update that old site ever again).

So, let's stick to the 0.12.20 version we have, and add a few patches.

Patch 0001 is patching the configure script, which we obviously don't normally like. However, the configure.in script is very old and no longer autoreconfs properly with modern autoconf. Since the patch is trivial, and upstream seems almost dead, we take the route of patching the configure script.

[1] https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
[2] https://github.com/UweOhse/lrzsz

Quoted 6 lines

Fixes:

http://autobuild.buildroot.net/results/3eb94eac3e0e1a04d41c618ed9ea2e4e398ea48a/

Applied to master, thanks.

Julien.

Quoted 138 lines
---
 .../0001-configure-fix-main-prototype.patch   | 32 ++++++++++++++
 ...-lib-long-options.c-include-stdlib.h.patch | 44 +++++++++++++++++++
 ...03-include-stdio.h-to-remove-warning.patch | 26 +++++++++++
 3 files changed, 102 insertions(+)
 create mode 100644 
package/lrzsz/0001-configure-fix-main-prototype.patch
 create mode 100644 
package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch
 create mode 100644 

package/lrzsz/0003-include-stdio.h-to-remove-warning.patch

package/lrzsz/0001-configure-fix-main-prototype.patch new file +28 -0
new file mode 100644
index 0000000000..46b7aade00
@@ -0,0 +1,32 @@
+From 43b2b711fedd3a28d497b3a5c0e9054fa203ef3d Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Sun, 15 Sep 2024 15:12:07 +0200
+Subject: [PATCH] configure: fix main() prototype
+
+The pre-generated configure script has a check that doesn't work with
+GCC >= 14.x due to a partial main() prototype. Doing AUTORECONF = YES
+doesn't work as the configure.in is very old, so let's fix the
+configure script directly.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+Upstream: N/A, patching generated file
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index db26726..d160e27 100755
+--- a/configure
++++ b/configure
+@@ -1008,7 +1008,7 @@ cross_compiling=$ac_cv_prog_cc_cross
+ cat > conftest.$ac_ext <<EOF
+ #line 1010 "configure"
+ #include "confdefs.h"
+-main(){return(0);}
++int main(){return(0);}
+ EOF
+ if { (eval echo configure:1014: \"$ac_link\") 1>&5; (eval $ac_link) 

2>&5; } && test -s conftest; then

package/lrzsz/0001-configure-fix-main-prototype.patch new file +4 -0
+   ac_cv_prog_cc_works=yes
+--
+2.46.0
+
package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch new file +34 -0
new file mode 100644
index 0000000000..6229114e0a
@@ -0,0 +1,44 @@
+From aa6779c2846f13bf58575486b374ef06b2844fe8 Mon Sep 17 00:00:00 2001
+From: Yegor Yefremov <[email protected]>
+Date: Tue, 21 May 2024 11:13:17 +0200
+Subject: [PATCH] lib/long-options.c: include stdlib.h
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes the following error (compiled with GCC 14.x):
+
+long-options.c:70:11: error: implicit declaration of function ‘exit’
+[-Wimplicit-function-declaration]
+   70 |           exit (0);
+      |           ^~~~
+
+Upstream: https://github.com/UweOhse/lrzsz/pull/4
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ lib/long-options.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+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 @@
+ #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"

package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch new file +4 -0
+
+--
+2.46.0
+
package/lrzsz/0003-include-stdio.h-to-remove-warning.patch new file +6 -0
new file mode 100644
index 0000000000..e4a958cdfa
@@ -0,0 +1,26 @@
+From e164c9cd3207321e162f054357fcd37b06cb0b8a Mon Sep 17 00:00:00 2001
+From: Uwe Ohse <[email protected]>
+Date: Mon, 2 Mar 2020 22:38:16 +0000
+Subject: [PATCH] include stdio.h to remove warning
+
+Upstream: 

https://github.com/UweOhse/lrzsz/commit/937a2ff696fb600672eb0e8fab87f75d5e4fbc25

package/lrzsz/0003-include-stdio.h-to-remove-warning.patch new file +20 -1
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ src/lsyslog.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/lsyslog.c b/src/lsyslog.c
+index 6baf4a2..d21ab35 100644
+--- a/src/lsyslog.c
++++ b/src/lsyslog.c
+@@ -24,6 +24,7 @@
+ #include <pwd.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <stdio.h>
+ #endif
+
+ #if __STDC__
+--
+2.46.0
+
--

2.46.0

Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot