public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
@ 2022-03-16 18:04 Adhemerval Zanella
  0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-03-16 18:04 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=246593c91ec62e4f1109c409874d737eaba9dbe8

commit 246593c91ec62e4f1109c409874d737eaba9dbe8
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 16 13:58:16 2022 -0300

    powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
    
    The IBM long double configure checks uses function, which turn in
    nested functions by AC_LANG_PROGRAM.  If the compiler does not
    supported nested function, the test always fail.

Diff:
---
 sysdeps/unix/sysv/linux/powerpc/configure    | 59 +++++++++++-----------------
 sysdeps/unix/sysv/linux/powerpc/configure.ac | 42 +++++++++++---------
 2 files changed, 47 insertions(+), 54 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
index 7183573bc0..9000c0c98c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/configure
@@ -1,36 +1,29 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format" >&5
 $as_echo_n "checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format... " >&6; }
 if ${libc_cv_mlong_double_128ibm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+EOF
+libc_cv_mlong_double_128ibm=no
+if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+then
   libc_cv_mlong_double_128ibm=yes
-else
-  libc_cv_mlong_double_128ibm=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CFLAGS="$save_CFLAGS"
+rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mlong_double_128ibm" >&5
 $as_echo "$libc_cv_mlong_double_128ibm" >&6; }
@@ -41,30 +34,24 @@ $as_echo_n "checking whether $CC $CFLAGS supports -mabi=ibmlongdouble... " >&6;
 if ${libc_cv_mabi_ibmlongdouble+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-    save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  libc_cv_mabi_ibmlongdouble=yes
-else
+EOF
   libc_cv_mabi_ibmlongdouble=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$save_CFLAGS"
+  if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mabi_ibmlongdouble" >&5
 $as_echo "$libc_cv_mabi_ibmlongdouble" >&6; }
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index 8d2ec60f68..215e07ca82 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -2,32 +2,38 @@ sinclude(./aclocal.m4)dnl Autoconf lossage
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
-	       libc_cv_mlong_double_128ibm, [dnl
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+AC_CACHE_CHECK([whether $CC $CFLAGS -mlong-double-128 uses IBM extended format],
+	       [libc_cv_mlong_double_128ibm], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-	       libc_cv_mlong_double_128ibm=yes,
-	       libc_cv_mlong_double_128ibm=no)
-CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+libc_cv_mlong_double_128ibm=no
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+  libc_cv_mlong_double_128ibm=yes
+fi
+rm -f conftest*])
 
 if test "$libc_cv_mlong_double_128ibm" = no; then
-  AC_CACHE_CHECK(whether $CC $CFLAGS supports -mabi=ibmlongdouble,
-		 libc_cv_mabi_ibmlongdouble, [dnl
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+  AC_CACHE_CHECK([whether $CC $CFLAGS supports -mabi=ibmlongdouble],
+		 [libc_cv_mabi_ibmlongdouble], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-		 libc_cv_mabi_ibmlongdouble=yes,
-		 libc_cv_mabi_ibmlongdouble=no)
-  CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+  libc_cv_mabi_ibmlongdouble=no
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*])
 
   if test "$libc_cv_mabi_ibmlongdouble" = yes; then
     CFLAGS="$CFLAGS -mabi=ibmlongdouble"


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [glibc/azanella/clang] powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
@ 2022-06-09 21:21 Adhemerval Zanella
  0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 21:21 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6cfe141fd68a0335f7a32fb7db4f6c5b468aceba

commit 6cfe141fd68a0335f7a32fb7db4f6c5b468aceba
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 16 13:58:16 2022 -0300

    powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
    
    The IBM long double configure checks uses function, which turn in
    nested functions by AC_LANG_PROGRAM.  If the compiler does not
    supported nested function, the test always fail.

Diff:
---
 sysdeps/unix/sysv/linux/powerpc/configure    | 59 +++++++++++-----------------
 sysdeps/unix/sysv/linux/powerpc/configure.ac | 42 +++++++++++---------
 2 files changed, 47 insertions(+), 54 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
index 7183573bc0..9000c0c98c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/configure
@@ -1,36 +1,29 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format" >&5
 $as_echo_n "checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format... " >&6; }
 if ${libc_cv_mlong_double_128ibm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+EOF
+libc_cv_mlong_double_128ibm=no
+if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+then
   libc_cv_mlong_double_128ibm=yes
-else
-  libc_cv_mlong_double_128ibm=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CFLAGS="$save_CFLAGS"
+rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mlong_double_128ibm" >&5
 $as_echo "$libc_cv_mlong_double_128ibm" >&6; }
