summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2019-06-01 18:46:54 +0300
committerLasse Collin <lasse.collin@tukaani.org>2019-06-01 18:46:54 +0300
commite5f13a66567b1987e0aae42c6fdcd277bb5810ba (patch)
tree5bb062a4be1fb44578c26142d700b61490f15c0f /m4
parent3bc112c2d38d5f348bce7bc2422286b1692c7490 (diff)
downloadxz-e5f13a66567b1987e0aae42c6fdcd277bb5810ba.tar.gz
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.
Diffstat (limited to 'm4')
-rw-r--r--m4/tuklib_integer.m411
1 files changed, 11 insertions, 0 deletions
diff --git a/m4/tuklib_integer.m4 b/m4/tuklib_integer.m4
index 2ab72a2..c3c59fe 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
;;