-
Notifications
You must be signed in to change notification settings - Fork 0
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
support esp32 #4
Conversation
These changes look reasonable to me, but I don't understand why it fixes things :) Does this fix the error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working on jenkins. I was able to run it on my mac as well (it was broken before).
I'd be curious to hear more about how you setup your system to build littlefs2-sys in isolation.
I guess we don't have a good way of highlighting when the build is using a system include file instead of the .embuild version.
Yes, in my testing, although I'm not exactly sure how! That error seems to be a common consequence of misconfiguration of the toolchain location during cross-compilation. Online, I see a lot of references to compilation issues when compiling for the same host OS at a different bit-depth, f.e. https://stackoverflow.com/questions/54082459/fatal-error-bits-libc-header-start-h-no-such-file-or-directory-while-compili, where the user appears to be building for 32-bit Linux on a 64-bit Linux machine that doesn't have the 32-bit headers/libraries (for which the solution is to install gcc-multilib). In our case, we're compiling for an xtensa target on a Linux host, and that error presumably indicates some kind of misconfiguration of the target toolchain location. I'm not sure which change on this branch resolves that specific issue, but it may be the embuild build dependency, which perhaps sets some environment variables needed to locate the toolchain. Perhaps it's worth teasing out these changes to determine which one resolves that specific problem, or getting feedback from Espressif Rust folk about the optimal way to cross-compile C code in Rust -sys crates like this one for xtensa targets. |
@nathan-whittington : Since you've approved this and this is a repo you've been working primarily in, I think you should feel welcome to merged this PR as you like. |
With the Espressif toolchains (Rust, GCC, Clang) all installed on my system, I can clone this repo and issue a command like this to build it for my favorite esp32 target:
This is obviously suboptimal, as it requires the user to manually set LIBCLANG_PATH and PATH appropriately (as well as to specify When compiling a C project for an esp32 target with ESP-IDF, you'd |
Sourcing the |
A few things:
runtime
feature to bindgen (so it's enabled when littlefs2-sys is built in isolation);These changes enable me to build littlefs2-sys in isolation for esp32s3 on both my macOS host and in an Ubuntu Docker container (running on the macOS host). It should probably be made more general, as right now it's specific to esp32s3 rather than esp32*.
As well, some version of these changes could probably be upstreamed to fix https://github.com/nickray/littlefs2/issues/18 (which is filed in the littlefs2 project although it probably needs to be fixed in littlefs2-sys), but a look at https://github.com/nickray/littlefs2-sys/pulls makes me wonder if the project is being actively maintained anymore.