@@ -41,30 +34,24 @@ $as_echo_n "checking whether $CC $CFLAGS supports -mabi=ibmlongdouble... " >&6;
 if ${libc_cv_mabi_ibmlongdouble+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-    save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  libc_cv_mabi_ibmlongdouble=yes
-else
+EOF
   libc_cv_mabi_ibmlongdouble=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$save_CFLAGS"
+  if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mabi_ibmlongdouble" >&5
 $as_echo "$libc_cv_mabi_ibmlongdouble" >&6; }
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index 8d2ec60f68..215e07ca82 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -2,32 +2,38 @@ sinclude(./aclocal.m4)dnl Autoconf lossage
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
-	       libc_cv_mlong_double_128ibm, [dnl
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+AC_CACHE_CHECK([whether $CC $CFLAGS -mlong-double-128 uses IBM extended format],
+	       [libc_cv_mlong_double_128ibm], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-	       libc_cv_mlong_double_128ibm=yes,
-	       libc_cv_mlong_double_128ibm=no)
-CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+libc_cv_mlong_double_128ibm=no
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+  libc_cv_mlong_double_128ibm=yes
+fi
+rm -f conftest*])
 
 if test "$libc_cv_mlong_double_128ibm" = no; then
-  AC_CACHE_CHECK(whether $CC $CFLAGS supports -mabi=ibmlongdouble,
-		 libc_cv_mabi_ibmlongdouble, [dnl
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+  AC_CACHE_CHECK([whether $CC $CFLAGS supports -mabi=ibmlongdouble],
+		 [libc_cv_mabi_ibmlongdouble], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-		 libc_cv_mabi_ibmlongdouble=yes,
-		 libc_cv_mabi_ibmlongdouble=no)
-  CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+  libc_cv_mabi_ibmlongdouble=no
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*])
 
   if test "$libc_cv_mabi_ibmlongdouble" = yes; then
     CFLAGS="$CFLAGS -mabi=ibmlongdouble"


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [glibc/azanella/clang] powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
@ 2022-06-09 13:17 Adhemerval Zanella
  0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 13:17 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6cfe141fd68a0335f7a32fb7db4f6c5b468aceba

commit 6cfe141fd68a0335f7a32fb7db4f6c5b468aceba
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 16 13:58:16 2022 -0300

    powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
    
    The IBM long double configure checks uses function, which turn in
    nested functions by AC_LANG_PROGRAM.  If the compiler does not
    supported nested function, the test always fail.

Diff:
---
 sysdeps/unix/sysv/linux/powerpc/configure    | 59 +++++++++++-----------------
 sysdeps/unix/sysv/linux/powerpc/configure.ac | 42 +++++++++++---------
 2 files changed, 47 insertions(+), 54 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
index 7183573bc0..9000c0c98c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/configure
@@ -1,36 +1,29 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format" >&5
 $as_echo_n "checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format... " >&6; }
 if ${libc_cv_mlong_double_128ibm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+EOF
+libc_cv_mlong_double_128ibm=no
+if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+then
   libc_cv_mlong_double_128ibm=yes
-else
-  libc_cv_mlong_double_128ibm=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CFLAGS="$save_CFLAGS"
+rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mlong_double_128ibm" >&5
 $as_echo "$libc_cv_mlong_double_128ibm" >&6; }
@@ -41,30 +34,24 @@ $as_echo_n "checking whether $CC $CFLAGS supports -mabi=ibmlongdouble... " >&6;
 if ${libc_cv_mabi_ibmlongdouble+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-    save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  libc_cv_mabi_ibmlongdouble=yes
-else
+EOF
   libc_cv_mabi_ibmlongdouble=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$save_CFLAGS"
+  if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mabi_ibmlongdouble" >&5
 $as_echo "$libc_cv_mabi_ibmlongdouble" >&6; }
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index 8d2ec60f68..215e07ca82 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -2,32 +2,38 @@ sinclude(./aclocal.m4)dnl Autoconf lossage
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
-	       libc_cv_mlong_double_128ibm, [dnl
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+AC_CACHE_CHECK([whether $CC $CFLAGS -mlong-double-128 uses IBM extended format],
+	       [libc_cv_mlong_double_128ibm], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-	       libc_cv_mlong_double_128ibm=yes,
-	       libc_cv_mlong_double_128ibm=no)
-CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+libc_cv_mlong_double_128ibm=no
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+  libc_cv_mlong_double_128ibm=yes
+fi
+rm -f conftest*])
 
 if test "$libc_cv_mlong_double_128ibm" = no; then
