diff options
author | Paul Lindner <lindner@mirth.inuus.com> | 2009-12-26 00:21:32 -0800 |
---|---|---|
committer | Trond Norbye <Trond.Norbye@gmail.com> | 2009-12-26 12:27:46 +0100 |
commit | ba7fdc5b14b925971c6358de67dae4d06199b6e5 (patch) | |
tree | 567e2c7918a15e14fbf8f0f153acee8948c45b52 /configure.ac | |
parent | 61acbc23ac6baa2fca4354e14ab3b779a868ae6b (diff) | |
download | memcached-ba7fdc5b14b925971c6358de67dae4d06199b6e5.tar.gz |
add tests to detect ARM CPU alignment issues
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 6298d2d..f9094a2 100644 --- a/configure.ac +++ b/configure.ac @@ -396,9 +396,15 @@ AC_DEFUN([AC_C_ALIGNMENT], #include <inttypes.h> ], [ char *buf = malloc(32); + uint64_t *ptr = (uint64_t*)(buf+2); + // catch sigbus, etc. *ptr = 0x1; - return 0; + + // catch unaligned word access (ARM cpus) + *buf = 1; *(buf +1) = 2; *(buf + 2) = 2; *(buf + 3) = 3; *(buf + 4) = 4; + int* i = (int*)(buf+1); + return (84148994 == i) ? 0 : 1; ]) ],[ ac_cv_c_alignment=none |