[PATCH] Don't use TEST_CXX as CXX for build

Sam James sam@gentoo.org
Sun Dec 15 03:15:14 GMT 2024


"H.J. Lu" <hjl.tools@gmail.com> writes:

> Since the C++ compiler is also used to compile links-dso-program.cc in
> libsupport, use TEST_CXX to get C++ headers for testing, but don't use
> TEST_CXX as CXX for build.
>
> Tested for m68k-linux-gnu-coldfire build and native build on x86-64.
>
> Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
> ---
>  configure    | 9 +++++++--
>  configure.ac | 9 +++++++--
>  2 files changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/configure b/configure
> index 37877d5b97..2c2b19f9a6 100755
> --- a/configure
> +++ b/configure
> @@ -3910,7 +3910,7 @@ esac
>  fi
>  
>  
> -# We need the C++ compiler only for testing.
> +# We need the C++ compiler for testing and libsupport.
>  
>  
>  
> @@ -4300,6 +4300,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
>  ac_compiler_gnu=$ac_cv_c_compiler_gnu
>  
>  
> +saved_CXX="$CXX"
>  if test -z "$TEST_CXX"; then
>    TEST_CXX="$CXX"
>  else
> @@ -4378,6 +4379,7 @@ esac
>  fi
>  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cxx_link_ok" >&5
>  printf "%s\n" "$libc_cv_cxx_link_ok" >&6; }
> +CXX="$saved_CXX"
>  if test $libc_cv_cxx_link_ok != yes
>  then :
>    CXX=; TEST_CXX=
> @@ -6535,7 +6537,9 @@ fi
>  
>  # Obtain some C++ header file paths.  This is used to make a local
>  # copy of those headers in Makerules.
> -if test -n "$CXX"; then
> +if test -n "$TEST_CXX"; then
> +  saved_CXX="$CXX"
> +  CXX="$TEST_CXX"
>    find_cxx_header () {
>      echo "#include <$1>" | $CXX -H -fsyntax-only -x c++ - 2>&1 \
>  	 | $AWK '$1 == "."{print $2}'
> @@ -6543,6 +6547,7 @@ if test -n "$CXX"; then
>    CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
>    CXX_CMATH_HEADER="$(find_cxx_header cmath)"
>    CXX_BITS_STD_ABS_H="$(find_cxx_header bits/std_abs.h)"
> +  CXX="$saved_CXX"
>  fi
>  
>  
> diff --git a/configure.ac b/configure.ac
> index dca8991fbf..1de79bd729 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -73,10 +73,11 @@ AC_ARG_ENABLE([static-c++-link-check],
>  	      [static_cxx_link_check=$enableval],
>  	      [static_cxx_link_check=yes])
>  
> -# We need the C++ compiler only for testing.
> +# We need the C++ compiler for testing and libsupport.
>  AC_PROG_CXX
>  AC_ARG_VAR([TEST_CXX],
>  	   [C++ compiler for testing])
> +saved_CXX="$CXX"
>  if test -z "$TEST_CXX"; then
>    TEST_CXX="$CXX"
>  else
> @@ -108,6 +109,7 @@ main()
>    LDFLAGS="$old_LDFLAGS"
>  fi
>  AC_LANG_POP([C++])])
> +CXX="$saved_CXX"
>  AS_IF([test $libc_cv_cxx_link_ok != yes], [CXX=; TEST_CXX=])
>  
>  if test "`cd $srcdir; pwd -P`" = "`pwd -P`"; then
> @@ -1077,7 +1079,9 @@ AC_SUBST(CXX_SYSINCLUDES)
>  
>  # Obtain some C++ header file paths.  This is used to make a local
>  # copy of those headers in Makerules.
> -if test -n "$CXX"; then
> +if test -n "$TEST_CXX"; then
> +  saved_CXX="$CXX"
> +  CXX="$TEST_CXX"
>    find_cxx_header () {
>      echo "#include <$1>" | $CXX -H -fsyntax-only -x c++ - 2>&1 \
>  	 | $AWK '$1 == "."{print $2}'
> @@ -1085,6 +1089,7 @@ if test -n "$CXX"; then
>    CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
>    CXX_CMATH_HEADER="$(find_cxx_header cmath)"
>    CXX_BITS_STD_ABS_H="$(find_cxx_header bits/std_abs.h)"
> +  CXX="$saved_CXX"
>  fi
>  AC_SUBST(CXX_CSTDLIB_HEADER)
>  AC_SUBST(CXX_CMATH_HEADER)

Looks like
https://inbox.sourceware.org/libc-testresults/173422834592.2674304.8851778744134595286@tor.usersys.redhat.com/
failed again which is probably related to this.

There is
https://inbox.sourceware.org/libc-testresults/173423226290.2245540.4481814393874404938@torsion.usersys.redhat.com/
too which looks more worrying (and weird).



More information about the Libc-alpha mailing list