-  AC_CACHE_CHECK(whether $CC $CFLAGS supports -mabi=ibmlongdouble,
-		 libc_cv_mabi_ibmlongdouble, [dnl
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+  AC_CACHE_CHECK([whether $CC $CFLAGS supports -mabi=ibmlongdouble],
+		 [libc_cv_mabi_ibmlongdouble], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-		 libc_cv_mabi_ibmlongdouble=yes,
-		 libc_cv_mabi_ibmlongdouble=no)
-  CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+  libc_cv_mabi_ibmlongdouble=no
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*])
 
   if test "$libc_cv_mabi_ibmlongdouble" = yes; then
     CFLAGS="$CFLAGS -mabi=ibmlongdouble"


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [glibc/azanella/clang] powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
@ 2022-06-03 14:07 Adhemerval Zanella
  0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-06-03 14:07 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=977736958eb508c775915c6ab57dbc82569057f7

commit 977736958eb508c775915c6ab57dbc82569057f7
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 16 13:58:16 2022 -0300

    powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
    
    The IBM long double configure checks uses function, which turn in
    nested functions by AC_LANG_PROGRAM.  If the compiler does not
    supported nested function, the test always fail.

Diff:
---
 sysdeps/unix/sysv/linux/powerpc/configure    | 59 +++++++++++-----------------
 sysdeps/unix/sysv/linux/powerpc/configure.ac | 42 +++++++++++---------
 2 files changed, 47 insertions(+), 54 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
index 7183573bc0..9000c0c98c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/configure
@@ -1,36 +1,29 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format" >&5
 $as_echo_n "checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format... " >&6; }
 if ${libc_cv_mlong_double_128ibm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+EOF
+libc_cv_mlong_double_128ibm=no
+if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+then
   libc_cv_mlong_double_128ibm=yes
-else
-  libc_cv_mlong_double_128ibm=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CFLAGS="$save_CFLAGS"
+rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mlong_double_128ibm" >&5
 $as_echo "$libc_cv_mlong_double_128ibm" >&6; }
@@ -41,30 +34,24 @@ $as_echo_n "checking whether $CC $CFLAGS supports -mabi=ibmlongdouble... " >&6;
 if ${libc_cv_mabi_ibmlongdouble+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-    save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  libc_cv_mabi_ibmlongdouble=yes
-else
+EOF
   libc_cv_mabi_ibmlongdouble=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$save_CFLAGS"
+  if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mabi_ibmlongdouble" >&5
 $as_echo "$libc_cv_mabi_ibmlongdouble" >&6; }
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index 8d2ec60f68..215e07ca82 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -2,32 +2,38 @@ sinclude(./aclocal.m4)dnl Autoconf lossage
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
-	       libc_cv_mlong_double_128ibm, [dnl
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+AC_CACHE_CHECK([whether $CC $CFLAGS -mlong-double-128 uses IBM extended format],
+	       [libc_cv_mlong_double_128ibm], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-	       libc_cv_mlong_double_128ibm=yes,
-	       libc_cv_mlong_double_128ibm=no)
-CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+libc_cv_mlong_double_128ibm=no
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+  libc_cv_mlong_double_128ibm=yes
+fi
+rm -f conftest*])
 
 if test "$libc_cv_mlong_double_128ibm" = no; then
-  AC_CACHE_CHECK(whether $CC $CFLAGS supports -mabi=ibmlongdouble,
-		 libc_cv_mabi_ibmlongdouble, [dnl
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+  AC_CACHE_CHECK([whether $CC $CFLAGS supports -mabi=ibmlongdouble],
+		 [libc_cv_mabi_ibmlongdouble], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-		 libc_cv_mabi_ibmlongdouble=yes,
-		 libc_cv_mabi_ibmlongdouble=no)
-  CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+  libc_cv_mabi_ibmlongdouble=no
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*])
 
   if test "$libc_cv_mabi_ibmlongdouble" = yes; then
     CFLAGS="$CFLAGS -mabi=ibmlongdouble"


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [glibc/azanella/clang] powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
@ 2022-05-13 14:20 Adhemerval Zanella
  0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-05-13 14:20 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bd6c65c976ee880d6188d3696b34d4aaef7bc9a8

commit bd6c65c976ee880d6188d3696b34d4aaef7bc9a8
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 16 13:58:16 2022 -0300

    powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
    
    The IBM long double configure checks uses function, which turn in
    nested functions by AC_LANG_PROGRAM.  If the compiler does not
    supported nested function, the test always fail.

Diff:
---
 sysdeps/unix/sysv/linux/powerpc/configure    | 59 +++++++++++-----------------
 sysdeps/unix/sysv/linux/powerpc/configure.ac | 42 +++++++++++---------
 2 files changed, 47 insertions(+), 54 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
