]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
arm: just use the compiler's default yield support
authorMark Andrews <marka@isc.org>
Mon, 6 May 2019 08:06:59 +0000 (18:06 +1000)
committerMark Andrews <marka@isc.org>
Mon, 13 May 2019 01:39:43 +0000 (21:39 -0400)
CHANGES
PLATFORMS.md
config.h.in
configure
configure.ac
lib/isc/rwlock.c

diff --git a/CHANGES b/CHANGES
index cb61ccd8a71a0939247f6e3dc13c4a0d537e250c..7aa50e8b8e423bd311bf0d2bf61d6abe4162d712 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+5234.  [port]          arm: just use the compiler's default support for
+                       yield. [GL #981]
+
        --- 9.15.0 released ---
 
 5233.  [bug]           Negative trust anchors did not work with "forward only;"
index 6fee4a823c22619e1945daced33c7d43ee08bee8..3e1e019819ce88771beb8ddfcaf79abd0ac70821 100644 (file)
@@ -72,35 +72,6 @@ These are platforms on which BIND 9.15 is known *not* to build or run:
 
 ## Platform quirks
 
-### ARM
-
-If the compilation ends with following error:
-
-```
-Error: selected processor does not support `yield' in ARM mode
-```
-
-You will need to set `-march` compiler option to `native`, so the compiler
-recognizes `yield` assembler instruction.  The proper way to set `-march=native`
-would be to put it into `CFLAGS`, e.g. run `./configure` like this:
-`CFLAGS="-march=native -Os -g" ./configure` plus your usual options.
-
-If that doesn't work, you can enforce the minimum CPU and FPU (taken from Debian
-armhf documentation):
-
-* The lowest worthwhile CPU implementation is Armv7-A, therefore the recommended
-  build option is `-march=armv7-a`.
-
-* FPU should be set at VFPv3-D16 as they represent the minimum specification of
-  the processors to support here, therefore the recommended build option is
-  `-mfpu=vfpv3-d16`.
-
-The `configure` command should look like this:
-
-```
-CFLAGS="-march=armv7-a -mfpu=vfpv3-d16 -Os -g" ./configure
-```
-
 ### NetBSD 6 i386
 
 The i386 build of NetBSD requires the `libatomic` library, available from
index 7ab55513902c84941ae8cfb4253f9db9378d6969..31307cb186f69a33cd2258bb9d33d748e68e0eb7 100644 (file)
@@ -45,6 +45,9 @@
 /* Define to 1 if you have the `arc4random_uniform' function. */
 #undef HAVE_ARC4RANDOM_UNIFORM
 
+/* define if the ARM yield instruction is available */
+#undef HAVE_ARM_YIELD
+
 /* Define to 1 if the compiler supports __builtin_clz. */
 #undef HAVE_BUILTIN_CLZ
 
index 1c56cf5a5f9d94af341e207434bddf96c50553a1..5b953030e7057aab328d78c42e51f9bc2c2a1731 100755 (executable)
--- a/configure
+++ b/configure
@@ -13831,17 +13831,15 @@ $as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
 #
 case $host in #(
   arm*) :
-
-         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yield instruction support" >&5
+    { $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
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
 main ()
 {
 __asm__ __volatile__ ("yield")
-
   ;
   return 0;
 }
@@ -13849,8 +13847,12 @@ _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_ARM_YIELD 1" >>confdefs.h
+
 else
-  as_fn_error $? "no, try adding -march=native or -march=armv7-a to CFLAGS (see PLATFORMS.md for more information)" "$LINENO" 5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; #(
   *) :
index 71a05e2eb13c72d4eeef152ac3ee9dbe9d3f0bdf..c249f44e125b97aa7d57944f6d9fb349c41cdc86 100644 (file)
@@ -424,15 +424,15 @@ 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 PLATFORMS.md for more information)])])])
+       [arm*],
+       [AC_MSG_CHECKING([for yield instruction support])
+        AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM([[]],
+                            [[__asm__ __volatile__ ("yield")]])],
+            [AC_MSG_RESULT([yes])
+             AC_DEFINE([HAVE_ARM_YIELD], [1],
+                       [define if the ARM yield instruction is available])],
+            [AC_MSG_RESULT([no])])])
 
 AC_CHECK_FUNCS([sysctlbyname])
 
index 8d970c776189999b2b5c9ed6bddf734e38f16ce9..1071fecc07c2f7dcc06916d7f979d74f694736bb 100644 (file)
@@ -52,7 +52,7 @@
 # define isc_rwlock_pause() __asm__ __volatile__ ("rep; nop")
 #elif defined(__ia64__)
 # define isc_rwlock_pause() __asm__ __volatile__ ("hint @pause")
-#elif defined(__arm__)
+#elif defined(__arm__) && HAVE_ARM_YIELD
 # define isc_rwlock_pause() __asm__ __volatile__ ("yield")
 #elif defined(sun) && (defined(__sparc) || defined(__sparc__))
 # define isc_rwlock_pause() smt_pause()