From 032e6963fe78d8863252d0ee23dca61d9ca963ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 23 Oct 2018 09:27:02 +0200 Subject: [PATCH] Check for yield support on ARM and print helpfull error message about -march --- configure | 31 +++++++++++++++++++++++++++++++ configure.in | 14 ++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/configure b/configure index 05ed9a2412..efbe6855fc 100755 --- 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" diff --git a/configure.in b/configure.in index e26918d20d..914e5ae2c1 100644 --- a/configure.in +++ b/configure.in @@ -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]) #