Skip to content

Error including BearSSL (error at end of compilation) #4801

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

Closed
tpotie opened this issue Jun 8, 2018 · 5 comments
Closed

Error including BearSSL (error at end of compilation) #4801

tpotie opened this issue Jun 8, 2018 · 5 comments

Comments

@tpotie
Copy link

tpotie commented Jun 8, 2018

Hello everyone!

I am trying to get BearSSL included and working in my project (was previously using AxTLS)

I am using PIO (have followed #4740) by including SD.h (also tried with ldf -> deep+)
ESP8266WiFi has been updated to latest from Git and the bearssl folder is placed in tools/sdk/include/

When compiling my program, it managed to go through everything until it blocks when linking everything:

Linking .pioenvs/nodemcuv2/firmware.elf
.pioenvs/nodemcuv2/libad5/libESP8266WiFi.a(WiFiClientSecureBearSSL.cpp.o):(.text.insecure_start_chain+0x8): undefined reference to `br_x509_decoder_init'
.pioenvs/nodemcuv2/libad5/libESP8266WiFi.a(WiFiClientSecureBearSSL.cpp.o):(.text.insecure_start_chain+0xc): undefined reference to `br_sha1_init'
.pioenvs/nodemcuv2/libad5/libESP8266WiFi.a(WiFiClientSecureBearSSL.cpp.o):(.text.insecure_start_chain+0x10): undefined reference to `br_sha256_init'
.pioenvs/nodemcuv2/libad5/libESP8266WiFi.a(WiFiClientSecureBearSSL.cpp.o): In function `insecure_start_chain':
WiFiClientSecureBearSSL.cpp:(.text.insecure_start_chain+0x2e): undefined reference to `br_x509_decoder_init'
WiFiClientSecureBearSSL.cpp:(.text.insecure_start_chain+0x3c): undefined reference to `br_sha1_init'

<snip>

Would anybody have any insights to this? :)

@earlephilhower
Copy link
Collaborator

Looks like it's missing libbearssl.a in the final link stage. It is included in the LIBS array in tools/platformio-build.py at

"wps", "bearssl", "axtls", "espnow", "smartconfig", "airkiss", "wpa2",

If your PIO instance is overriding that for some reason, or not using the script, then it won't have the new library.

@tpotie
Copy link
Author

tpotie commented Jun 8, 2018

Thank you for the very prompt reply! Yes that seemed to be part of the error.

I ended up updating the tools folder along with all the libraries again (in case I had missed out on some updates)

and when compiling, I now get
libraries/ESP8266WiFi/src/WiFiClientSecure.cpp:448:10: error: reference to 'SSLContext' is ambiguous

It doesn't seem to be liking the namespace definition in WiFiClientSecure.h?
(does anybody else get this error?)

@earlephilhower
Copy link
Collaborator

Please update the entire tree, not just subdirectories. The file you're getting an error in WiFiClientSecure.cpp no longer exists in the repo. There were massive changes over about 70 files, so unless they're all in sync it's just not going to work.

@tpotie
Copy link
Author

tpotie commented Jun 8, 2018

Sorry, I was wrestling with PIO wanting to replace the new repo (with the version it likes) everytime I did that

I got through that, updated to the latest repo and it compiled perfectly!

Thanks again for your quick responses! (And the work you've put into this)

@earlephilhower
Copy link
Collaborator

Good to hear it's working. Closing.

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