I know how to use mbedtls when building a project in PlatformIO.
I want to modify the mbedtls code so that when PlatformIO builds, it uses the modified mbedtls.a file that I created.
Currently, I have cloned the mbedtls repository from GitHub, modified the code, and after running cmake and make, I placed the resulting libmbedtls.a, libmbedcrypto.a, and libmbedx509.a files in the Project/lib directory. I also added the following build_flags:
build_flags=-Llib -lmbedtls -lmbedcrypto -lmbedx509
However, I encountered a massive number of error codes.
Some of the errors include:
/Users/hanho/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/hanho/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libmbedtls_2.a(ssl_cli.c.obj): in function `ssl_parse_new_session_ticket':
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/ssl_cli.c:4182: undefined reference to `mbedtls_free'
/Users/hanho/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/mbedtls/mbedtls/library/ssl_cli.c:4183: undefined reference to `mbedtls_calloc'
/Users/hanho/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/hanho/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libmbedtls_2.a(ssl_srv.c.obj):(.literal.ssl_parse_client_dh_public+0x0): undefined reference to `mbedtls_dhm_read_public'
/Users/hanho/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/hanho/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libmbedtls_2.a(ssl_srv.c.obj):(.literal.ssl_parse_client_psk_identity+0xc): undefined reference to `mbedtls_ct_memcmp'
/Users/hanho/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/hanho/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libmbedtls_2.a(ssl_srv.c.obj):(.literal.ssl_parse_encrypted_pms+0x8): undefined reference to `mbedtls_pk_get_bitlen'
/Users/hanho/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/hanho/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libmbedtls_2.a(ssl_srv.c.obj):(.literal.ssl_parse_encrypted_pms+0xc): undefined reference to `mbedtls_pk_can_do'
/Users/hanho/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/hanho/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libmbedtls_2.a(ssl_srv.c.obj):(.literal.ssl_parse_encrypted_pms+0x10): undefined reference to `mbedtls_pk_decrypt'