index 7183573bc0..9000c0c98c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/configure
@@ -1,36 +1,29 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format" >&5
 $as_echo_n "checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format... " >&6; }
 if ${libc_cv_mlong_double_128ibm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+EOF
+libc_cv_mlong_double_128ibm=no
+if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+then
   libc_cv_mlong_double_128ibm=yes
-else
-  libc_cv_mlong_double_128ibm=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CFLAGS="$save_CFLAGS"
+rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mlong_double_128ibm" >&5
 $as_echo "$libc_cv_mlong_double_128ibm" >&6; }
@@ -41,30 +34,24 @@ $as_echo_n "checking whether $CC $CFLAGS supports -mabi=ibmlongdouble... " >&6;
 if ${libc_cv_mabi_ibmlongdouble+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-    save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  libc_cv_mabi_ibmlongdouble=yes
-else
+EOF
   libc_cv_mabi_ibmlongdouble=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$save_CFLAGS"
+  if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mabi_ibmlongdouble" >&5
 $as_echo "$libc_cv_mabi_ibmlongdouble" >&6; }
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index 8d2ec60f68..215e07ca82 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -2,32 +2,38 @@ sinclude(./aclocal.m4)dnl Autoconf lossage
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
-	       libc_cv_mlong_double_128ibm, [dnl
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+AC_CACHE_CHECK([whether $CC $CFLAGS -mlong-double-128 uses IBM extended format],
+	       [libc_cv_mlong_double_128ibm], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-	       libc_cv_mlong_double_128ibm=yes,
-	       libc_cv_mlong_double_128ibm=no)
-CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+libc_cv_mlong_double_128ibm=no
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+  libc_cv_mlong_double_128ibm=yes
+fi
+rm -f conftest*])
 
 if test "$libc_cv_mlong_double_128ibm" = no; then
-  AC_CACHE_CHECK(whether $CC $CFLAGS supports -mabi=ibmlongdouble,
-		 libc_cv_mabi_ibmlongdouble, [dnl
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+  AC_CACHE_CHECK([whether $CC $CFLAGS supports -mabi=ibmlongdouble],
+		 [libc_cv_mabi_ibmlongdouble], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-		 libc_cv_mabi_ibmlongdouble=yes,
-		 libc_cv_mabi_ibmlongdouble=no)
-  CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+  libc_cv_mabi_ibmlongdouble=no
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*])
 
   if test "$libc_cv_mabi_ibmlongdouble" = yes; then
     CFLAGS="$CFLAGS -mabi=ibmlongdouble"


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [glibc/azanella/clang] powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
@ 2022-05-12 19:34 Adhemerval Zanella
  0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-05-12 19:34 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1c8c306e81126160af428fa67f4ff3d95abd21c3

commit 1c8c306e81126160af428fa67f4ff3d95abd21c3
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 16 13:58:16 2022 -0300

    powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
    
    The IBM long double configure checks uses function, which turn in
    nested functions by AC_LANG_PROGRAM.  If the compiler does not
    supported nested function, the test always fail.

Diff:
---
 sysdeps/unix/sysv/linux/powerpc/configure    | 59 +++++++++++-----------------
 sysdeps/unix/sysv/linux/powerpc/configure.ac | 42 +++++++++++---------
 2 files changed, 47 insertions(+), 54 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
index 7183573bc0..9000c0c98c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/configure
@@ -1,36 +1,29 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format" >&5
 $as_echo_n "checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format... " >&6; }
 if ${libc_cv_mlong_double_128ibm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+EOF
+libc_cv_mlong_double_128ibm=no
+if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+then
   libc_cv_mlong_double_128ibm=yes
-else
-  libc_cv_mlong_double_128ibm=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CFLAGS="$save_CFLAGS"
+rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mlong_double_128ibm" >&5
 $as_echo "$libc_cv_mlong_double_128ibm" >&6; }
@@ -41,30 +34,24 @@ $as_echo_n "checking whether $CC $CFLAGS supports -mabi=ibmlongdouble... " >&6;
 if ${libc_cv_mabi_ibmlongdouble+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-    save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  libc_cv_mabi_ibmlongdouble=yes
-else
+EOF
   libc_cv_mabi_ibmlongdouble=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$save_CFLAGS"
+  if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mabi_ibmlongdouble" >&5
 $as_echo "$libc_cv_mabi_ibmlongdouble" >&6; }
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index 8d2ec60f68..215e07ca82 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -2,32 +2,38 @@ sinclude(./aclocal.m4)dnl Autoconf lossage
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
-	       libc_cv_mlong_double_128ibm, [dnl
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+AC_CACHE_CHECK([whether $CC $CFLAGS -mlong-double-128 uses IBM extended format],
+	       [libc_cv_mlong_double_128ibm], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-	       libc_cv_mlong_double_128ibm=yes,
-	       libc_cv_mlong_double_128ibm=no)
-CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+libc_cv_mlong_double_128ibm=no
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+  libc_cv_mlong_double_128ibm=yes
+fi
+rm -f conftest*])
 
 if test "$libc_cv_mlong_double_128ibm" = no; then
