From patchwork Sun Sep 15 13:27:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1985861 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X68460g9zz1y1C for ; Sun, 15 Sep 2024 23:27:49 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 64EFE811BE; Sun, 15 Sep 2024 13:27:48 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id WkoKbHgp5fQm; Sun, 15 Sep 2024 13:27:46 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 5D20481186 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 5D20481186; Sun, 15 Sep 2024 13:27:46 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 2BDA91BF283 for ; Sun, 15 Sep 2024 13:27:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 1B13D40135 for ; Sun, 15 Sep 2024 13:27:44 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5myc5hfT544b for ; Sun, 15 Sep 2024 13:27:42 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2001:4b98:dc4:8::225; helo=relay5-d.mail.gandi.net; envelope-from=thomas.petazzoni@bootlin.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 31088400F9 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 31088400F9 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by smtp2.osuosl.org (Postfix) with ESMTPS id 31088400F9 for ; Sun, 15 Sep 2024 13:27:41 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPA id C212B1C0002; Sun, 15 Sep 2024 13:27:38 +0000 (UTC) To: buildroot@buildroot.org Date: Sun, 15 Sep 2024 15:27:34 +0200 Message-ID: <20240915132735.862622-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-GND-Sasl: thomas.petazzoni@bootlin.com X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1726406859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X8TpP/XpTxFZVvTBR0J1JWWN4tJJUvwFs024aRjH8mQ=; b=kUReRF9EuDtVyxrA++io+t8DEQcz64sHK4lgQpOpSlEVNg9Jv2pxV+lAI3lOIUtIQ8OSB2 pR/iKXA6XksqJ4uiYGl7gv6a4JUmbAUiFbjFfYYl69XqZn+AoKG8KBS3m0wUzDTBUWadC1 Uvi42yi4QwDHke5MvN7aQ3XhrN+Zg9xHCTqHcAr4mzbCycdrA96Ewu6O9a4bRRnkdsj1Hr ukPzTjJCaeswmbHB8GS9h6DrZ803GRjsgojWTpVlgAmbQUbGc1LkFf0oOzBovH1O+l0MD2 Wwhi03aBKsP6iMQiHv2wfMI4/xS9sDKd1EKfqR3ai+s51eSPn5Tf80xZXCmrlw== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=gm1 header.b=kUReRF9E Subject: [Buildroot] [PATCH] package/lrzsz: fix build with GCC >= 14.x X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Thomas Petazzoni via buildroot From: Thomas Petazzoni Reply-To: Thomas Petazzoni Cc: Fabrice Fontaine , Thomas Petazzoni Errors-To: buildroot-bounces@buildroot.org Sender: "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/20240726092042.1273023-1-fontaine.fabrice@gmail.com/ [2] https://github.com/UweOhse/lrzsz Fixes: http://autobuild.buildroot.net/results/3eb94eac3e0e1a04d41c618ed9ea2e4e398ea48a/ Signed-off-by: Thomas Petazzoni --- .../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 diff --git a/package/lrzsz/0001-configure-fix-main-prototype.patch b/package/lrzsz/0001-configure-fix-main-prototype.patch new file mode 100644 index 0000000000..46b7aade00 --- /dev/null +++ b/package/lrzsz/0001-configure-fix-main-prototype.patch @@ -0,0 +1,32 @@ +From 43b2b711fedd3a28d497b3a5c0e9054fa203ef3d Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +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 +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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + ac_cv_prog_cc_works=yes +-- +2.46.0 + 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 new file mode 100644 index 0000000000..6229114e0a --- /dev/null +++ b/package/lrzsz/0002-lib-long-options.c-include-stdlib.h.patch @@ -0,0 +1,44 @@ +From aa6779c2846f13bf58575486b374ef06b2844fe8 Mon Sep 17 00:00:00 2001 +From: Yegor Yefremov +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 +--- + 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 ++ ++/* 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 ++#endif /* GNU C library. */ ++ + #include + #include "long-options.h" + +-- +2.46.0 + diff --git a/package/lrzsz/0003-include-stdio.h-to-remove-warning.patch b/package/lrzsz/0003-include-stdio.h-to-remove-warning.patch new file mode 100644 index 0000000000..e4a958cdfa --- /dev/null +++ b/package/lrzsz/0003-include-stdio.h-to-remove-warning.patch @@ -0,0 +1,26 @@ +From e164c9cd3207321e162f054357fcd37b06cb0b8a Mon Sep 17 00:00:00 2001 +From: Uwe Ohse +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 +--- + 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 + #include + #include ++#include + #endif + + #if __STDC__ +-- +2.46.0 +