about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc64le/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/powerpc64le/configure.ac')
-rw-r--r--sysdeps/powerpc/powerpc64le/configure.ac16
1 files changed, 16 insertions, 0 deletions
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])