Prevent unaligned access under ASan builds

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Dave Rodgman 2022-11-23 16:51:59 +00:00
parent 15531bc6d2
commit 1bab27f983

View file

@ -73,11 +73,12 @@ extern void (*mbedtls_test_hook_test_fail)( const char * test, int line, const c
*
* This list is incomplete.
*/
#if defined(__i386__) || defined(__amd64__) || defined( __x86_64__) \
#if (defined(__i386__) || defined(__amd64__) || defined( __x86_64__) \
|| defined(__ARM_FEATURE_UNALIGNED) \
|| defined(__aarch64__) \
|| defined(__ARM_ARCH_8__) || defined(__ARM_ARCH_8A__) || defined(__ARM_ARCH_8M__) \
|| defined(__ARM_ARCH_7A__)
|| defined(__ARM_ARCH_7A__)) \
&& (!(defined(__has_feature) && __has_feature(undefined_behavior_sanitizer)))
#define MBEDTLS_ALLOW_UNALIGNED_ACCESS
#endif