1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

Fix regression issue for clang workaround.

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu
2023-02-22 11:01:07 +08:00
parent ba4ec24c79
commit 4d786a732b
2 changed files with 10 additions and 15 deletions

View File

@ -30,10 +30,12 @@
* The intrinsic declaration are guarded with ACLE predefined macros in clang,
* and those macros are only enabled with command line. Define the macros can
* enable those declaration and avoid compile error on it.
*
* `arm_neon.h` might be included in any head files. On the top of this file, we
* can guarantee this workaround always work.
*/
#define __ARM_FEATURE_SHA512 1
#pragma clang attribute push (__attribute__((target("crypto"))), apply_to=function)
#define MBEDTLS_POP_TARGET_PRAGMA
#define NEED_TARGET_OPTIONS
#endif /* __aarch64__ && __clang__ &&
!__ARM_FEATURE_SHA512 && __clang_major__ < 18 &&
__clang_major__ >= 13 && __clang_minor__ > 0 &&
@ -84,7 +86,7 @@
* Clang == 13.0.0 same as clang 12 (only seen on macOS)
* Clang >= 13.0.1 has __ARM_FEATURE_SHA512 and intrinsics
*/
# if !defined(__ARM_FEATURE_SHA512)
# if !defined(__ARM_FEATURE_SHA512) || defined(NEED_TARGET_OPTIONS)
/* Test Clang first, as it defines __GNUC__ */
# if defined(__clang__)
# if __clang_major__ < 7