From 5103f6dd41db8cc7bac62a6160d3e803596de56d Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 23 Jul 2017 11:14:02 -0400 Subject: [PATCH] Remove gyrations around CRYPTOPP_NO_UNALIGNED_DATA_ACCESS CRYPTOPP_NO_UNALIGNED_DATA_ACCESS was required in Crypto++ 5.6 and earlier because unaligned data access was the norm. It caused problems at -O3 and on ARM NEON. At Crypto++ 6.0 no unaligned data access became a first class citizen. Folks who want to allow it must now define CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS --- config.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/config.h b/config.h index 6a9c8711..32884f22 100644 --- a/config.h +++ b/config.h @@ -54,11 +54,9 @@ # endif #endif -// Define this to ensure C/C++ standard compliance and respect for GCC aliasing rules and other alignment fodder. If you -// experience a break with GCC at -O3, you should try this first. Guard it in case its set on the command line (and it differs). -#ifndef CRYPTOPP_NO_UNALIGNED_DATA_ACCESS -# define CRYPTOPP_NO_UNALIGNED_DATA_ACCESS -#endif +// Define this to allow unaligned data access. If you experience a break with +// GCC at -O3, you should immediately suspect unaligned data accesses. +// #define CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS // ***************** Less Important Settings *************** @@ -580,12 +578,6 @@ NAMESPACE_END #define CRYPTOPP_BOOL_ARM64 0 #endif -#if !defined(CRYPTOPP_NO_UNALIGNED_DATA_ACCESS) && !defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) -#if (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || defined(__powerpc__) || (__ARM_FEATURE_UNALIGNED >= 1)) - #define CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS -#endif -#endif - // ***************** Initialization and Constructor priorities ******************** // CRYPTOPP_INIT_PRIORITY attempts to manage initialization of C++ static objects.