URL: <https://savannah.gnu.org/support/?111401>
Summary: autoconf 2.73 -std=gnu23 spilling from CC into
CC_FOR_BUILD
Group: Autoconf
Submitter: khem
Submitted: Thu 09 Apr 2026 04:54:40 AM UTC
Priority: 5 - Unprioritized
Severity: 3 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Unlocked
Operating System: GNU/Linux
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Thu 09 Apr 2026 04:54:40 AM UTC By: Khem Raj <khem>
I have cross-compilation scenario using Openembedded/yocto cross compiling
flex.
Cross-compiler = clang-22
host compiler = gcc-13
flex is autoreconfigured, it builds stage1flex tool, stage1flex is built
during the first/native stage of a flex therefore it uses host compiler but
main flex is then cross-compiled using cross compiler.
Newly generated configure tries to see if CC has C23 turned on by default and
rightly finds that clang does not ( it defaults to gnu17 ) therefore adds
-std=gnu23 to CC, so far so good. It then uses the detected cached value when
poking CC_FOR_BUILD, in here it thinks, oh I have already performed this check
so bails out and unconditionally appends -std=gnu23 to CC_FOR_BUILD, however
CC_FOR_BUILD here is GCC-13 and it does not have gnu23 as dialect selection
using -std= and the build fails
| gcc: error: unrecognized command-line option ‘-std=gnu23’; did you mean
‘-std=gnu2x’?
| gcc: error: unrecognized command-line option ‘-std=gnu23’; did you mean
‘-std=gnu2x’?
| gcc: error: unrecognized command-line option ‘-std=gnu23’; did you mean
‘-std=gnu2x’?
I tried to fix it, but the patch did not work. My workaround currently is to
pass ac_cv_prog_cc_stdc=no to configure invocation but thats a hack IMO. I
think lib/autoconf/c.m4 should consider this case where CC and CC_FOR_BUILD
can be different compilers. This issue can also happen with a version of gcc
e.g. gcc-14 as cross-compiler and gcc-13 or older as native host compiler.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/support/?111401>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
