]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check for yield support on ARM and print helpfull error message about -march
authorOndřej Surý <ondrej@sury.org>
Tue, 23 Oct 2018 07:27:02 +0000 (09:27 +0200)
committerOndřej Surý <ondrej@sury.org>
Tue, 23 Oct 2018 07:35:00 +0000 (09:35 +0200)
configure
configure.in

index 05ed9a24127183b0d2cee616945f28f05c969363..efbe6855fc55b141be428e2eb424731cd4666232 100755 (executable)
--- a/configure
+++ b/configure
@@ -13618,6 +13618,37 @@ $as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
   fi
 
 
+#
+# Check for yield support on ARM processors
+#
+case $host in #(
+  arm*) :
+
+         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yield instruction support" >&5
+$as_echo_n "checking for yield instruction support... " >&6; }
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+__asm__ __volatile__ ("yield")
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  as_fn_error $? "no, try adding -march=native or -march=armv7-a to CFLAGS (see PLATFORM.md for more information)" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; #(
+  *) :
+     ;;
+esac
+
 for ac_func in sysctlbyname
 do :
   ac_fn_c_check_func "$LINENO" "sysctlbyname" "ac_cv_func_sysctlbyname"
index e26918d20d86fd3c702806b34f0871a9bc6686e8..914e5ae2c141164766df855e3d07d33bb2aa861e 100644 (file)
@@ -460,6 +460,20 @@ AC_C_INLINE
 AC_C_VOLATILE
 AC_C_FLEXIBLE_ARRAY_MEMBER
 
+#
+# Check for yield support on ARM processors
+#
+AS_CASE([$host],
+       [arm*],[
+         AC_MSG_CHECKING([for yield instruction support])
+         AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[]],
+              [[__asm__ __volatile__ ("yield")]]
+            )],
+           [AC_MSG_RESULT([yes])],
+           [AC_MSG_ERROR([no, try adding -march=native or -march=armv7-a to CFLAGS (see PLATFORM.md for more information)])])])
+
 AC_CHECK_FUNCS([sysctlbyname])
 
 #