-
Notifications
You must be signed in to change notification settings - Fork 275
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
Cross compile for no_std environment build is failing at linking #598
Comments
It's difficult to see what's happening since even But the short answer is that yes, you should be compiling libsecp via But having said this, your existing setup should Just Work, using I checked my local copy of |
@apoelstra IIRC you need to use a forked compiler for ESP (for now, until they upstream it). |
@Kixunil is correct, ESP uses needs a forked compiler. Running
I'll try the step @apoelstra mentioned of compiling with |
My guess is that if you compile with that flag, you'll get link errors of the form My guess about the original issue is that the ESP compiler is somehow incompatible with the link symbol shenanigans we do in this library ... though I have no idea who is at fault. |
I'd guess this should be job for |
Yeah, the |
@isaac-asdf if you want to do that, you could try depending on |
@isaac-asdf maybe you could first run their tests on ESP and see if anything fails, if it does report it to them, if it doesn't then it may be actually our problem. |
The code I have compiles and runs as long as the signature portion is commented out. I'm testing if I can get it to compile and run with just including a more basic C function to see if it's just an xtensa linking issue with |
The issue appears to be coming from the combo of |
@isaac-asdf |
Yeah, I was able to get it functional. If you check out
github.com/isaac-asdf/esp32-nostr-client you can see a project I used it
on. The nostr-nostd dependency is where I actually pull in secp256k1, and
the key to getting it compiling is explained in the Setup on the readme.
(Setting the CC and AR environment variables)
Let me know if you have any questions on that
…On Thu, Aug 29, 2024 at 4:24 AM glove ***@***.***> wrote:
@isaac-asdf <https://github.com/isaac-asdf>
image.png (view on web)
<https://github.com/user-attachments/assets/8f3d0f08-78b7-4c30-923c-c922860edbed>
hi,Did you resolve your issue in the end?
I'm encountering compatibility issues with secp256k1 while linking a Rust
static library for ESP32. and I found the following message:
'c928380082b86401-secp256k1.o: file format not recognized'.
—
Reply to this email directly, view it on GitHub
<#598 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXFPMRQTUIKP4HIXL76ZL43ZT3SGPAVCNFSM6AAAAABNJ75LWKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJXGEZTGNZUGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thank you for your help, I will go and give it a try. |
I posted this in the hal crate for the microcontroller I'm working with ESP32, but will cross post here in case it's something I'm just doing wrong with the initial set up. Am I supposed to build the C library manually, or use the crate
secp256k1-sys
to build the the library for use? I'm getting errors for the functions I'm calling that look like: undefined reference to 'rustsecp256k1_v0_8_1_schnorrsig_sign'
Source code for project
The text was updated successfully, but these errors were encountered: