mbedtls: fix mbed-psa link missing (#400)

mbed-psa provides one mbed psa implementation which mbedtls needs to link.
For example, mbedtls_hardware_poll (mbedtls mbed_trng.cpp) invokes trng_init
and friends which are implemented in mbed-psa psa_hrng.c.
pull/15531/head
ccli8 2024-12-06 16:36:52 +08:00 committed by GitHub
parent df28d42a77
commit c3f9a8ac07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -117,6 +117,12 @@ target_compile_definitions(mbed-mbedtls
target_link_libraries(mbed-mbedtls PUBLIC mbed-core-flags)
# Link Mbed's PSA implementation on enabled
if(("FEATURE_EXPERIMENTAL_API=1" IN_LIST MBED_TARGET_DEFINITIONS) AND
("FEATURE_PSA=1" IN_LIST MBED_TARGET_DEFINITIONS))
target_link_libraries(mbed-mbedtls PUBLIC mbed-psa)
endif()
# Workaround for https://github.com/ARMmbed/mbedtls/issues/1077
# which affects cores without __thumb2__ set by the compiler
# due to the lack of full Thumb-2 support