diff mbox series

[v2,2/2] package/libdill: fix build with gcc-15.x

Message ID 20260101231058.1726375-2-bernd@kuhls.net
State New
Headers show
Series [v2,1/2] package/libdill: autoreconf needs host-pkgconf | expand

Commit Message

Bernd Kuhls Jan. 1, 2026, 11:10 p.m. UTC
Updated project URL: https://github.com/sustrik/libdill/pull/228

Adding -std=gnu17 was recommended in upstream PR:
https://github.com/sustrik/libdill/issues/229#issuecomment-2865524080

Fixes:
https://autobuild.buildroot.net/results/1a5/1a5e9d7df6c83a921cae39b4dc4b601be4d18e36/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
v2: no changes

 package/libdill/libdill.mk | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/package/libdill/libdill.mk b/package/libdill/libdill.mk
index bea9aaeecb..453031a471 100644
--- a/package/libdill/libdill.mk
+++ b/package/libdill/libdill.mk
@@ -13,6 +13,13 @@  LIBDILL_INSTALL_STAGING = YES
 LIBDILL_DEPENDENCIES = host-pkgconf
 LIBDILL_AUTORECONF = YES
 
+# gcc-15 defaults to -std=gnu23 which introduces build failures.
+# We force "-std=gnu17" for gcc version supporting it. Earlier gcc
+# versions will work, since they are using the older standard.
+ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_8),y)
+LIBDILL_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -std=gnu17"
+endif
+
 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
 LIBDILL_CONF_OPTS += --enable-threads
 else