diff mbox series

[RFC] autotools: Disable autoconf C23 compiler default detection

Message ID 20260415043925.795191-1-khem.raj@oss.qualcomm.com
State New
Headers show
Series [RFC] autotools: Disable autoconf C23 compiler default detection | expand

Commit Message

Khem Raj April 15, 2026, 4:39 a.m. UTC
Autoconf 2.73 introduced detection for C23 defaults in the compiler,
adding -std=gnu23 if the compiler's default standard is older than C23.
and compiler does support C23. This causes build failures for packages
that do not yet support C23.

Clang 22.1 still defaults to C17, but the autoconf probe can
misdetect or prematurely enable C23 mode across the build system.

Disable the check globally by setting ac_cv_prog_cc_c23=no in
CACHED_CONFIGUREVARS until upstream packages have added proper C23
support.

See: https://savannah.gnu.org/support/index.php?111401

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 meta/classes-recipe/autotools.bbclass | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/autotools.bbclass b/meta/classes-recipe/autotools.bbclass
index bf58008669..7bb5c29f10 100644
--- a/meta/classes-recipe/autotools.bbclass
+++ b/meta/classes-recipe/autotools.bbclass
@@ -77,7 +77,12 @@  CONFIGUREOPTS = " --build=${BUILD_SYS} \
 		  ${CONFIGUREOPT_DEPTRACK}"
 CONFIGUREOPT_DEPTRACK ?= "--disable-dependency-tracking"

-CACHED_CONFIGUREVARS ?= ""
+# Disable autoconf-2.73 detection for C23 defaults in compiler
+# and adding -std=gnu23 if compiler's defaults are older than
+# C23, clang as of 22.1 release is still defaulting to C17
+# See - https://savannah.gnu.org/support/index.php?111401
+# Unplug it when packages have added C23 support
+CACHED_CONFIGUREVARS:append = " ac_cv_prog_cc_c23=no"

 AUTOTOOLS_SCRIPT_PATH ?= "${S}"
 CONFIGURE_SCRIPT ?= "${AUTOTOOLS_SCRIPT_PATH}/configure"