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

Missing definitions for avr-unknown-gnu-atmega328 #20

Open
chrysn opened this issue Sep 16, 2021 · 5 comments
Open

Missing definitions for avr-unknown-gnu-atmega328 #20

chrysn opened this issue Sep 16, 2021 · 5 comments

Comments

@chrysn
Copy link

chrysn commented Sep 16, 2021

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.

@mutantbob
Copy link

@chrysn take a look at #21 and give some feedback if it helps with your problem.

@chrysn
Copy link
Author

chrysn commented Feb 3, 2022

It does fix the build issues. I'm stuck on rust-lang/compiler-builtins#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).

@chrysn
Copy link
Author

chrysn commented Feb 3, 2022

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.

@mutantbob
Copy link

I assume everyone using Rust on AVR is stuck with nightly-2021-01-07 until that LLVM issue is sorted out.

@chrysn
Copy link
Author

chrysn commented Feb 12, 2022

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...

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

No branches or pull requests

2 participants