Comments (9)
Hm, I am a bit lost here... The error message makes me believe your LLVM was not compiled with the AVR target enabled. But rustup is supposed to ship vendored LLVM instead of relying on something from the distro? Does this work differently on gentoo maybe?
from avr-hal.
The AVR target is enabled:
[ebuild R ] sys-devel/llvm-15.0.6-r1:15::gentoo USE="binutils-plugin libffi ncurses xml -debug -doc -exegesis -libedit -test -verify-sig -xar -z3 -zstd" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="(AArch64) (AMDGPU) (ARM) (AVR) (BPF) (Hexagon) (Lanai) (MSP430) (Mips) (NVPTX) (PowerPC) (RISCV) (Sparc) (SystemZ) (VE) (WebAssembly) (X86) (XCore) (-ARC) (-CSKY) (-DirectX) (-LoongArch) (-M68k) (-SPIRV)" 0 KiB
from avr-hal.
Ok I recompiled rust with llvm target use flags and this error dissapeared.
/etc/portage/package.use
---
>=dev-lang/rust-1.66.0:stable/1.66::gentoo llvm_targets_AVR llvm_targets_ARM
from avr-hal.
But now there is a different problem:
error[E0463]: can't find crate for `core`
|
= note: the `avr-atmega328p` target may not be installed
= help: consider downloading the target with `rustup target add avr-atmega328p`
error[E0463]: can't find crate for `compiler_builtins`
error: cannot find attribute `derive` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/bare-metal-1.0.0/src/lib.rs:50:3
|
50 | #[derive(Debug)]
| ^^^^^^
error[E0463]: can't find crate for `core`
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/nb-1.0.0/src/lib.rs:189:5
|
189 | use core::fmt;
| ^^^^ can't find crate
|
= note: the `avr-atmega328p` target may not be installed
= help: consider downloading the target with `rustup target add avr-atmega328p`
error: cannot find attribute `derive` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/bare-metal-1.0.0/src/lib.rs:15:3
|
15 | #[derive(Clone, Copy, Debug)]
| ^^^^^^
error: cannot find attribute `derive` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/nb-1.0.0/src/lib.rs:198:3
|
198 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
| ^^^^^^
error[E0463]: can't find crate for `core`
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/nb-1.0.0/src/lib.rs:192:27
|
192 | pub type Result<T, E> = ::core::result::Result<T, Error<E>>;
| ^^^^ can't find crate
|
= note: the `avr-atmega328p` target may not be installed
= help: consider downloading the target with `rustup target add avr-atmega328p`
error[E0405]: cannot find trait `Copy` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/vcell-0.1.3/src/lib.rs:31:18
|
31 | where T: Copy
| ^^^^ not found in this scope
error[E0405]: cannot find trait `Copy` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/vcell-0.1.3/src/lib.rs:39:18
|
39 | where T: Copy
| ^^^^ not found in this scope
error[E0405]: cannot find trait `Sync` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/bare-metal-1.0.0/src/lib.rs:87:16
|
87 | unsafe impl<T> Sync for Mutex<T> where T: Send {}
| ^^^^ not found in this scope
error[E0405]: cannot find trait `Send` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/bare-metal-1.0.0/src/lib.rs:87:43
|
87 | unsafe impl<T> Sync for Mutex<T> where T: Send {}
| ^^^^ not found in this scope
error[E0463]: can't find crate for `core`
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/ufmt-write-0.1.0/src/lib.rs:14:5
|
14 | core::mem::uninitialized()
| ^^^^ can't find crate
|
= note: the `avr-atmega328p` target may not be installed
= help: consider downloading the target with `rustup target add avr-atmega328p`
error[E0463]: can't find crate for `core`
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs:16:5
|
16 | extern crate core;
| ^^^^^^^^^^^^^^^^^^ can't find crate
|
= note: the `avr-atmega328p` target may not be installed
= help: consider downloading the target with `rustup target add avr-atmega328p`
error[E0405]: cannot find trait `FnOnce` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/nb-1.0.0/src/lib.rs:223:12
|
223 | F: FnOnce(E) -> T,
| ^^^^^^ not found in this scope
error[E0405]: cannot find trait `From` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/nb-1.0.0/src/lib.rs:232:9
|
232 | impl<E> From<E> for Error<E> {
| ^^^^ not found in this scope
error: cannot find attribute `derive` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs:28:3
|
28 | #[derive(Copy)]
| ^^^^^^
error[E0412]: cannot find type `Result` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/ufmt-write-0.1.0/src/lib.rs:27:41
|
27 | fn write_str(&mut self, s: &str) -> Result<(), Self::Error>;
| ^^^^^^ not found in this scope
error[E0412]: cannot find type `Result` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/ufmt-write-0.1.0/src/lib.rs:34:42
|
34 | fn write_char(&mut self, c: char) -> Result<(), Self::Error> {
| ^^^^^^ not found in this scope
error[E0405]: cannot find trait `Clone` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs:31:6
|
31 | impl Clone for Void {
| ^^^^^ not found in this scope
error[E0412]: cannot find type `Option` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs:56:37
|
56 | fn partial_cmp(&self, _: &T) -> Option<cmp::Ordering> {
| ^^^^^^ not found in this scope
error[E0405]: cannot find trait `Sized` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs:85:29
|
85 | pub trait ResultVoidExt<T>: Sized {
| ^^^^^ not found in this scope
error[E0412]: cannot find type `Result` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs:90:30
|
90 | impl<T> ResultVoidExt<T> for Result<T, Void> {
| ^^^^^^ not found in this scope
error[E0531]: cannot find tuple struct or tuple variant `Ok` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs:97:13
|
97 | Ok(val) => val,
| ^^ not found in this scope
error[E0531]: cannot find tuple struct or tuple variant `Err` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs:98:13
|
98 | Err(e) => unreachable(e)
| ^^^ not found in this scope
error[E0405]: cannot find trait `Sized` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs:104:32
|
104 | pub trait ResultVoidErrExt<E>: Sized {
| ^^^^^ not found in this scope
error[E0412]: cannot find type `Result` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs:109:33
|
109 | impl<E> ResultVoidErrExt<E> for Result<Void, E> {
| ^^^^^^ not found in this scope
error[E0531]: cannot find tuple struct or tuple variant `Ok` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs:116:13
|
116 | Ok(v) => unreachable(v),
| ^^ not found in this scope
error[E0531]: cannot find tuple struct or tuple variant `Err` in this scope
--> /home/w1png/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs:117:13
|
117 | Err(e) => e
| ^^^ not found in this scope
For more information about this error, try `rustc --explain E0463`.
Some errors have detailed explanations: E0405, E0463.
For more information about an error, try `rustc --explain E0405`.
error: could not compile `bare-metal` due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `cfg-if` due to 2 previous errors
Some errors have detailed explanations: E0405, E0412, E0463, E0531.
error: requires `receiver` lang_item
Some errors have detailed explanations: E0412, E0463.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `void` due to 14 previous errors
error: could not compile `vcell` due to 4 previous errors
error: could not compile `ufmt-write` due to 6 previous errors
error: could not compile `nb` due to 7 previous errors
error: requires `sized` lang_item
error: could not compile `cfg-if` due to 2 previous errors
error: could not compile `panic-halt` due to 3 previous errors
I tried running rustup target add avr-atmega328p
but it "does not contain component"
from avr-hal.
What project are you building and where from? You need to use build-std
to build libcore and friends alongside your code. This is usually achieved by some settings in .cargo/config.toml
:
avr-hal/examples/arduino-uno/.cargo/config.toml
Lines 1 to 8 in 4c9c44c
from avr-hal.
I am trying to run cargo run --bin uno-blink -- -P /dev/ttyUSB0
in arduino uno examples.
I also tried running the template repo.
from avr-hal.
Hm, and it is not picking up the cargo config? Can you try running this please:
cargo build -Zbuild-std=core --bin uno-blink
from avr-hal.
cargo build -Zbuild-std=core --bin uno-blink
output that I need to be running nightly version
After I tried every method to use nightly build using rustup nothing worked.
Then I checked the use flags again and it turned out that I needed to enable:
>=dev-lang/rust-1.66.0:stable/1.66::gentoo llvm_targets_AVR rust-src nightly
Everything works now. Thanks for your help :)
from avr-hal.
Also a quick recap for everyone who found this issue:
- Emerge rust with the following use flags:
llvm_targets_AVR llvm_targets_ARM rust-src nightly
- Init rustup:
rustup-init-gentoo -s
- Install the avr/arduino toolchain (wiki link)
from avr-hal.
Related Issues (20)
- ravedude should check rust target against selected MCU HOT 3
- Document clock type design in more detail HOT 1
- cargo build - error[E0658] - proc_macro::Literal::byte_character(byte) HOT 9
- can't find crate for `core` HOT 12
- cargo build - error[E0658] - proc_macro::Literal::byte_character(byte) HOT 4
- Very weird error when compiling a very basic program: __addsf3 multiple defenitions HOT 9
- Ravedude freezes on programmer uploading HOT 5
- Arduino Nano: avrdude error: programmer is not responding HOT 11
- Watchdog intterupt mode HOT 1
- [Solved] Cannot find `pwm` in `embedded_hal` HOT 2
- peripherals type alias HOT 2
- Enhance `avr_hal_generic::renamed_pins! {}` to also generate type aliases for each pin
- tier 3 target and broken HOT 6
- Utilising the `atmega2560`'s "USART in SPI Mode" HOT 10
- Issue with math calculations with floats to serial port output HOT 5
- Incorrect ADC readings after toolchain bump HOT 14
- Weird issue with two u8 ranged loops HOT 14
- error: no matching package named `avr-hal` found HOT 7
- Serial writes aren't working on `rustc 1.82.0-nightly (8e86c9567 2024-08-01)` HOT 10
- Possible miscompilation in LLVM HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avr-hal.