From 999fb19d4b09c9ced3425668b7c3a12a9dd88b87 Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Tue, 13 May 2025 22:04:57 +0200 Subject: [PATCH] package/unixodbc: fix build with gcc-15.x Inspired by https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-db/unixODBC?id=b5629b3aefd8633d378beea7e955d66ce709bebe Signed-off-by: Bernd Kuhls Signed-off-by: Julien Olivain --- package/unixodbc/unixodbc.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/unixodbc/unixodbc.mk b/package/unixodbc/unixodbc.mk index 28f1e5bc94..302b964a44 100644 --- a/package/unixodbc/unixodbc.mk +++ b/package/unixodbc/unixodbc.mk @@ -12,6 +12,12 @@ UNIXODBC_LICENSE = LGPL-2.1+ (library), GPL-2.0+ (programs) UNIXODBC_LICENSE_FILES = COPYING exe/COPYING UNIXODBC_CPE_ID_VENDOR = unixodbc +# 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) +UNIXODBC_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -std=gnu17" +endif UNIXODBC_CONF_OPTS = --enable-drivers --enable-driver-conf ifeq ($(BR2_PACKAGE_LIBEDIT),y)