All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/lrzsz: fix build error
@ 2025-12-05 18:18 Bernd Kuhls
  2026-02-04 16:33 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Kuhls @ 2025-12-05 18:18 UTC (permalink / raw)
  To: buildroot

Fixes:
https://autobuild.buildroot.net/results/2e3/2e33c61e1c9bee099f973c1e43b696c63e5eed4b/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 package/lrzsz/0007-force-cross-compile.patch | 36 ++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 package/lrzsz/0007-force-cross-compile.patch

diff --git a/package/lrzsz/0007-force-cross-compile.patch b/package/lrzsz/0007-force-cross-compile.patch
new file mode 100644
index 0000000000..48b029208d
--- /dev/null
+++ b/package/lrzsz/0007-force-cross-compile.patch
@@ -0,0 +1,36 @@
+Fix build error
+
+xstrtol.h:11:19: error: implicit declaration of function 'strtol';
+ did you mean 'xstrtol'? [-Wimplicit-function-declaration]
+   11 | # define __strtol strtol
+
+When build host and target share the same arch the test for cross-
+compiling may fail to detect this leading to further errors which
+leads to "#undef STDC_HEADERS" being added to config.h. This in turn
+prevents "#include <stdlib.h>" in lib/xstrtol.c causing a build error.
+
+Patching configure.in is not an option because autoreconf fails and
+upstream meanwhile added heavy changes to the "whole autoconf/automake/
+libtool/gettext mess":
+https://github.com/UweOhse/lrzsz/commit/29ec4b7c2869fee3f0e8d65c42779ead11c34f07
+
+So we patch configure directly to force a cross-compiled build.
+
+Adding ac_cv_header_stdc=yes to lrzsz.mk would also fix the build error
+but masks the fact that the cross-compile environment is misdetected.
+
+Upstream: not applicable
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+
+--- a/configure	2025-12-05 19:07:42.514385175 +0100
++++ b/configure	2025-12-05 19:07:55.506624148 +0100
+@@ -1059,7 +1059,7 @@
+   ac_cv_prog_cc_works=yes
+   # If we can't run a trivial program, we are probably using a cross compiler.
+   if (./conftest; exit) 2>/dev/null; then
+-    ac_cv_prog_cc_cross=no
++    ac_cv_prog_cc_cross=yes
+   else
+     ac_cv_prog_cc_cross=yes
+   fi
-- 
2.47.3

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

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

end of thread, other threads:[~2026-02-04 16:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-05 18:18 [Buildroot] [PATCH 1/1] package/lrzsz: fix build error Bernd Kuhls
2026-02-04 16:33 ` Thomas Petazzoni 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.