-  AC_CACHE_CHECK(whether $CC $CFLAGS supports -mabi=ibmlongdouble,
-		 libc_cv_mabi_ibmlongdouble, [dnl
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+  AC_CACHE_CHECK([whether $CC $CFLAGS supports -mabi=ibmlongdouble],
+		 [libc_cv_mabi_ibmlongdouble], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-		 libc_cv_mabi_ibmlongdouble=yes,
-		 libc_cv_mabi_ibmlongdouble=no)
-  CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+  libc_cv_mabi_ibmlongdouble=no
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*])
 
   if test "$libc_cv_mabi_ibmlongdouble" = yes; then
     CFLAGS="$CFLAGS -mabi=ibmlongdouble"


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [glibc/azanella/clang] powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
@ 2022-05-10 18:25 Adhemerval Zanella
  0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-05-10 18:25 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e80dad4464d2b7d8d7979e72774e7cfe11832115

commit e80dad4464d2b7d8d7979e72774e7cfe11832115
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 16 13:58:16 2022 -0300

    powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
    
    The IBM long double configure checks uses function, which turn in
    nested functions by AC_LANG_PROGRAM.  If the compiler does not
    supported nested function, the test always fail.

Diff:
---
 sysdeps/unix/sysv/linux/powerpc/configure    | 59 +++++++++++-----------------
 sysdeps/unix/sysv/linux/powerpc/configure.ac | 42 +++++++++++---------
 2 files changed, 47 insertions(+), 54 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
index 7183573bc0..9000c0c98c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/configure
@@ -1,36 +1,29 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format" >&5
 $as_echo_n "checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format... " >&6; }
 if ${libc_cv_mlong_double_128ibm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+EOF
+libc_cv_mlong_double_128ibm=no
+if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+then
   libc_cv_mlong_double_128ibm=yes
-else
-  libc_cv_mlong_double_128ibm=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CFLAGS="$save_CFLAGS"
+rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mlong_double_128ibm" >&5
 $as_echo "$libc_cv_mlong_double_128ibm" >&6; }
@@ -41,30 +34,24 @@ $as_echo_n "checking whether $CC $CFLAGS supports -mabi=ibmlongdouble... " >&6;
 if ${libc_cv_mabi_ibmlongdouble+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-    save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  libc_cv_mabi_ibmlongdouble=yes
-else
+EOF
   libc_cv_mabi_ibmlongdouble=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$save_CFLAGS"
+  if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mabi_ibmlongdouble" >&5
 $as_echo "$libc_cv_mabi_ibmlongdouble" >&6; }
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index 8d2ec60f68..215e07ca82 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -2,32 +2,38 @@ sinclude(./aclocal.m4)dnl Autoconf lossage
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
-	       libc_cv_mlong_double_128ibm, [dnl
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+AC_CACHE_CHECK([whether $CC $CFLAGS -mlong-double-128 uses IBM extended format],
+	       [libc_cv_mlong_double_128ibm], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-	       libc_cv_mlong_double_128ibm=yes,
-	       libc_cv_mlong_double_128ibm=no)
-CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+libc_cv_mlong_double_128ibm=no
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+  libc_cv_mlong_double_128ibm=yes
+fi
+rm -f conftest*])
 
 if test "$libc_cv_mlong_double_128ibm" = no; then
-  AC_CACHE_CHECK(whether $CC $CFLAGS supports -mabi=ibmlongdouble,
-		 libc_cv_mabi_ibmlongdouble, [dnl
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+  AC_CACHE_CHECK([whether $CC $CFLAGS supports -mabi=ibmlongdouble],
+		 [libc_cv_mabi_ibmlongdouble], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-		 libc_cv_mabi_ibmlongdouble=yes,
-		 libc_cv_mabi_ibmlongdouble=no)
-  CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+  libc_cv_mabi_ibmlongdouble=no
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*])
 
   if test "$libc_cv_mabi_ibmlongdouble" = yes; then
     CFLAGS="$CFLAGS -mabi=ibmlongdouble"


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [glibc/azanella/clang] powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
@ 2022-04-29 14:05 Adhemerval Zanella
  0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-04-29 14:05 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=82e470cb8d490a2f24fdf98e25b49a45f472860b

commit 82e470cb8d490a2f24fdf98e25b49a45f472860b
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 16 13:58:16 2022 -0300

    powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
    
    The IBM long double configure checks uses function, which turn in
    nested functions by AC_LANG_PROGRAM.  If the compiler does not
    supported nested function, the test always fail.

