[Buildroot] [PATCH v2] package/szip: 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 szip. To avoid carrying intrusive
patches that rewrite legacy K&R-style declarations, pass -std=gnu89
to CFLAGS to restore the older compiler behavior.

This fixes identical build failures across multiple toolchain configurations,
including both static and dynamic builds across all libc implementations
(musl, glibc, uClibc).

Fixes:
 - http://autobuild.buildroot.net/results/63f/63f9317b194fd20118c9107c6ac0531bbc990023
 - http://autobuild.buildroot.net/results/257/25798dd0612a2fefaf6ab2865964b87604831e31
 - http://autobuild.buildroot.net/results/88f/88f7df044908fdad5b629303c7e8c324754336ff

Signed-off-by: Shubham Chakraborty <[email protected]>
---
Changes v1 -> v2:
  - Dropped intrusive C source patches and instead fixed the issue
    by appending -std=gnu89 to CFLAGS (Thomas).
  - Explicitly verified and noted that this fixes the GCC 15 K&R C issues
    across multiple toolchains (both static and dynamic across musl, glibc, uClibc).
  - Added Fixes tags pointing to multiple autobuilder failures.
  - Successfully tested across 32 toolchains using test-pkg.

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

diff --git a/package/szip/szip.mk b/package/szip/szip.mk
index 869fc9c358..8b18196841 100644
--- a/package/szip/szip.mk
+++ b/package/szip/szip.mk
@@ -10,4 +10,8 @@ SZIP_LICENSE = szip license
 SZIP_LICENSE_FILES = COPYING
 SZIP_INSTALL_STAGING = YES
 
+# GCC 15 defaults to C23 which no longer allows K&R style function
+# declarations, so force it to use gnu89 standard.
+SZIP_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -std=gnu89"
+
 $(eval $(autotools-package))
-- 
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.