From: Khem Raj Date: Thu, 9 Apr 2026 05:56:17 +0000 (-0700) Subject: flex: Keep it at C17 with clang X-Git-Tag: yocto-6.0_M3~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f9a3af45b8ec821b6cd64a3758592d4e76e7bc3;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git flex: Keep it at C17 with clang autoconf 2.73 enforces C23 and adds -std=gnu23 but it leaks it into CC_FOR_BUILD as well, which bites on systems with GCC < 14 where this option does not exist. Signed-off-by: Khem Raj Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-devtools/flex/flex_2.6.4.bb b/meta/recipes-devtools/flex/flex_2.6.4.bb index fa8c0fb6fd0..0507d4e3009 100644 --- a/meta/recipes-devtools/flex/flex_2.6.4.bb +++ b/meta/recipes-devtools/flex/flex_2.6.4.bb @@ -36,6 +36,11 @@ inherit autotools gettext texinfo ptest github-releases M4 = "${bindir}/m4" M4:class-native = "${STAGING_BINDIR_NATIVE}/m4" EXTRA_OECONF += "ac_cv_path_M4=${M4} ac_cv_func_reallocarray=no" +# Don't let autoconf smarts to detect C standard, flex code does not need C23 +# which is what it will enforce see +# https://savannah.gnu.org/support/index.php?111401 +CACHED_CONFIGUREVARS:append:toolchain-clang = " CFLAGS='${CFLAGS} -std=gnu17'" + EXTRA_OEMAKE += "m4=${STAGING_BINDIR_NATIVE}/m4" EXTRA_OEMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', 'FLEX=${STAGING_BINDIR_NATIVE}/flex', '', d)}"