Diff:
---
 sysdeps/unix/sysv/linux/powerpc/configure    | 59 +++++++++++-----------------
 sysdeps/unix/sysv/linux/powerpc/configure.ac | 42 +++++++++++---------
 2 files changed, 47 insertions(+), 54 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
index 7183573bc0..9000c0c98c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/configure
@@ -1,36 +1,29 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format" >&5
 $as_echo_n "checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format... " >&6; }
 if ${libc_cv_mlong_double_128ibm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+EOF
+libc_cv_mlong_double_128ibm=no
+if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+then
   libc_cv_mlong_double_128ibm=yes
-else
-  libc_cv_mlong_double_128ibm=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CFLAGS="$save_CFLAGS"
+rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mlong_double_128ibm" >&5
 $as_echo "$libc_cv_mlong_double_128ibm" >&6; }
@@ -41,30 +34,24 @@ $as_echo_n "checking whether $CC $CFLAGS supports -mabi=ibmlongdouble... " >&6;
 if ${libc_cv_mabi_ibmlongdouble+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-    save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  libc_cv_mabi_ibmlongdouble=yes
-else
+EOF
   libc_cv_mabi_ibmlongdouble=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$save_CFLAGS"
+  if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mabi_ibmlongdouble" >&5
 $as_echo "$libc_cv_mabi_ibmlongdouble" >&6; }
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index 8d2ec60f68..215e07ca82 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -2,32 +2,38 @@ sinclude(./aclocal.m4)dnl Autoconf lossage
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
-	       libc_cv_mlong_double_128ibm, [dnl
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+AC_CACHE_CHECK([whether $CC $CFLAGS -mlong-double-128 uses IBM extended format],
+	       [libc_cv_mlong_double_128ibm], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-	       libc_cv_mlong_double_128ibm=yes,
-	       libc_cv_mlong_double_128ibm=no)
-CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+libc_cv_mlong_double_128ibm=no
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+  libc_cv_mlong_double_128ibm=yes
+fi
+rm -f conftest*])
 
 if test "$libc_cv_mlong_double_128ibm" = no; then
-  AC_CACHE_CHECK(whether $CC $CFLAGS supports -mabi=ibmlongdouble,
-		 libc_cv_mabi_ibmlongdouble, [dnl
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+  AC_CACHE_CHECK([whether $CC $CFLAGS supports -mabi=ibmlongdouble],
+		 [libc_cv_mabi_ibmlongdouble], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-		 libc_cv_mabi_ibmlongdouble=yes,
-		 libc_cv_mabi_ibmlongdouble=no)
-  CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+  libc_cv_mabi_ibmlongdouble=no
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*])
 
   if test "$libc_cv_mabi_ibmlongdouble" = yes; then
     CFLAGS="$CFLAGS -mabi=ibmlongdouble"


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [glibc/azanella/clang] powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
@ 2022-04-04 12:55 Adhemerval Zanella
  0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-04-04 12:55 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b4338da21fc709d408ed2bb0f93f082838de0d1c

commit b4338da21fc709d408ed2bb0f93f082838de0d1c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 16 13:58:16 2022 -0300

    powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
    
    The IBM long double configure checks uses function, which turn in
    nested functions by AC_LANG_PROGRAM.  If the compiler does not
    supported nested function, the test always fail.

Diff:
---
 sysdeps/unix/sysv/linux/powerpc/configure    | 59 +++++++++++-----------------
 sysdeps/unix/sysv/linux/powerpc/configure.ac | 42 +++++++++++---------
 2 files changed, 47 insertions(+), 54 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
index 7183573bc0..9000c0c98c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/configure
@@ -1,36 +1,29 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format" >&5
 $as_echo_n "checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format... " >&6; }
 if ${libc_cv_mlong_double_128ibm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+EOF
+libc_cv_mlong_double_128ibm=no
+if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+then
   libc_cv_mlong_double_128ibm=yes
-else
-  libc_cv_mlong_double_128ibm=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CFLAGS="$save_CFLAGS"
+rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mlong_double_128ibm" >&5
 $as_echo "$libc_cv_mlong_double_128ibm" >&6; }
