Skip to content

Commit ba76da4

Browse files
mcpratPolynomialDivision
authored andcommitted
tools: gnulib: do not cache C standard option test results
After eliminating the possibility of automake having a bug by testing a revert to the recent updates to automake, the problems regarding autoreconf with some packages was bisected to the gnulib update instead, through aclocal macros. With the new module, std-gnu23, some packages are failing build due to both the host compiler and cross compiler being tested for availability of C23 standard features with the configure script. The results of one is being cached and used for the other, while the two compilers are different versions and may or may not both support C23 options and would otherwise have conflicting results. A similar patch may have to be done for the next release of Autoconf if upstream GNU does not accept this solution. Reported-by: Georgi Valkov <[email protected]> Signed-off-by: Michael Pratt <[email protected]> Link: openwrt/openwrt#19627 Signed-off-by: Nick Hainke <[email protected]>
1 parent 287f1ea commit ba76da4

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
--- a/m4/std-gnu11.m4
2+
+++ b/m4/std-gnu11.m4
3+
@@ -185,8 +185,7 @@ AC_LANG_POP(C++)dnl
4+
# else ACTION-IF-UNAVAILABLE.
5+
AC_DEFUN([_AC_C_STD_TRY],
6+
[AC_MSG_CHECKING([for $CC option to enable ]m4_translit($1, [c], [C])[ features])
7+
-AC_CACHE_VAL(ac_cv_prog_cc_$1,
8+
-[ac_cv_prog_cc_$1=no
9+
+ac_cv_prog_cc_$1=no
10+
ac_save_CC=$CC
11+
AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])])
12+
for ac_arg in '' $4
13+
@@ -197,7 +196,6 @@ do
14+
done
15+
rm -f conftest.$ac_ext
16+
CC=$ac_save_CC
17+
-])# AC_CACHE_VAL
18+
ac_prog_cc_stdc_options=
19+
case "x$ac_cv_prog_cc_$1" in
20+
x)
21+
@@ -523,8 +521,7 @@ fi
22+
AC_DEFUN([_AC_CXX_STD_TRY],
23+
[AC_MSG_CHECKING([for $CXX option to enable ]m4_translit(m4_translit($1, [x], [+]), [a-z], [A-Z])[ features])
24+
AC_LANG_PUSH(C++)dnl
25+
-AC_CACHE_VAL(ac_cv_prog_cxx_$1,
26+
-[ac_cv_prog_cxx_$1=no
27+
+ac_cv_prog_cxx_$1=no
28+
ac_save_CXX=$CXX
29+
AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])])
30+
for ac_arg in '' $4
31+
@@ -535,7 +532,6 @@ do
32+
done
33+
rm -f conftest.$ac_ext
34+
CXX=$ac_save_CXX
35+
-])# AC_CACHE_VAL
36+
ac_prog_cxx_stdcxx_options=
37+
case "x$ac_cv_prog_cxx_$1" in
38+
x)
39+
--- a/m4/std-gnu23.m4
40+
+++ b/m4/std-gnu23.m4
41+
@@ -696,8 +696,7 @@ AC_DEFUN([_AC_PROG_CC_STDC_EDITION_TRY],
42+
[AC_REQUIRE([_AC_C_C$1_TEST_PROGRAM])]dnl
43+
[AS_IF([test x$ac_prog_cc_stdc = xno],
44+
[AC_MSG_CHECKING([for $CC option to enable C$1 features])
45+
-AC_CACHE_VAL([ac_cv_prog_cc_c$1],
46+
-[ac_cv_prog_cc_c$1=no
47+
+ac_cv_prog_cc_c$1=no
48+
ac_save_CC=$CC
49+
AC_LANG_CONFTEST([AC_LANG_DEFINES_PROVIDED][$][ac_c_conftest_c$1_program])
50+
for ac_arg in '' m4_normalize(m4_defn([_AC_C_C$1_OPTIONS]))
51+
@@ -707,7 +706,7 @@ do
52+
test "x$ac_cv_prog_cc_c$1" != "xno" && break
53+
done
54+
rm -f conftest.$ac_ext
55+
-CC=$ac_save_CC])
56+
+CC=$ac_save_CC
57+
AS_IF([test "x$ac_cv_prog_cc_c$1" = xno],
58+
[AC_MSG_RESULT([unsupported])],
59+
[AS_IF([test "x$ac_cv_prog_cc_c$1" = x],

0 commit comments

Comments
 (0)