* [Buildroot] [git commit] package/apr: fix build failure with autoconf 2.73
@ 2026-07-02 18:31 Fiona Klute via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Fiona Klute via buildroot @ 2026-07-02 18:31 UTC (permalink / raw)
To: buildroot
commit: https://gitlab.com/buildroot.org/buildroot/-/commit/3d06661fc1bf0f88356981a44cb93b7b0c76a669
branch: https://gitlab.com/buildroot.org/buildroot/-/tree/master
Since the bump of autoconf to version 2.73 in commit a6e8c07a330a,
the TestApache test fails on CI runners (and in autobuilders [2]) with
our current docker image (GCC 12.2.0) :
gcc: error: unrecognized command-line option '-std=gnu23'; did you mean '-std=gnu2x'?
make[3]: *** [Makefile:136: tools/gen_test_char] Error 1
Autoconf 2.73 introduced checks for the C23 standard [1]. During the
configuration step, it tests the target compiler. If the target compiler
supports it (e.g., GCC 14+), autoconf caches `ac_cv_prog_cc_c23=yes`
and appends `-std=gnu23` to the compiler flags.
Later in the process, APR uses the `AX_PROG_CC_FOR_BUILD` macro to
configure the host compiler in order to build the `gen_test_char`
utility. However, APR's `ax_prog_cc_for_build.m4` macro uses a
pushdef/popdef mechanism that only isolates older C standards.
It fails to isolate the newly introduced `ac_cv_prog_cc_c23` variable
because the ax_prog_cc_for_build.m4 file was not updated to handle it.
As a result, the host compiler evaluation reads the target's cached
variables, assumes the host compiler also supports C23 (which it may not),
and attempts to use `-std=gnu23`. If the host compiler
(e.g., GCC 12 on GitLab CI) is older, the build crashes.
To fix this without heavily patching APR's m4 macros, we explicitly
disable the C23 standard detection for the host compiler in APR_CONF_ENV
when GCC<14. Since APR is a mature project that does not require C23
features, preventing its use here is a safe and robust workaround.
Doing so will not disable C23 for the target build if the target compiler
is GCC 14+; it will only prevent the host compiler from using it when
building APR's tools; according to the build logs, ac_cv_prog_cc_c23
will be set to "no" for the target compiler if it does not support C23,
and will be set to "-std=gnu23" if it does.
It's important to note that this error could also occur with other
packages that use autotools-package if "AUTORECONF" is set to "yes".
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/15112315884
[1] https://gcc.gnu.org/cgit/gcc/commit/?id=fad61bf73b3158157a136bf4d9373fc3d9afe319
[2] https://autobuild.buildroot.org/results/d7d/d7d2703e42034d9c11de89b2b3b6cf401f677aa3
Signed-off-by: Dowan Gullient <dowan.gullient@smile.fr>
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
---
package/apr/apr.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/package/apr/apr.mk b/package/apr/apr.mk
index 1c7553a501..e8cf0f309e 100644
--- a/package/apr/apr.mk
+++ b/package/apr/apr.mk
@@ -34,6 +34,7 @@ APR_CONF_ENV = \
ac_cv_mmap__dev_zero=yes \
ac_cv_func_setpgrp_void=yes \
apr_cv_process_shared_works=yes \
+ ac_cv_prog_cc_c23=$(if $(BR2_HOST_GCC_AT_LEAST_14),yes,no) \
apr_cv_mutex_robust_shared=no \
apr_cv_tcp_nodelay_with_cork=yes \
ac_cv_sizeof_struct_iovec=8 \
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-03 15:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260702183149.A6094881F2__19928.5095486388$1783017157$gmane$org@busybox.osuosl.org>
2026-07-03 15:37 ` [Buildroot] [git commit] package/apr: fix build failure with autoconf 2.73 Bernd Kuhls
2026-07-02 18:31 Fiona Klute via buildroot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.