espressif / esp-homekit-sdk

541 stars 98 forks source link

mbedtls inclusion error, udnefined functions #119

Closed ZweiEuro closed 6 months ago

ZweiEuro commented 6 months ago

Hi!

After adding the components needed for homekit i am getting these linker errors:

 esp-idf/esp_phy/libesp_phy.a  -lphy  -lrtc  -u vfs_include_syscalls_impl  -mfix-esp32-psram-cache-issue  -mfix-esp32-psram-cache-strategy=memw && :
/home/zweieuro/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/esp_hap_platform/libesp_hap_platform.a(esp_mfi_sha.c.obj):(.literal.esp_mfi_sha512_new+0x4): undefined reference to `mbedtls_sha512_init'
/home/zweieuro/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/esp_hap_platform/libesp_hap_platform.a(esp_mfi_sha.c.obj):(.literal.esp_mfi_sha512_free+0x0): undefined reference to `mbedtls_sha512_free'
/home/zweieuro/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/esp_hap_platform/libesp_hap_platform.a(esp_mfi_sha.c.obj):(.literal.esp_mfi_sha512_init+0x0): undefined reference to `mbedtls_sha512_starts'
/home/zweieuro/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/esp_hap_platform/libesp_hap_platform.a(esp_mfi_sha.c.obj):(.literal.esp_mfi_sha512_update+0x0): undefined reference to `mbedtls_sha512_update'
/home/zweieuro/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/esp_hap_platform/libesp_hap_platform.a(esp_mfi_sha.c.obj):(.literal.esp_mfi_sha512_final+0x0): undefined reference to `mbedtls_sha512_finish'
/home/zweieuro/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/esp_hap_platform/libesp_hap_platform.a(esp_mfi_sha.c.obj): in function `esp_mfi_sha512_new':
/home/zweieuro/Documents/work/intertechno/master_gate/components/homekit/esp_hap_platform/src/esp_mfi_sha.c:214: undefined reference to `mbedtls_sha512_init'
/home/zweieuro/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/esp_hap_platform/libesp_hap_platform.a(esp_mfi_sha.c.obj): in function `esp_mfi_sha512_free':
/home/zweieuro/Documents/work/intertechno/master_gate/components/homekit/esp_hap_platform/src/esp_mfi_sha.c:228: undefined reference to `mbedtls_sha512_free'
/home/zweieuro/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/esp_hap_platform/libesp_hap_platform.a(esp_mfi_sha.c.obj): in function `esp_mfi_sha512_init':
/home/zweieuro/Documents/work/intertechno/master_gate/components/homekit/esp_hap_platform/src/esp_mfi_sha.c:245: undefined reference to `mbedtls_sha512_starts'
/home/zweieuro/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/esp_hap_platform/libesp_hap_platform.a(esp_mfi_sha.c.obj): in function `esp_mfi_sha512_update':
/home/zweieuro/Documents/work/intertechno/master_gate/components/homekit/esp_hap_platform/src/esp_mfi_sha.c:262: undefined reference to `mbedtls_sha512_update'
/home/zweieuro/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/esp_hap_platform/libesp_hap_platform.a(esp_mfi_sha.c.obj): in function `esp_mfi_sha512_final':
/home/zweieuro/Documents/work/intertechno/master_gate/components/homekit/esp_hap_platform/src/esp_mfi_sha.c:278: undefined reference to `mbedtls_sha512_finish'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

 *  The terminal process "/usr/bin/bash '-c', 'ninja '" terminated with exit code: 1. 

mbedtls is activated in my configuration and it seems everything is in order but the definition is missing. Target is esp32


As far as i can tell these are defined in: esp_mfi_sha.c but I don't have mfi activated at all since i am not using that variant

ZweiEuro commented 6 months ago

As expected I am just stupid. CONFIG_MBEDTLS_SHA512_C=y is required for those hashes to be compiled. enable them in the sdk and it works fine