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

Rename MBEDTLS_OPTIMIZE_ALWAYS

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Dave Rodgman
2023-06-16 09:41:21 +01:00
parent 48fd2ab5d5
commit 9bb7e6f4ce
5 changed files with 14 additions and 11 deletions

View File

@ -240,11 +240,14 @@ static inline void mbedtls_xor_no_simd(unsigned char *r,
#define MBEDTLS_COMPILER_IS_GCC
#endif
/* If -Os is specified, override with -O2 for a given function */
/* For gcc -Os, override with -O2 for a given function.
*
* This will not affect behaviour for other optimisation settings, e.g. -O0.
*/
#if defined(MBEDTLS_COMPILER_IS_GCC) && defined(__OPTIMIZE_SIZE__)
#define MBEDTLS_OPTIMIZE_ALWAYS __attribute__((optimize("-O2")))
#define MBEDTLS_OPTIMIZE_FOR_PERFORMANCE __attribute__((optimize("-O2")))
#else
#define MBEDTLS_OPTIMIZE_ALWAYS
#define MBEDTLS_OPTIMIZE_FOR_PERFORMANCE
#endif
#endif /* MBEDTLS_LIBRARY_COMMON_H */