public inbox for buildroot@busybox.net
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/ccrypt: fix getopt_long check for cross-compilation
@ 2026-03-08 18:20 Shubham Chakraborty
  2026-03-08 18:20 ` [Buildroot] [PATCH 2/2] DEVELOPERS: add Shubham Chakraborty for ccrypt Shubham Chakraborty
  0 siblings, 1 reply; 2+ messages in thread
From: Shubham Chakraborty @ 2026-03-08 18:20 UTC (permalink / raw)
  To: buildroot; +Cc: Shubham Chakraborty

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.

Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
---
 ...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

diff --git a/package/ccrypt/0001-fix-getopt-long-check-for-cross-compilation.patch b/package/ccrypt/0001-fix-getopt-long-check-for-cross-compilation.patch
new file mode 100644
index 0000000000..c0278ae5f8
--- /dev/null
+++ b/package/ccrypt/0001-fix-getopt-long-check-for-cross-compilation.patch
@@ -0,0 +1,30 @@
+From 12e4745fb0d4176c35b46c69ba501516dc4d1932 Mon Sep 17 00:00:00 2001
+From: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
+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 <chakrabortyshubham66@gmail.com>
+
+---
+ 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
+
diff --git a/package/ccrypt/ccrypt.mk b/package/ccrypt/ccrypt.mk
index f8d6328285..75cb97a9b0 100644
--- a/package/ccrypt/ccrypt.mk
+++ b/package/ccrypt/ccrypt.mk
@@ -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))
-- 
2.53.0

_______________________________________________
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-03-08 18:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-08 18:20 [Buildroot] [PATCH 1/2] package/ccrypt: fix getopt_long check for cross-compilation Shubham Chakraborty
2026-03-08 18:20 ` [Buildroot] [PATCH 2/2] DEVELOPERS: add Shubham Chakraborty for ccrypt Shubham Chakraborty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox