summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorSitsofe Wheeler <sitsofe@yahoo.com>2018-03-28 15:49:14 +0100
committerSitsofe Wheeler <sitsofe@yahoo.com>2018-03-30 16:16:48 +0100
commit58828d0759642a8d438c94ee96a3e9848f89102a (patch)
tree14f0ed0aa62c4e82a495cc8215d58c1818441098 /configure
parent5457259f57c651d41f6cb5ee4a7af49ff05a9aed (diff)
downloadfio-58828d0759642a8d438c94ee96a3e9848f89102a.tar.gz
fio-58828d0759642a8d438c94ee96a3e9848f89102a.tar.bz2
aarch64: refactor HW ARM CRC32c detection
- Tweak how fio does the configure probe for hardware accelerated ARM CRC32c - Move the Linux specific runtime detection into os-linux.h making it cleaner to implement runtime probing for OSes other than Linux in the future - Make the ARCH_HAVE_CRC_CRYPTO define go into the config-host.* files the same way as most other configure defines - Set/use only the ARCH_HAVE_CRC_CRYPTO define rather than also creating/using ARCH_HAVE_ARM64_CRC_CRYPTO This commit should silence the "Fails to compile: error: sys/auxv.h file not found" compilation message that was seen on FreeBSD 12/arm64 (but note a future commit will be required to implement runtime probing and actually enable the accelerated path on that platform). Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure16
1 files changed, 12 insertions, 4 deletions
diff --git a/configure b/configure
index f6358630..1d8c7f18 100755
--- a/configure
+++ b/configure
@@ -2108,18 +2108,23 @@ if test "$march_armv8_a_crc_crypto" != "yes" ; then
fi
if test "$cpu" = "arm64" ; then
cat > $TMPC <<EOF
-#include <sys/auxv.h>
#include <arm_acle.h>
#include <arm_neon.h>
+#include <sys/auxv.h>
int main(void)
{
- return 0;
+ /* Can we also do a runtime probe? */
+#if __linux__
+ return getauxval(AT_HWCAP);
+#else
+# error "Don't know how to do runtime probe for ARM CRC32c"
+#endif
}
EOF
- if compile_prog "-march=armv8-a+crc+crypto" "" ""; then
+ if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
march_armv8_a_crc_crypto="yes"
- CFLAGS="$CFLAGS -march=armv8-a+crc+crypto -DARCH_HAVE_CRC_CRYPTO"
+ CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
march_set="yes"
fi
fi
@@ -2421,6 +2426,9 @@ if test "$zlib" = "no" ; then
echo "Note that some distros have separate packages for static libraries."
fi
fi
+if test "$march_armv8_a_crc_crypto" = "yes" ; then
+ output_sym "ARCH_HAVE_CRC_CRYPTO"
+fi
if test "$cuda" = "yes" ; then
output_sym "CONFIG_CUDA"
fi