Skip to content

Commit

Permalink
CMake: Fix Mbed TLS compilation on Cortex-M0/0+/1
Browse files Browse the repository at this point in the history
Due to a known issue in Mbed TLS's architecture determination
(Mbed-TLS/mbedtls#1077), we get the error

    error: inline assembly requires more registers than available

when compiling `bignum.c` for Cortex-M0/0+/1,

The workaround is to define the macro `MULADDC_CANNOT_USE_R7` which
is already defined by Mbed CLI 1 but missing in our CMake support.

Fixes ARMmbed/mbed-os-example-lorawan#220
  • Loading branch information
LDong-Arm committed Apr 9, 2021
1 parent 35b8e55 commit 5f05845
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions connectivity/mbedtls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,6 @@ target_sources(mbed-mbedtls
target_compile_definitions(mbed-mbedtls
INTERFACE
MBED_CONF_MBEDTLS_PRESENT=1
# workaround for https://github.com/ARMmbed/mbedtls/issues/1077
MULADDC_CANNOT_USE_R7
)
1 change: 0 additions & 1 deletion tools/cmake/profiles/debug.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ function(mbed_set_profile_options target mbed_toolchain)
target_compile_definitions(${target}
INTERFACE
__ASSERT_MSG
MULADDC_CANNOT_USE_R7
)
endif()

Expand Down

0 comments on commit 5f05845

Please sign in to comment.