Bug 2132715 - Typo in /usr/share/autoconf/autoconf/c.m4 causes broken test
Summary: Typo in /usr/share/autoconf/autoconf/c.m4 causes broken test
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: autoconf
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
Assignee: Frédéric Bérat
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-10-06 13:02 UTC by Mattias Ellert
Modified: 2022-11-10 22:20 UTC (History)
8 users (show)

Fixed In Version: autoconf-2.71-3.fc36 autoconf-2.71-4.fc37 autoconf-2.71-4.fc38
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-10-26 17:27:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Mattias Ellert 2022-10-06 13:02:27 UTC
Description of problem:

/usr/share/autoconf/autoconf/c.m4 lines 2747-2772 read:

AC_DEFUN([_AC_PROG_CXX_STDCXX_EDITION_TRY],
[AC_LANG_ASSERT([C++])]dnl
[AC_REQUIRE([_AC_CXX_CXX$1_TEST_PROGRAM])]dnl
[AS_IF([test x$ac_prog_cxx_stdcxx = xno],
[AC_MSG_CHECKING([for $CXX option to enable C++$1 features])
AC_CACHE_VAL(ac_cv_prog_cxx_$1,
[ac_cv_prog_cxx_$1=no
ac_save_CXX=$CXX
AC_LANG_CONFTEST([AC_LANG_DEFINES_PROVIDED][$][ac_cxx_conftest_cxx$1_program])
for ac_arg in '' m4_normalize(m4_defn([_AC_CXX_CXX$1_OPTIONS]))
do
  CXX="$ac_save_CXX $ac_arg"
  _AC_COMPILE_IFELSE([], [ac_cv_prog_cxx_cxx$1=$ac_arg])
  test "x$ac_cv_prog_cxx_cxx$1" != "xno" && break
done
rm -f conftest.$ac_ext
CXX=$ac_save_CXX])
AS_IF([test "x$ac_cv_prog_cxx_cxx$1" = xno],
  [AC_MSG_RESULT([unsupported])],
  [AS_IF([test "x$ac_cv_prog_cxx_cxx$1" = x],
    [AC_MSG_RESULT([none needed])],
    [AC_MSG_RESULT([$ac_cv_prog_cxx_cxx$1])
     CXX="$CXX $ac_cv_prog_cxx_cxx$1"])
  ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx$1
  ac_prog_cxx_stdcxx=cxx$1])])
])

The variable $ac_cv_prog_cxx_cxx$1 is misspelled as ac_cv_prog_cxx_$1 on the line 2752 and 2753. Those lines should read:

AC_CACHE_VAL(ac_cv_prog_cxx_cxx$1,
[ac_cv_prog_cxx_cxx$1=no

Because the variable with the correct name is not initialized the test gives the wrong result (which happens e.g. if the generated configure scripts is used on CentOS 7 / RHEL 7).

Version-Release number of selected component (if applicable):

autoconf-2.71-2.fc36.noarch

How reproducible:

Always

Steps to Reproduce:
1. Use AC_PROG_CXX in a configure.ac 
2. Run the generated configure script on Centos 7 or RHEL 7.
3. The configure scripts gives the wrong result for C++ 11 flags.

Actual results:

(when running configure script generated on Fedora 36 on CentOS 7)
checking for g++ option to enable C++11 features... none needed

Expected results:

(when running configure script generated on Fedora 36 on CentOS 7)
checking for g++ option to enable C++11 features... -std=gnu++11

Additional info:

There is a workaround: If you instead of:

AC_PROG_CXX

write:

ac_cv_prog_cxx_cxx11=no
AC_PROG_CXX

in configure.ac, i.e. if you manually initialize the variable to the correct starting value, the test works. But you should not have to do this.

Comment 2 Frédéric Bérat 2022-10-11 11:39:07 UTC
Cherry-picking this patch leads to ~200 test failures, analysis is ongoing to check if some more patches are needed on top.

Comment 3 Frédéric Bérat 2022-10-11 12:21:14 UTC
(In reply to Frédéric Bérat from comment #2)
> Cherry-picking this patch leads to ~200 test failures, analysis is ongoing
> to check if some more patches are needed on top.

Ok, my bad, the failures are not related to this patch but seem to be there from "before". Some external change seems to have broken the autoconf build since last revision. Investigation will likely take a while.

Comment 4 Fedora Update System 2022-10-18 07:49:49 UTC
FEDORA-2022-23fd451797 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-23fd451797

Comment 5 Fedora Update System 2022-10-18 10:30:14 UTC
FEDORA-2022-a107246dc3 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-a107246dc3

Comment 6 Fedora Update System 2022-10-18 12:41:22 UTC
FEDORA-2022-23fd451797 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-23fd451797`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-23fd451797

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2022-10-18 14:34:53 UTC
FEDORA-2022-a107246dc3 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-a107246dc3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-a107246dc3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2022-10-26 17:27:49 UTC
FEDORA-2022-a107246dc3 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2022-11-10 22:20:08 UTC
FEDORA-2022-23fd451797 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.