From e5f13a66567b1987e0aae42c6fdcd277bb5810ba Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Sat, 1 Jun 2019 18:46:54 +0300 Subject: [PATCH] tuklib_integer: Autodetect support for unaligned access on ARM. The result is used as the default for --enable-unaligned-access. The test should work with GCC and Clang. --- m4/tuklib_integer.m4 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/m4/tuklib_integer.m4 b/m4/tuklib_integer.m4 index 2ab72a2f..c3c59fe3 100644 --- a/m4/tuklib_integer.m4 +++ b/m4/tuklib_integer.m4 @@ -58,6 +58,17 @@ if test "x$enable_unaligned_access" = xauto ; then i?86|x86_64|powerpc|powerpc64) enable_unaligned_access=yes ;; + arm*|aarch64*) + # On 32-bit and 64-bit ARM, GCC and Clang + # #define __ARM_FEATURE_UNALIGNED if + # unaligned access is supported. + AC_COMPILE_IFELSE([AC_LANG_SOURCE([ +#ifndef __ARM_FEATURE_UNALIGNED +compile error +#endif +int main(void) { return 0; } +])], [enable_unaligned_access=yes], [enable_unaligned_access=no]) + ;; *) enable_unaligned_access=no ;;