@@ -41,30 +34,24 @@ $as_echo_n "checking whether $CC $CFLAGS supports -mabi=ibmlongdouble... " >&6;
 if ${libc_cv_mabi_ibmlongdouble+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-    save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  libc_cv_mabi_ibmlongdouble=yes
-else
+EOF
   libc_cv_mabi_ibmlongdouble=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$save_CFLAGS"
+  if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mabi_ibmlongdouble" >&5
 $as_echo "$libc_cv_mabi_ibmlongdouble" >&6; }
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index 8d2ec60f68..215e07ca82 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -2,32 +2,38 @@ sinclude(./aclocal.m4)dnl Autoconf lossage
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
-	       libc_cv_mlong_double_128ibm, [dnl
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+AC_CACHE_CHECK([whether $CC $CFLAGS -mlong-double-128 uses IBM extended format],
+	       [libc_cv_mlong_double_128ibm], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-	       libc_cv_mlong_double_128ibm=yes,
-	       libc_cv_mlong_double_128ibm=no)
-CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+libc_cv_mlong_double_128ibm=no
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+  libc_cv_mlong_double_128ibm=yes
+fi
+rm -f conftest*])
 
 if test "$libc_cv_mlong_double_128ibm" = no; then
-  AC_CACHE_CHECK(whether $CC $CFLAGS supports -mabi=ibmlongdouble,
-		 libc_cv_mabi_ibmlongdouble, [dnl
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+  AC_CACHE_CHECK([whether $CC $CFLAGS supports -mabi=ibmlongdouble],
+		 [libc_cv_mabi_ibmlongdouble], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-		 libc_cv_mabi_ibmlongdouble=yes,
-		 libc_cv_mabi_ibmlongdouble=no)
-  CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+  libc_cv_mabi_ibmlongdouble=no
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*])
 
   if test "$libc_cv_mabi_ibmlongdouble" = yes; then
     CFLAGS="$CFLAGS -mabi=ibmlongdouble"


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [glibc/azanella/clang] powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
@ 2022-03-31 19:07 Adhemerval Zanella
  0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-03-31 19:07 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a3cc22dca6dfc5e1c9618e70bce2d9206c56f53f

commit a3cc22dca6dfc5e1c9618e70bce2d9206c56f53f
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 16 13:58:16 2022 -0300

    powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
    
    The IBM long double configure checks uses function, which turn in
    nested functions by AC_LANG_PROGRAM.  If the compiler does not
    supported nested function, the test always fail.

Diff:
---
 sysdeps/unix/sysv/linux/powerpc/configure    | 59 +++++++++++-----------------
 sysdeps/unix/sysv/linux/powerpc/configure.ac | 42 +++++++++++---------
 2 files changed, 47 insertions(+), 54 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
index 7183573bc0..9000c0c98c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/configure
@@ -1,36 +1,29 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format" >&5
 $as_echo_n "checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format... " >&6; }
 if ${libc_cv_mlong_double_128ibm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+EOF
+libc_cv_mlong_double_128ibm=no
+if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+then
   libc_cv_mlong_double_128ibm=yes
-else
-  libc_cv_mlong_double_128ibm=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CFLAGS="$save_CFLAGS"
+rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mlong_double_128ibm" >&5
 $as_echo "$libc_cv_mlong_double_128ibm" >&6; }
@@ -41,30 +34,24 @@ $as_echo_n "checking whether $CC $CFLAGS supports -mabi=ibmlongdouble... " >&6;
 if ${libc_cv_mabi_ibmlongdouble+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-    save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  libc_cv_mabi_ibmlongdouble=yes
-else
+EOF
   libc_cv_mabi_ibmlongdouble=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$save_CFLAGS"
+  if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mabi_ibmlongdouble" >&5
 $as_echo "$libc_cv_mabi_ibmlongdouble" >&6; }
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index 8d2ec60f68..215e07ca82 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -2,32 +2,38 @@ sinclude(./aclocal.m4)dnl Autoconf lossage
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
-	       libc_cv_mlong_double_128ibm, [dnl
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+AC_CACHE_CHECK([whether $CC $CFLAGS -mlong-double-128 uses IBM extended format],
+	       [libc_cv_mlong_double_128ibm], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-	       libc_cv_mlong_double_128ibm=yes,
-	       libc_cv_mlong_double_128ibm=no)
-CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+libc_cv_mlong_double_128ibm=no
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+  libc_cv_mlong_double_128ibm=yes
+fi
+rm -f conftest*])
 
 if test "$libc_cv_mlong_double_128ibm" = no; then
-  AC_CACHE_CHECK(whether $CC $CFLAGS supports -mabi=ibmlongdouble,
-		 libc_cv_mabi_ibmlongdouble, [dnl
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+  AC_CACHE_CHECK([whether $CC $CFLAGS supports -mabi=ibmlongdouble],
+		 [libc_cv_mabi_ibmlongdouble], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-		 libc_cv_mabi_ibmlongdouble=yes,
-		 libc_cv_mabi_ibmlongdouble=no)
-  CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+  libc_cv_mabi_ibmlongdouble=no
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*])
 
   if test "$libc_cv_mabi_ibmlongdouble" = yes; then
     CFLAGS="$CFLAGS -mabi=ibmlongdouble"


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [glibc/azanella/clang] powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
@ 2022-03-29 20:30 Adhemerval Zanella
  0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-03-29 20:30 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bfa1d663339e38583879d7aca2c2eb8f67be639a

commit bfa1d663339e38583879d7aca2c2eb8f67be639a
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 16 13:58:16 2022 -0300

    powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND
    
    The IBM long double configure checks uses function, which turn in
    nested functions by AC_LANG_PROGRAM.  If the compiler does not
    supported nested function, the test always fail.

Diff:
---
 sysdeps/unix/sysv/linux/powerpc/configure    | 59 +++++++++++-----------------
 sysdeps/unix/sysv/linux/powerpc/configure.ac | 42 +++++++++++---------
 2 files changed, 47 insertions(+), 54 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
index 7183573bc0..9000c0c98c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/configure
@@ -1,36 +1,29 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format" >&5
 $as_echo_n "checking whether $CC $CFLAGS -mlong-double-128 uses IBM extended format... " >&6; }
 if ${libc_cv_mlong_double_128ibm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+EOF
+libc_cv_mlong_double_128ibm=no
+if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+then
   libc_cv_mlong_double_128ibm=yes
-else
-  libc_cv_mlong_double_128ibm=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CFLAGS="$save_CFLAGS"
+rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mlong_double_128ibm" >&5
 $as_echo "$libc_cv_mlong_double_128ibm" >&6; }
@@ -41,30 +34,24 @@ $as_echo_n "checking whether $CC $CFLAGS supports -mabi=ibmlongdouble... " >&6;
 if ${libc_cv_mabi_ibmlongdouble+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-    save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  cat > conftest.c <<EOF
 #include <float.h>
-int
-main ()
-{
-
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  libc_cv_mabi_ibmlongdouble=yes
-else
+EOF
   libc_cv_mabi_ibmlongdouble=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$save_CFLAGS"
+  if { ac_try='${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mabi_ibmlongdouble" >&5
 $as_echo "$libc_cv_mabi_ibmlongdouble" >&6; }
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index 8d2ec60f68..215e07ca82 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -2,32 +2,38 @@ sinclude(./aclocal.m4)dnl Autoconf lossage
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/.
 
-AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
-	       libc_cv_mlong_double_128ibm, [dnl
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -mlong-double-128"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+AC_CACHE_CHECK([whether $CC $CFLAGS -mlong-double-128 uses IBM extended format],
+	       [libc_cv_mlong_double_128ibm], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-	       libc_cv_mlong_double_128ibm=yes,
-	       libc_cv_mlong_double_128ibm=no)
-CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+libc_cv_mlong_double_128ibm=no
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 $CPPFLAGS $LDFLAGS -nostdlib $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+  libc_cv_mlong_double_128ibm=yes
+fi
+rm -f conftest*])
 
 if test "$libc_cv_mlong_double_128ibm" = no; then
-  AC_CACHE_CHECK(whether $CC $CFLAGS supports -mabi=ibmlongdouble,
-		 libc_cv_mabi_ibmlongdouble, [dnl
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+  AC_CACHE_CHECK([whether $CC $CFLAGS supports -mabi=ibmlongdouble],
+		 [libc_cv_mabi_ibmlongdouble], [dnl
+cat > conftest.c <<EOF
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }]])],
-		 libc_cv_mabi_ibmlongdouble=yes,
-		 libc_cv_mabi_ibmlongdouble=no)
-  CFLAGS="$save_CFLAGS"])
+long double foobar (long double x) { return x; }
+EOF
+  libc_cv_mabi_ibmlongdouble=no
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -mlong-double-128 -mabi=ibmlongdouble $CPPFLAGS $LDFLAGS $no_ssp -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+  then
+    libc_cv_mabi_ibmlongdouble=yes
+  fi
+  rm -f conftest*])
 
   if test "$libc_cv_mabi_ibmlongdouble" = yes; then
     CFLAGS="$CFLAGS -mabi=ibmlongdouble"


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-06-09 21:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 18:04 [glibc/azanella/clang] powerpc: Replace AC_LANG_PROGRAM with AC_TRY_COMMAND Adhemerval Zanella
2022-03-29 20:30 Adhemerval Zanella
2022-03-31 19:07 Adhemerval Zanella
2022-04-04 12:55 Adhemerval Zanella
2022-04-29 14:05 Adhemerval Zanella
2022-05-10 18:25 Adhemerval Zanella
2022-05-12 19:34 Adhemerval Zanella
2022-05-13 14:20 Adhemerval Zanella
2022-06-03 14:07 Adhemerval Zanella
2022-06-09 13:17 Adhemerval Zanella
2022-06-09 21:21 Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).