Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build with mbedTLS MPI acceleration disabled & wpa_supplicant mbedTLS enabled (IDFGH-3344) #5321

Closed
sle118 opened this issue May 19, 2020 · 3 comments

Comments

@sle118
Copy link

sle118 commented May 19, 2020

Environment

  • Development Kit: N/A
  • Kit version (for WroverKit/PicoKit/DevKitC): N/A
  • Module or chip used: ESP32-WROVER
  • IDF version (run git describe --tags to find it): v4.0-386-gb0f053d82
  • Build System: idf.py
  • Compiler version (run xtensa-esp32-elf-gcc --version to find it): 8.2.0
  • Operating System: Windows and Linux
  • (Windows only) environment type: Linux has the same issue
  • Using an IDE?: N/A
  • Power Supply: N/A

Problem Description

Build fails with the following errors

/home/user/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/wpa_supplicant/libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_mulmod+0x0): undefined reference to `esp_mpi_mul_mpi_mod'
/home/user/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/wpa_supplicant/libwpa_supplicant.a(crypto_mbedtls.c.obj): in function `crypto_bignum_mulmod':
/var/lib/jenkins/workspace/v4.0/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:177: undefined reference to `esp_mpi_mul_mpi_mod'

Expected Behavior

the project should link without an error

Actual Behavior

linking errors when building

Steps to reproduce

  1. Clone the following repository
  2. Build the project

Code to reproduce this issue

N/A

Debug Logs

N/A

Other items if possible

clone the squeezelite-esp32 project and try to build against the most recent esp-idf v4.0 commit

@github-actions github-actions bot changed the title Broken build Broken build (IDFGH-3344) May 19, 2020
@projectgus
Copy link
Contributor

Hi @sle118 ,

Thanks for providing this bug report.

To check I understand correctly: you're reporting this bug when building the master-cmake branch of this project with the described IDF version, yes?

It seems like there is a configuration combination which leads to build failure. The combination is:

We will fix this ASAP.

In the meantime, you can work around the bug by switching either of these config options (if possible to do so then enabling mbedTLS MPI acceleration is the recommended way - should result in smaller binary size and most MPI operations will be faster.)

@projectgus projectgus changed the title Broken build (IDFGH-3344) Can't build with mbedTLS MPI acceleration disabled & wpa_supplicant mbedTLS enabled (IDFGH-3344) May 20, 2020
@sle118
Copy link
Author

sle118 commented May 20, 2020

@projectgus ,

Thank you for pointing me to the configuration issue; I have changed the sdkconfig and this has resolved that linking problem. I chased the issue myself, but could not find a trace of the missing function anywhere. I guess this is because it's a chip function rather than an actual soft coded routine.

Thank you for being so responsive!

@sle118 sle118 closed this as completed May 20, 2020
@projectgus projectgus reopened this May 20, 2020
@projectgus
Copy link
Contributor

Hi @sle118,

Glad you were able to resolve the problem. This is still a bug in IDF (any configuration combination that's allowed should be able to build), so I'm going to keep the issue open for now. It'll be closed automatically when the fix is merged.

I chased the issue myself, but could not find a trace of the missing function anywhere. I guess this is because it's a chip function rather than an actual soft coded routine.

For reference of anyone who finds this issue looking for the same function, it's here (part of the port-specific layer for mbedTLS hardware acceleration, although in this case the function isn't part of the upstream mbedTLS API):
https://github.com/espressif/esp-idf/blob/release/v4.0/components/mbedtls/port/esp_bignum.c#L290

@igrr igrr closed this as completed in 0927ec0 Jun 12, 2020
projectgus added a commit that referenced this issue Jun 29, 2020
…re MPI

Also disable the relevant function in bignum.h based on config, so fails at
compile not link time.

Closes #5321
projectgus added a commit that referenced this issue Jul 22, 2020
…re MPI

Also disable the relevant function in bignum.h based on config, so fails at
compile not link time.

Closes #5321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants