From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/vorbis-tools: fix build with GCC 15
Date: Tue, 1 Sep 2026 23:30:38 +0200 [thread overview]
Message-ID: <apdDnBBsMKgfUAac@windsurf> (raw)
In-Reply-To: <20260817155413.2644351-1-chakrabortyshubham66@gmail.com>
On Mon, Aug 17, 2026 at 09:24:11PM +0530, Shubham Chakraborty wrote:
> vorbis-tools fails to build with GCC 15 because its bundled legacy
> getopt implementation uses unprototyped K&R C function declarations
> (such as `extern char *getenv();`). GCC 15 defaults to -std=gnu23
> (C23), where unprototyped functions are strictly treated as (void),
> causing compilation to fail with:
>
> getopt.c:399:21: error: too many arguments to function 'getenv'; expected 0, have 1
>
> Fix this by preserving Buildroot's TARGET_CFLAGS and appending -std=gnu17
> for toolchains that support it (GCC >= 8).
>
> Tested with `./utils/test-pkg -p vorbis-tools -a`:
> 32 builds, 0 skipped, 0 build failed, 0 legal-info failed, 0 show-info failed
>
> Fixes:
> - https://autobuild.buildroot.org/results/dda/dda9e20f43368898b913bf2b00a8491ba089643f/
>
> Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
The problem only seems to occur with musl, not glibc. Why? This means
it's not just a GCC version issue.
Also, can we actually fix the issues? It seems like it's just 2
prototypes that are wrong.
But even for musl, why is it trying to use its own version of getenv()
and getopt()? musl is providing those features.
So I don't doubt that passing -std=gnu17 papers over the problem, but
the analysis is a bit weak, and the proposed solution not quite up to
the quality standard that we expect.
Could you research this a bit more?
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
prev parent reply other threads:[~2026-09-01 21:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 15:54 [Buildroot] [PATCH] package/vorbis-tools: fix build with GCC 15 Shubham Chakraborty
2026-09-01 21:30 ` Thomas Petazzoni via buildroot [this message]
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=apdDnBBsMKgfUAac@windsurf \
--to=buildroot@buildroot.org \
--cc=chakrabortyshubham66@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
/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 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.