Skip to content

Commit 7f42511

Browse files
authored
Merge pull request #14529 from LDong-Arm/cmake_MULADDC
CMake: Fix Mbed TLS compilation on Cortex-M0/0+/1/M23
2 parents 1fd4cfd + 86e7bc5 commit 7f42511

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

connectivity/mbedtls/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,20 @@ target_compile_definitions(mbed-mbedtls
102102
INTERFACE
103103
MBED_CONF_MBEDTLS_PRESENT=1
104104
)
105+
106+
# Workaround for https://github.com/ARMmbed/mbedtls/issues/1077
107+
# which affects cores without __thumb2__ set by the compiler
108+
# due to the lack of full Thumb-2 support
109+
set(partial-thumb2-cores
110+
Cortex-M0
111+
Cortex-M0+
112+
Cortex-M1
113+
Cortex-M23
114+
Cortex-M23-NS
115+
)
116+
if(MBED_CPU_CORE IN_LIST partial-thumb2-cores)
117+
target_compile_definitions(mbed-mbedtls
118+
INTERFACE
119+
MULADDC_CANNOT_USE_R7
120+
)
121+
endif()

tools/cmake/profiles/debug.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ function(mbed_set_profile_options target mbed_toolchain)
7878
target_compile_definitions(${target}
7979
INTERFACE
8080
__ASSERT_MSG
81-
MULADDC_CANNOT_USE_R7
8281
)
8382
endif()
8483

0 commit comments

Comments
 (0)