diff --git a/components/mbedtls/CMakeLists.txt b/components/mbedtls/CMakeLists.txt index bb1c11f8df..4e758632a5 100644 --- a/components/mbedtls/CMakeLists.txt +++ b/components/mbedtls/CMakeLists.txt @@ -1,11 +1,13 @@ idf_build_get_property(idf_target IDF_TARGET) idf_build_get_property(python PYTHON) +if(NOT ${IDF_TARGET} STREQUAL "linux") set(priv_requires soc esp_hw_support) if(NOT BOOTLOADER_BUILD) list(APPEND priv_requires esp_pm) endif() +endif() set(mbedtls_srcs "") set(mbedtls_include_dirs "port/include" "mbedtls/include" "mbedtls/library") @@ -120,6 +122,10 @@ set(mbedtls_target_sources ${mbedtls_target_sources} "${COMPONENT_DIR}/port/dynamic/esp_ssl_tls.c") endif() +if(${IDF_TARGET} STREQUAL "linux") +set(mbedtls_target_sources ${mbedtls_target_sources} "${COMPONENT_DIR}/port/net_sockets.c") +endif() + # net_sockets.c should only be compiled if BSD socket functions are available. # Do this by checking if lwip component is included into the build. idf_build_get_property(build_components BUILD_COMPONENTS) @@ -180,7 +186,6 @@ endif() target_sources(mbedcrypto PRIVATE "${COMPONENT_DIR}/port/esp_hardware.c" "${COMPONENT_DIR}/port/esp_mem.c" "${COMPONENT_DIR}/port/esp_timing.c" - "${COMPONENT_DIR}/port/sha/esp_sha.c" ) if(CONFIG_SOC_AES_SUPPORTED) @@ -191,7 +196,9 @@ if(CONFIG_SOC_AES_SUPPORTED) endif() if(CONFIG_SOC_SHA_SUPPORTED) - target_sources(mbedcrypto PRIVATE "${COMPONENT_DIR}/port/sha/${SHA_PERIPHERAL_TYPE}/sha.c") + target_sources(mbedcrypto PRIVATE "${COMPONENT_DIR}/port/sha/esp_sha.c" + "${COMPONENT_DIR}/port/sha/${SHA_PERIPHERAL_TYPE}/sha.c" + ) endif() # CONFIG_ESP_TLS_USE_DS_PERIPHERAL can be enabled only for the supported targets. diff --git a/components/mbedtls/esp_crt_bundle/esp_crt_bundle.c b/components/mbedtls/esp_crt_bundle/esp_crt_bundle.c index b0b144c294..2da3850087 100644 --- a/components/mbedtls/esp_crt_bundle/esp_crt_bundle.c +++ b/components/mbedtls/esp_crt_bundle/esp_crt_bundle.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ #include -#include +#include #include "esp_crt_bundle.h" #include "esp_log.h" diff --git a/components/mbedtls/port/net_sockets.c b/components/mbedtls/port/net_sockets.c index aa6455497b..6736cb32c6 100644 --- a/components/mbedtls/port/net_sockets.c +++ b/components/mbedtls/port/net_sockets.c @@ -34,6 +34,8 @@ #include #include #include +#include +#include /* * Prepare for using the sockets interface