[Buildroot] [PATCH v2] package/libmpeg2: fix build with GCC 15

Shubham Chakraborty <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <[email protected]>
GCC 15 defaults to C23, which no longer supports K&R-style empty
parameter list declarations used in libmpeg2. To avoid carrying intrusive
patches that rewrite legacy K&R-style declarations, pass -std=gnu89
to CFLAGS to restore the older compiler behavior.

Fixes: http://autobuild.buildroot.net/results/53d/53daf0b4bd8b476252ca219e53a966405ece7e51

Signed-off-by: Shubham Chakraborty <[email protected]>
---
Changes v1 -> v2:
  - Dropped C source patch (0005-fix-getopt-modern-c.patch) and instead 
    fixed the issue by appending -std=gnu89 to CFLAGS.
  - Added Fixes tag pointing to the autobuilder failure.

 package/libmpeg2/libmpeg2.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/libmpeg2/libmpeg2.mk b/package/libmpeg2/libmpeg2.mk
index ec23dff57b..dd3008987e 100644
--- a/package/libmpeg2/libmpeg2.mk
+++ b/package/libmpeg2/libmpeg2.mk
@@ -16,6 +16,10 @@ LIBMPEG2_INSTALL_STAGING = YES
 LIBMPEG2_AUTORECONF = YES
 LIBMPEG2_CONF_OPTS = --without-x --disable-directx
 
+# GCC 15 defaults to C23 which no longer allows K&R style function
+# declarations, so force it to use gnu89 standard.
+LIBMPEG2_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -std=gnu89"
+
 LIBMPEG2_CPE_ID_VENDOR = videolan
 
 ifeq ($(BR2_PACKAGE_SDL),y)
-- 
2.55.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.