Skip to content

Commit

Permalink
Merge pull request #8079 from adeaarm/port_IAR_build_fix
Browse files Browse the repository at this point in the history
Small fixes for IAR support
  • Loading branch information
gilles-peskine-arm authored Aug 17, 2023
2 parents dbd13c3 + 8e9d6b9 commit eeaad50
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ if(CMAKE_COMPILER_IS_CLANG)
endif(CMAKE_COMPILER_IS_CLANG)

if(CMAKE_COMPILER_IS_IAR)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --warn_about_c_style_casts -Ohz")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --warn_about_c_style_casts")
set(CMAKE_C_FLAGS_RELEASE "-Ohz")
set(CMAKE_C_FLAGS_DEBUG "--debug -On")
endif(CMAKE_COMPILER_IS_IAR)

if(CMAKE_COMPILER_IS_MSVC)
Expand Down
2 changes: 1 addition & 1 deletion library/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1866,7 +1866,7 @@ int mbedtls_aes_self_test(int verbose)
#elif MBEDTLS_AESNI_HAVE_CODE == 2
mbedtls_printf(" AES note: AESNI code present (intrinsics implementation).\n");
#else
#error Unrecognised value for MBEDTLS_AESNI_HAVE_CODE
#error "Unrecognised value for MBEDTLS_AESNI_HAVE_CODE"
#endif
if (mbedtls_aesni_has_support(MBEDTLS_AESNI_AES)) {
mbedtls_printf(" AES note: using AESNI.\n");
Expand Down
2 changes: 1 addition & 1 deletion library/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static inline void mbedtls_xor_no_simd(unsigned char *r,
/* Normal case (64-bit pointers): use "r" as the constraint for pointer operands to asm */
#define MBEDTLS_ASM_AARCH64_PTR_CONSTRAINT "r"
#else
#error Unrecognised pointer size for aarch64
#error "Unrecognised pointer size for aarch64"
#endif
#endif

Expand Down
2 changes: 1 addition & 1 deletion library/constant_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static inline uint32_t mbedtls_get_unaligned_volatile_uint32(volatile const unsi
#elif defined(MBEDTLS_CT_AARCH64_ASM)
asm volatile ("ldr %w0, [%1]" : "=r" (r) : MBEDTLS_ASM_AARCH64_PTR_CONSTRAINT(p) :);
#else
#error No assembly defined for mbedtls_get_unaligned_volatile_uint32
#error "No assembly defined for mbedtls_get_unaligned_volatile_uint32"
#endif
return r;
}
Expand Down
2 changes: 1 addition & 1 deletion library/entropy_poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int mbedtls_platform_entropy_poll(void *data, unsigned char *output, size_t len,
return 0;
}
#else /* !_WIN32_WINNT_WINXP */
#error Entropy not available before Windows XP, use MBEDTLS_NO_PLATFORM_ENTROPY
#error "Entropy not available before Windows XP, use MBEDTLS_NO_PLATFORM_ENTROPY"
#endif /* !_WIN32_WINNT_WINXP */
#else /* _WIN32 && !EFIX64 && !EFI32 */

Expand Down
2 changes: 1 addition & 1 deletion library/psa_crypto_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extern "C" {
/* Sanity check: a file size must fit in 32 bits. Allow a generous
* 64kB of metadata. */
#if PSA_CRYPTO_MAX_STORAGE_SIZE > 0xffff0000
#error PSA_CRYPTO_MAX_STORAGE_SIZE > 0xffff0000
#error "PSA_CRYPTO_MAX_STORAGE_SIZE > 0xffff0000"
#endif

/** The maximum permitted persistent slot number.
Expand Down
2 changes: 1 addition & 1 deletion library/x509_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1599,7 +1599,7 @@ int mbedtls_x509_crt_parse_path(mbedtls_x509_crt *chain, const char *path)
cleanup:
FindClose(hFind);
#else /* !_WIN32_WINNT_XP */
#error mbedtls_x509_crt_parse_path not available before Windows XP
#error "mbedtls_x509_crt_parse_path not available before Windows XP"
#endif /* !_WIN32_WINNT_XP */
#else /* _WIN32 */
int t_ret;
Expand Down

0 comments on commit eeaad50

Please sign in to comment.