mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Add GCC options pop
Reduce the scope of target pragma to meet behavior of clang. Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
@ -57,7 +57,9 @@
|
|||||||
# if __GNUC__ < 6 /* TODO: check sha256 compatible for GCC */
|
# if __GNUC__ < 6 /* TODO: check sha256 compatible for GCC */
|
||||||
# error "A more recent GCC is required for MBEDTLS_SHA256_USE_A64_CRYPTO_*"
|
# error "A more recent GCC is required for MBEDTLS_SHA256_USE_A64_CRYPTO_*"
|
||||||
# else
|
# else
|
||||||
|
# pragma GCC push_options
|
||||||
# pragma GCC target ("arch=armv8-a+crypto")
|
# pragma GCC target ("arch=armv8-a+crypto")
|
||||||
|
# define MBEDTLS_POP_TARGET_PRAGMA
|
||||||
# endif
|
# endif
|
||||||
# else
|
# else
|
||||||
# error "Only GCC and Clang supported for MBEDTLS_SHA256_USE_A64_CRYPTO_*"
|
# error "Only GCC and Clang supported for MBEDTLS_SHA256_USE_A64_CRYPTO_*"
|
||||||
@ -381,7 +383,11 @@ int mbedtls_internal_sha256_process_a64_crypto(mbedtls_sha256_context *ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MBEDTLS_POP_TARGET_PRAGMA)
|
#if defined(MBEDTLS_POP_TARGET_PRAGMA)
|
||||||
|
#if defined(__clang__)
|
||||||
#pragma clang attribute pop
|
#pragma clang attribute pop
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#pragma GCC pop_options
|
||||||
|
#endif
|
||||||
#undef MBEDTLS_POP_TARGET_PRAGMA
|
#undef MBEDTLS_POP_TARGET_PRAGMA
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -86,7 +86,9 @@
|
|||||||
# if __GNUC__ < 8
|
# if __GNUC__ < 8
|
||||||
# error "A more recent GCC is required for MBEDTLS_SHA512_USE_A64_CRYPTO_*"
|
# error "A more recent GCC is required for MBEDTLS_SHA512_USE_A64_CRYPTO_*"
|
||||||
# else
|
# else
|
||||||
|
# pragma GCC push_options
|
||||||
# pragma GCC target ("arch=armv8.2-a+sha3")
|
# pragma GCC target ("arch=armv8.2-a+sha3")
|
||||||
|
# define MBEDTLS_POP_TARGET_PRAGMA
|
||||||
# endif
|
# endif
|
||||||
# else
|
# else
|
||||||
# error "Only GCC and Clang supported for MBEDTLS_SHA512_USE_A64_CRYPTO_*"
|
# error "Only GCC and Clang supported for MBEDTLS_SHA512_USE_A64_CRYPTO_*"
|
||||||
@ -567,7 +569,11 @@ int mbedtls_internal_sha512_process_a64_crypto(mbedtls_sha512_context *ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MBEDTLS_POP_TARGET_PRAGMA)
|
#if defined(MBEDTLS_POP_TARGET_PRAGMA)
|
||||||
|
#if defined(__clang__)
|
||||||
#pragma clang attribute pop
|
#pragma clang attribute pop
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#pragma GCC pop_options
|
||||||
|
#endif
|
||||||
#undef MBEDTLS_POP_TARGET_PRAGMA
|
#undef MBEDTLS_POP_TARGET_PRAGMA
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user