public inbox for buildroot@busybox.net
 help / color / mirror / Atom feed
From: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
To: buildroot@buildroot.org
Cc: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
Subject: [Buildroot] [PATCH 1/2] package/ccrypt: fix getopt_long check for cross-compilation
Date: Sun,  8 Mar 2026 23:50:08 +0530	[thread overview]
Message-ID: <20260308182009.38009-1-chakrabortyshubham66@gmail.com> (raw)

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

             reply	other threads:[~2026-03-08 18:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-08 18:20 Shubham Chakraborty [this message]
2026-03-08 18:20 ` [Buildroot] [PATCH 2/2] DEVELOPERS: add Shubham Chakraborty for ccrypt Shubham Chakraborty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260308182009.38009-1-chakrabortyshubham66@gmail.com \
    --to=chakrabortyshubham66@gmail.com \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox