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

undefined reference to `mbedtls_debug_set_threshold' when MBEDTLS_DEBUG is enabled #14633

Closed
laperie opened this issue Mar 18, 2019 · 7 comments
Assignees
Labels
area: Networking area: Security Security bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@laperie
Copy link
Collaborator

laperie commented Mar 18, 2019

Describe the bug
Cannot enable debugging of MBEDTLS. Something is rotten in the state of Denmark. (C) Shakespeare

To Reproduce
Steps to reproduce the behavior:

  1. in Default for TLS_PEER_VERIFY socket option are set to required, may lead to confusion when running samples against self-signed certs #14632, enable MBEDTLS_DEBUG
  2. build
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots or console output

/opt/zephyr-sdk/i586-zephyr-elf/bin/../lib/gcc/i586-zephyr-elf/8.3.0/../../../../i586-zephyr-elf/bin/ld: libzephyr.a(sockets_tls.c.obj): in function `tls_init':
/home/laperie/workspace/zephyr/zephyr/subsys/net/lib/sockets/sockets_tls.c:289: undefined reference to `mbedtls_debug_set_threshold'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:99: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1

Environment (please complete the following information):
Linux
0.10.0 SDK

@laperie laperie added bug The issue is a bug, or the PR is fixing a bug area: Networking area: Security Security labels Mar 18, 2019
@laperie laperie added priority: medium Medium impact/importance bug priority: low Low impact/importance bug and removed priority: medium Medium impact/importance bug labels Mar 18, 2019
@rlubos
Copy link
Contributor

rlubos commented Mar 19, 2019

Hi @laperie, I've seen this issue before. It seems that make does not rebuild mbedTLS in case Zephyr configuration is changed (in this case mbedTLS debug enabled). When I used make, I forced it to rebuild entire project with make clean && make after changing mbedTLS configuration.

Apparently this is not an issue when using ninja - it seems to understand better what needs to be rebuilt.

@laperie
Copy link
Collaborator Author

laperie commented Mar 19, 2019

Hi @laperie, I've seen this issue before. It seems that make does not rebuild mbedTLS in case Zephyr configuration is changed (in this case mbedTLS debug enabled). When I used make, I forced it to rebuild entire project with make clean && make after changing mbedTLS configuration.

Cannot confirm that, sorry -- same symptoms no matter what you use to build the sample. Problem is likely elsewhere...

@jukkar
Copy link
Member

jukkar commented Mar 20, 2019

I have not used public server like in the example as I do not have direct internet access from my test host. So I used simple python https server with self certified certificate, could that self cert be the culprit here?

@rlubos
Copy link
Contributor

rlubos commented Mar 20, 2019

@jukkar I suppose the above comment reffered to #14632?

@jukkar
Copy link
Member

jukkar commented Mar 20, 2019

Ah, sorry, I seemed to have commented wrong issue :)

@jukkar
Copy link
Member

jukkar commented May 22, 2019

I just tried this and did not see any issues -> closing.

@jukkar jukkar closed this as completed May 22, 2019
@hraftery
Copy link

hraftery commented Jun 6, 2024

Adding the mysterious CONFIG_MBEDTLS_DEBUG_C fixes it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking area: Security Security bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

5 participants