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

Fix esp-idf-sys#278 #211

Closed
wants to merge 1 commit into from
Closed

Conversation

ivmarkov
Copy link

@ivmarkov ivmarkov commented Jan 21, 2024

@MabezDev This is fixing this issue in esp-idf-sys.

The TL;DR is that xtensa GCC aligns 64 and 128 bit values at the 4 byte boundary, while our rust xtensa targets align these at their default, i.e. at the 8 and 16th byte boundary, which leads to rust panicking at runtime if it finds a GCC-provided structure, which - from its POV - is misaligned.

The fix is simply aligning (pun intended) the Rust/LLVM alignment spec with the one in xtensa GCC.

While this is crucial for the esp-idf-* crates (and therefore the -espidf targets), I suspect it might be a thing for the baremetal targets too, considering the WIFI and BLE blobs, as well as the mbed-tls usage on baremetal (whatever the status of that last project is).

Hence I touched these too.

Let me know if I have to rebase the PR against a different branch. Not really sure what is the git workflow policy of the esp-rs Rust fork these days.

@ivmarkov
Copy link
Author

Just to mention that I just noticed the only other open PR against esp-rs which happens to be on the exact same issue. Let me go through it...

@ivmarkov
Copy link
Author

Closing in favor of #195

@ivmarkov ivmarkov closed this Jan 21, 2024
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

Successfully merging this pull request may close these issues.

1 participant