package/ccrypt: fix getopt_long check for cross-compilation
PATCH 1/2 package/ccrypt: fix getopt_long check for cross-compilation
When cross-compiling, the AC_RUN_IFELSE check for getopt_long argument reordering in configure.ac fails and defaults to "no". This forces the build to use a stale bundled version of GNU getopt from the late 90s.
This bundled code conflicts with modern C standards (C23/GCC 15):
- The bundled getopt.h declares getopt() with empty parentheses, which modern compilers interpret as (void). This conflicts with the 3-arg prototype in system headers like musl's unistd.h.
- The bundled getopt.c declares getenv() with zero arguments but calls it with a string, causing a compiler error.
Since all toolchains supported by Buildroot provide a working getopt_long, default to have_getopt_long=yes when cross-compiling.
Set CCRYPT_AUTORECONF = YES to apply the changes to configure.ac.
--- ...opt-long-check-for-cross-compilation.patch | 30 +++++++++++++++++++ package/ccrypt/ccrypt.mk | 1 + 2 files changed, 31 insertions(+) create mode 100644 package/ccrypt/0001-fix-getopt-long-check-for-cross-compilation.patch
package/ccrypt/0001-fix-getopt-long-check-for-cross-compilation.patch new file +30 -0
@@ -0,0 +1,30 @@ +From 12e4745fb0d4176c35b46c69ba501516dc4d1932 Mon Sep 17 00:00:00 2001 +From: Shubham Chakraborty <[email protected]> +Date: Sun, 8 Mar 2026 23:24:00 +0530 +Subject: [PATCH] Fix getopt_long check for cross-compilation + +Upstream: Not submitted (bundled getopt is very old, probably better to fix in ccrypt) +Signed-off-by: Shubham Chakraborty <[email protected]> + +--- + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 56d11f1..f4f8f00 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -115,8 +115,8 @@ if test "$have_getopt_long" = "yes"; then + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + have_getopt_long=no], +- [AC_MSG_RESULT(maybe (cross-compiling)) +- have_getopt_long=no]) ++ [AC_MSG_RESULT(yes (cross-compiling)) ++ have_getopt_long=yes]) + fi + + AC_ARG_WITH(included-getopt, +-- +2.53.0 +
package/ccrypt/ccrypt.mk +1 -0
@@ -9,5 +9,6 @@ CCRYPT_SITE = http://ccrypt.sourceforge.net/download/$(CCRYPT_VERSION) CCRYPT_LICENSE = GPL-2.0+ CCRYPT_LICENSE_FILES = COPYING +CCRYPT_AUTORECONF = YES $(eval $(autotools-package))
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 2/2 DEVELOPERS: add Shubham Chakraborty for ccrypt
--- DEVELOPERS | 3 +++ 1 file changed, 3 insertions(+)
DEVELOPERS +3 -0
@@ -3059,6 +3059,9 @@ F: package/tunctl/ F: package/ubus/ F: package/wolfssl/ +N: Shubham Chakraborty <[email protected]> +F: package/ccrypt/ + N: Simon Dawson <[email protected]> F: boot/at91bootstrap3/ F: package/cppzmq/
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot