Conversation
This is largely just copying over the existing work done by @ivmarkov for mbedtls-rs-sys. This commit does not enable the use of clang yet because without a sysroot there's little reason to use it. A subsequent commit will introduce a sysroot so clang can be used by default.
e535236 to
f9e7147
Compare
Interested to see the linker issues. W.r.t. linking, there should be no differences between compiling with GCC and compiling with CLang, I believe. In either case we don't really link with any form of "native" "embedded" libc (or try hard not to!). In either case, we should link against the ESP ROM ( |
|
@ivmarkov, that was some great timing. I just finished updating the description after you added your comment.
Yeah, the linking issue was entirely an oversight on my part. The sysroot headers were missing the |
|
Here's the list of undefined symbols across all archive files in the openthread-sys build directory for |
f9e7147 to
7036a9d
Compare
|
Those get pulled in by the 'openthread-platform-utils' library. I'm pretty sure we don't even need this library, but there's currently no way to exclude it from compilation.
I agree with this, but I feel like the situation is currently not as clear-cut. |
But the question remains how come this is not a problem when compiling with GCC? In other words, who is providing these symbols in the first place?
The As for iscntrl, isprint and isupper - these were either remnants from before the "use tinyrlibc to backfill" mantra was introduced OR tinyrlibc does not have an impl of those.
I agree. We can fix the tech debt from above later, as long as ESP (and NRF!) examples do compile cleanly. But this is tested by the CI anyway. |
I should've maybe clarified a bit further. The list of symbols is simply the entire set of undefined symbols in the libraries (specifically all the object files in the various "lib*.a" archive files). Whether or not these symbols are actually needed entirely depends on whether we end up calling a function that directly or indirectly uses one of the symbols. For reference, here's the same list generated from the pre-compiled archive files that are currently checked in on the main branch: Notice how the list is pretty much the same. The only notable difference is that the pre-compiled archives use the So for example, |
|
OK - just mark it as ready for review when you believe it is ready. |
7036a9d to
e983731
Compare
e983731 to
b901221
Compare
I forgot to update the xtask code in <esp-rs#60>, breaking it.
I forgot to update the xtask code in <#60>, breaking it.
Closes: #51
Verified by running the
srpexample on an esp32c6 while hosting the network using ot_cli on an esp32c5:Old progress updates
This PR is still not quite finished. The current status is that we can compile the library with the sysroot, but actually building the ESP example is failing due to linker issues. This is totally expected though.
Update 1:
Funnily enough the linker errors were caused by me not using
extern "C"blocks in the headers. Since OpenThread is mostly C++ code it actually makes a difference for once.So at this point the ESP examples both compile and link. I just need access to an ESP to test it on. Should be able to do that tomorrow.
There are some symbols like
exitand the assertion fail handlerotPlatAssertFailthat we don't define yet. Apparently they aren't required for the examples. I'll have to dig into those a bit to see under what conditions we actually need them.