最新版本的mbedtls需要按照README.md的要求去执行一次crypto code同步的git操作,执行完之后再去执行cmake. 或make均可以编译通过。
当前编译的环境安装python执行make check也可以测试通过当前的所有case.
README.md explain how to compile the new version mbedtls
Getting files form git: the Crypto submodule
The Mbed Crypto library now has its own git repository, which the Mbed
TLS build systems are using as a git submodule in order to build
libmbedcrypto as a subproject of Mbed TLS. When cloning the Mbed TLS
repository, you need to make sure you’re getting the submodule as
well:**git clone --recursive https://github.com/ARMmbed/mbedtls.git**
Alternatively, if you already have an existing clone of the Mbed TLS
repository, you can initialise and update the submodule with:**git submodule update --init crypto**
After these steps, your clone is now ready for building the libraries
as detailed in the following sections.Note that building libmbedcrypto as a subproject of Mbed TLS does not
enable the PSA-specific tests and utility programs. To use these
programs, build Mbed Crypto as a standalone project.Please note that for now, Mbed TLS can only use versions of
libmbedcrypto that were built as a subproject of Mbed TLS, not
versions that were built standalone from the Mbed Crypto repository.
This restriction will be removed in the future.
weihanwu@weihanwu-OptiPlex-990:~/mbedtls/mbedtls$ git submodule update --init crypto
Submodule ‘crypto’ (https://github.com/ARMmbed/mbed-crypto) registered for path ‘crypto’
Cloning into ‘crypto’…
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 80056 (delta 1), reused 1 (delta 0), pack-reused 80047
Receiving objects: 100% (80056/80056), 22.81 MiB | 402.00 KiB/s, done.
Resolving deltas: 100% (64725/64725), done.
Checking connectivity… done.
Submodule path ‘crypto’: checked out ‘0b3dd8d0249adb54abc7ad46303f3c22e44aefb7’
weihanwu@weihanwu-OptiPlex-990:~/mbedtls/mbedtls$
如果不执行git submodule update --init crypto会提示如下note的错误。
**
note:
**
weihanwu@weihanwu-OptiPlex-990:~/mbedtls/mbedtls$ cmake .
– Found PythonInterp: /usr/bin/python3 (found suitable version “3.5.2”, minimum required is “3”)
CMake Error at CMakeLists.txt:192 (add_subdirectory):
add_subdirectory given source “crypto/3rdparty” which is not an existing
directory.
CMake Error at CMakeLists.txt:199 (add_subdirectory):
add_subdirectory given source “crypto/library” which is not an existing
directory.
CMake Error at CMakeLists.txt:200 (add_subdirectory):
add_subdirectory given source “crypto/include” which is not an existing
directory.
– Found PythonInterp: /usr/bin/python3 (found version “3.5.2”)
CMake Error at CMakeLists.txt:214 (add_subdirectory):
add_subdirectory given source “crypto/tests” which is not an existing
directory.
– Configuring incomplete, errors occurred!
See also “/home/weihanwu/mbedtls/mbedtls/CMakeFiles/CMakeOutput.log”.
See also “/home/weihanwu/mbedtls/mbedtls/CMakeFiles/CMakeError.log”.
weihanwu@weihanwu-OptiPlex-990:~/mbedtls/mbedtls$