1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-05 19:35:48 +03:00

Tidy up UBSan detection

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Dave Rodgman
2022-11-23 17:16:57 +00:00
parent 468df317bf
commit a6778013b4

View File

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