summary refs log tree commit diff
path: root/sysdeps/powerpc
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>2017-06-05 16:18:54 -0300
committerGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>2017-06-26 15:00:34 -0300
commita27d2c19355a15569dfcdd5da741b57acf1a106a (patch)
tree40790808b7352ee935dc148c41a74c32ab64a18a /sysdeps/powerpc
parent4efe3ce400d763b6c8186dd389371f6359b05c54 (diff)
downloadglibc-a27d2c19355a15569dfcdd5da741b57acf1a106a.tar.gz
glibc-a27d2c19355a15569dfcdd5da741b57acf1a106a.tar.xz
glibc-a27d2c19355a15569dfcdd5da741b57acf1a106a.zip
powerpc64le: Require at least POWER8 for powerpc64le
Support for powerpc64le requires POWER8 or newer processors.  Builds for
older processors are not tested.  Require at least POWER8 to avoid
unintentional builds.

	* sysdeps/powerpc/powerpc64le/configure.ac: Check for POWER8.
	* sysdeps/powerpc/powerpc64le/configure: Update.
Diffstat (limited to 'sysdeps/powerpc')
-rw-r--r--sysdeps/powerpc/powerpc64le/configure30
-rw-r--r--sysdeps/powerpc/powerpc64le/configure.ac16
2 files changed, 46 insertions, 0 deletions
diff --git a/sysdeps/powerpc/powerpc64le/configure b/sysdeps/powerpc/powerpc64le/configure
index 78208d2eda..66bb5dcc1a 100644
--- a/sysdeps/powerpc/powerpc64le/configure
+++ b/sysdeps/powerpc/powerpc64le/configure
@@ -42,4 +42,34 @@ if test "$libc_cv_compiler_powerpc64le_binary128_ok" != "yes"; then :
   critic_missing="$critic_missing binary128 floating point type (GCC >= 6.2) is required on powerpc64le."
 fi
 
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $libc_cv_cc_submachine"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the target machine is at least POWER8" >&5
+$as_echo_n "checking if the target machine is at least POWER8... " >&6; }
+if ${libc_cv_target_power8_ok+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifndef _ARCH_PWR8
+#error invalid target architecture
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libc_cv_target_power8_ok=yes
+else
+  libc_cv_target_power8_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_target_power8_ok" >&5
+$as_echo "$libc_cv_target_power8_ok" >&6; }
+if test "$libc_cv_target_power8_ok" != "yes"; then :
+  critic_missing="$critic_missing POWER8 or newer is required on powerpc64le."
+fi
+CFLAGS="$OLD_CFLAGS"
+
 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
index e88e224ae1..20a49d89e8 100644
--- a/sysdeps/powerpc/powerpc64le/configure.ac
+++ b/sysdeps/powerpc/powerpc64le/configure.ac
@@ -29,4 +29,20 @@ CFLAGS="$save_CFLAGS"])
 AS_IF([test "$libc_cv_compiler_powerpc64le_binary128_ok" != "yes"],
       [critic_missing="$critic_missing binary128 floating point type (GCC >= 6.2) is required on powerpc64le."])
 
+dnl Require at least POWER8 on powerpc64le
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $libc_cv_cc_submachine"
+AC_CACHE_CHECK([if the target machine is at least POWER8],
+	       libc_cv_target_power8_ok, [
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#ifndef _ARCH_PWR8
+#error invalid target architecture
+#endif
+]])],
+	       [libc_cv_target_power8_ok=yes],
+	       [libc_cv_target_power8_ok=no])])
+AS_IF([test "$libc_cv_target_power8_ok" != "yes"],
+      [critic_missing="$critic_missing POWER8 or newer is required on powerpc64le."])
+CFLAGS="$OLD_CFLAGS"
+
 test -n "$critic_missing" && AC_MSG_ERROR([*** $critic_missing])