Land #604, Get __STRICT_ALIGNMENT from machine/endian.h
This commit is contained in:
commit
693d4575e2
14
configure.ac
14
configure.ac
@ -75,26 +75,12 @@ AC_ARG_ENABLE([tests],
|
|||||||
[enable_tests="yes"])
|
[enable_tests="yes"])
|
||||||
AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = xyes])
|
AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = xyes])
|
||||||
|
|
||||||
# Add CPU-specific alignment flags
|
|
||||||
old_cflags=$CFLAGS
|
|
||||||
CFLAGS="$CFLAGS -I$srcdir/include"
|
|
||||||
AC_MSG_CHECKING([if BSWAP4 builds without __STRICT_ALIGNMENT])
|
|
||||||
AC_TRY_COMPILE([#include "$srcdir/crypto/modes/modes_lcl.h"],
|
|
||||||
[int a = 0; BSWAP4(a);],
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
BSWAP4=yes,
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
BSWAP4=no)
|
|
||||||
CFLAGS="$old_cflags"
|
|
||||||
|
|
||||||
AS_CASE([$host_cpu],
|
AS_CASE([$host_cpu],
|
||||||
[*sparc*], [CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT"],
|
|
||||||
[*arm*], [host_cpu=arm],
|
[*arm*], [host_cpu=arm],
|
||||||
[*amd64*], [host_cpu=x86_64 HOSTARCH=intel],
|
[*amd64*], [host_cpu=x86_64 HOSTARCH=intel],
|
||||||
[i?86], [HOSTARCH=intel],
|
[i?86], [HOSTARCH=intel],
|
||||||
[x86_64], [HOSTARCH=intel]
|
[x86_64], [HOSTARCH=intel]
|
||||||
)
|
)
|
||||||
AS_IF([test "x$BSWAP4" = "xyes" -a "$host_cpu" = "arm" ],,CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT")
|
|
||||||
AM_CONDITIONAL([HOST_CPU_IS_INTEL], [test "x$HOSTARCH" = "xintel"])
|
AM_CONDITIONAL([HOST_CPU_IS_INTEL], [test "x$HOSTARCH" = "xintel"])
|
||||||
|
|
||||||
AC_MSG_CHECKING([if .gnu.warning accepts long strings])
|
AC_MSG_CHECKING([if .gnu.warning accepts long strings])
|
||||||
|
@ -37,4 +37,15 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __STRICT_ALIGNMENT
|
||||||
|
#define __STRICT_ALIGNMENT
|
||||||
|
#if defined(__i386) || defined(__i386__) || \
|
||||||
|
defined(__x86_64) || defined(__x86_64__) || \
|
||||||
|
defined(__s390__) || defined(__s390x__) || \
|
||||||
|
defined(__aarch64__) || \
|
||||||
|
((defined(__arm__) || defined(__arm)) && __ARM_ARCH >= 6)
|
||||||
|
#undef __STRICT_ALIGNMENT
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user