cty
cty copied to clipboard
Missing definitions for avr-unknown-gnu-atmega328
For the avr-unknown-gnu-atmega328 platform (which is tier 3 currently), no ad and pwd modules are defined, resulting in errors like
error[E0432]: unresolved import `ad`
--> /home/chrysn/.cargo/registry/src/github.com-1ecc6299db9ec823/cty-0.2.1/src/lib.rs:13:9
|
13 | pub use ad::*;
| ^^ maybe a missing crate `ad`?
error[E0432]: unresolved import `pwd`
--> /home/chrysn/.cargo/registry/src/github.com-1ecc6299db9ec823/cty-0.2.1/src/lib.rs:17:9
|
17 | pub use pwd::*;
| ^^^ maybe a missing crate `pwd`?
For more information about this error, try `rustc --explain E0432`.
I can probably provide a PR at a later point, right now I just encountered this, and want to document it so I can pick it up later.
@chrysn take a look at #21 and give some feedback if it helps with your problem.
It does fix the build issues. I'm stuck on https://github.com/rust-lang/compiler-builtins/issues/400 so can't do runtime evaluation of them right now. (The established workaround appears to be to use a 2021-01 nightly, but way too much in the rest of my environment has changed to support such an old nightly).
I do also get some errors from C2Rust when using this, as it expects c_ulong to be u16 (pointer-sized) but it arrives as u32, but that can easily be an error on its side. AVR manuals seem to confirm that unsigned long is conventionally 32 bit long there, so your patch seems to be right.
I assume everyone using Rust on AVR is stuck with nightly-2021-01-07 until that LLVM issue is sorted out.
Sorry, I really can only come back to this when AVR is supported on recent nightlies again; AIU the workaround would be building a patched LLVM and rustc from that, and AVR is a very small niche case for my applications...