diff mbox

[v2,4/6] powerpc64le: Require at least GCC 6.2 for powerpc64le

Message ID 1498067125-30472-5-git-send-email-gftg@linux.vnet.ibm.com
State New
Headers show

Commit Message

Gabriel F. T. Gomes June 21, 2017, 5:45 p.m. UTC
No changes since v1.

-- 8< --
On powerpc64le, support for float128 will be enabled, which requires gcc
versions greater than or equal to 6.2.

Tested for powerpc64 and powerpc64le.

2017-06-12  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
	    Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>

	* sysdeps/powerpc/powerpc64le/configure.ac: New file with test for
	the required minimum gcc version.
	* sysdeps/powerpc/powerpc64le/configure: New, auto-generated file.
---
 sysdeps/powerpc/powerpc64le/configure    | 71 ++++++++++++++++++++++++++++++++
 sysdeps/powerpc/powerpc64le/configure.ac | 17 ++++++++
 2 files changed, 88 insertions(+)
 create mode 100644 sysdeps/powerpc/powerpc64le/configure
 create mode 100644 sysdeps/powerpc/powerpc64le/configure.ac

Comments

Joseph Myers June 21, 2017, 11:27 p.m. UTC | #1
I see no problem with this, but as far as I'm concerned it's for powerpc 
maintainers to review.
Steven Munroe June 22, 2017, 3:25 p.m. UTC | #2
On Wed, 2017-06-21 at 23:27 +0000, Joseph Myers wrote:
> I see no problem with this, but as far as I'm concerned it's for powerpc 
> maintainers to review.
> 
I am Ok with this as it is specific to powerpc64le and will not impact
the other PPC platforms.

But I would prefer a compile test for __float128 and the require 'q'
suffix builtins over s GCC version test. This would allow for clang/llvm
compiles (once they complete their float128 support).

I approve with the change noted above.
Joseph Myers June 22, 2017, 3:36 p.m. UTC | #3
On Thu, 22 Jun 2017, Steven Munroe wrote:

> On Wed, 2017-06-21 at 23:27 +0000, Joseph Myers wrote:
> > I see no problem with this, but as far as I'm concerned it's for powerpc 
> > maintainers to review.
> > 
> I am Ok with this as it is specific to powerpc64le and will not impact
> the other PPC platforms.
> 
> But I would prefer a compile test for __float128 and the require 'q'
> suffix builtins over s GCC version test. This would allow for clang/llvm
> compiles (once they complete their float128 support).

The proposed test is for 6.2.  I presume that's because of some fix that 
wasn't in 6.1 - is it straightforward to make the feature test cover 
whatever's missing and so reject attempts to build with 6.1?
Tulio Magno Quites Machado Filho June 22, 2017, 8:34 p.m. UTC | #4
Joseph Myers <joseph@codesourcery.com> writes:

> On Thu, 22 Jun 2017, Steven Munroe wrote:
>
>> On Wed, 2017-06-21 at 23:27 +0000, Joseph Myers wrote:
>> > I see no problem with this, but as far as I'm concerned it's for powerpc 
>> > maintainers to review.
>> > 
>> I am Ok with this as it is specific to powerpc64le and will not impact
>> the other PPC platforms.
>> 
>> But I would prefer a compile test for __float128 and the require 'q'
>> suffix builtins over s GCC version test. This would allow for clang/llvm
>> compiles (once they complete their float128 support).
>
> The proposed test is for 6.2.  I presume that's because of some fix that 
> wasn't in 6.1 - is it straightforward to make the feature test cover 
> whatever's missing and so reject attempts to build with 6.1?

The current code depend on __builtin_*q that first appeared in GCC 6.2.

I'm changing this patch to check for these built-ins instead and the __float128
type, i.e.:

__float128 a, b, c, d, e;
int i;

__float128
foobar (__float128 x)
{
  a = __builtin_nansq ("0");
  b = __builtin_huge_valq ();
  c = __builtin_infq ();
  d = __builtin_fabsq (x);
  e = __builtin_nanq ("0");
  i = __builtin_signbit (x);
  return __builtin_copysignq (x, x);
}
diff mbox

Patch

diff --git a/sysdeps/powerpc/powerpc64le/configure b/sysdeps/powerpc/powerpc64le/configure
new file mode 100644
index 0000000..f5f1069
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/configure
@@ -0,0 +1,71 @@ 
+
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/powerpc/powerpc64le.
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC is sufficient to build libc for powerpc64le" >&5
+$as_echo_n "checking if $CC is sufficient to build libc for powerpc64le... " >&6; }
+if ${libc_cv_compiler_powerpc64le_compiler_ok+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)
+#error insufficient compiler
+#endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  libc_cv_compiler_powerpc64le_compiler_ok=yes
+else
+  libc_cv_compiler_powerpc64le_compiler_ok=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_powerpc64le_compiler_ok" >&5
+$as_echo "$libc_cv_compiler_powerpc64le_compiler_ok" >&6; }
+if test "$libc_cv_compiler_powerpc64le_compiler_ok" != "yes"; then :
+  critic_missing="$critic_missing GCC >= 6.2 is required on powerpc64le."
+fi
+
+test -n "$critic_missing" && as_fn_error $? "*** $critic_missing" "$LINENO" 5
diff --git a/sysdeps/powerpc/powerpc64le/configure.ac b/sysdeps/powerpc/powerpc64le/configure.ac
new file mode 100644
index 0000000..9d8c54c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/configure.ac
@@ -0,0 +1,17 @@ 
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/powerpc/powerpc64le.
+
+dnl Require __float128 support on powerpc64le (available in GCC 6.2).
+AC_CACHE_CHECK([if $CC is sufficient to build libc for powerpc64le],
+	       libc_cv_compiler_powerpc64le_compiler_ok, [
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
+#if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)
+#error insufficient compiler
+#endif
+]])],
+		  [libc_cv_compiler_powerpc64le_compiler_ok=yes],
+		  [libc_cv_compiler_powerpc64le_compiler_ok=no])])
+AS_IF([test "$libc_cv_compiler_powerpc64le_compiler_ok" != "yes"],
+      [critic_missing="$critic_missing GCC >= 6.2 is required on powerpc64le."])
+
+test -n "$critic_missing" && AC_MSG_ERROR([*** $critic_missing])