-
Notifications
You must be signed in to change notification settings - Fork 78
Get rid of avr-libc
dependency
#76
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
Comments
This is an existing project archieving no libc dependence: https://github.com/shepmaster/rust-arduino-blink-led-no-core-with-cargo |
Any progress on this? |
No, unfortunately not. To be quite honest, I'm waiting for |
@Rahix I think with the compiler update we're getting to a position in which this is feasible. In particular, the change that adds
I can't elaborate this into a roadmap without actually picking it up to implement myself, and because of #157 I decided to post here first, in case someone wants to get it moving before that is merged. But I think what I wrote is enough for someone else to start, at least. Later I can help too if needed. |
Also check out the investigation @Patryk27 and @benshi001 have done in Rahix/avr-hal#471. It looked like the next steps were to add intrinsics to compiler-builtins but I believe that's blocked on support for AVR assembly. For linking we should see if we can take some inspiration from the cortex-m crates. |
fwiw, that's tracked over rust-lang/compiler-builtins#711 - recently I've added support for floating-point intrinsics, divrem, and a couple of others, and currently we're missing just four: rust-lang/compiler-builtins#711 (comment) It should be possible to implement them right now, even (using naked functions and assembly), I just didn't have time yet (but I'm planning on finding some in coming weeks). |
From what I could gather, the missing intrinsics aren't actually used, because LLVM casts to 32-bit instead of 16-bit in all known cases, right? If so, that shouldn't pose a problem for this thread. But I'll try to lend a hand and implement them, if I manage to do so in time. |
GCC provides dedicated intrinsics (as in "intrinsics that have arbitrary calling-convention that otherwise doesn't match anything else") for some 16-bit and 32-bit integer operations. LLVM doesn't emit calls to the 16-bit intrinsics, but the four 32-bit intrinsics ( |
I see, I thought those were the ones currently implemented, now it makes sense. |
Right now we use the CRT and other bits from
avr-libc
. Let's rewrite it in Rust, also to support devices whichavr-libc
currently does not support.The text was updated successfully, but these errors were encountered: