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

cannot find macro llvm_asm in this scope #38

Closed
zag2art opened this issue Jan 30, 2022 · 10 comments
Closed

cannot find macro llvm_asm in this scope #38

zag2art opened this issue Jan 30, 2022 · 10 comments

Comments

@zag2art
Copy link

zag2art commented Jan 30, 2022

hi, getting this during compiling

cargo build -Z build-std=core --target avr-atmega328p.json --release
...

   Compiling avr_delay v0.3.1
error: cannot find macro `llvm_asm` in this scope
  --> /Users/zag2art/.cargo/registry/src/github.com-1ecc6299db9ec823/avr_delay-0.3.1/src/lib.rs:34:17
   |
34 |         unsafe {llvm_asm!("1: sbiw $0,1
   |                 ^^^^^^^^

error: cannot find macro `llvm_asm` in this scope
  --> /Users/zag2art/.cargo/registry/src/github.com-1ecc6299db9ec823/avr_delay-0.3.1/src/lib.rs:41:13
   |
41 |     unsafe {llvm_asm!("1: sbiw $0,1
   |             ^^^^^^^^

is that an avr_delay issue or this blink project?

Note: compiling this on Mac folowing "The AVR-Rust Guidebook"

@stappersg
Copy link
Member

stappersg commented Jan 30, 2022 via email

@zag2art
Copy link
Author

zag2art commented Jan 30, 2022

@stappersg
Copy link
Member

It is avr-rust/delay#10

@stappersg
Copy link
Member

For what it is worth

    ...
   Compiling avr-config v1.0.0
   Compiling avr-config v2.0.1
   Compiling avr-std-stub v1.0.2
   Compiling avr_delay v0.3.1
   Compiling blink v0.1.0 (/usr/src/rust/avr/blink)
    Finished release [optimized] target(s) in 33.68s
stappers@paddy:/usr/src/rust/avr/blink
$ cargo build -Z build-std=core --target avr-atmega328p.json --release
    Finished release [optimized] target(s) in 0.11s
stappers@paddy:/usr/src/rust/avr/blink
$ history | tail -n 6
 2070  rustup override set nightly-2021-01-07
 2071  cargo build -Z build-std=core --target avr-atmega328p.json --release
 2072  rustup component add rust-src
 2073  cargo build -Z build-std=core --target avr-atmega328p.json --release
 2074  cargo build -Z build-std=core --target avr-atmega328p.json --release
 2075  history | tail -n 6
stappers@paddy:/usr/src/rust/avr/blink
$ 

@zag2art
Copy link
Author

zag2art commented Jan 31, 2022

Thanks, that helped

rustup override set nightly-2021-01-07
rustup component add rust-src
cargo build -Z build-std=core --target avr-atmega328p.json --release

Looks like it works only with nightly-2021-01-07 release.

@zag2art zag2art closed this as completed Jan 31, 2022
@stappersg
Copy link
Member

Re-opened.
To prevent new reports of it.

Those who are also bitten by this issue (can|should) put updates here.

@ShaneEverittM
Copy link

So currently the only solution is to use an old nightly compiler? Is the ultimate goal to change the implementation to not depend on llvm_asm!?

@stappersg
Copy link
Member

The ultimate goal is a good live.

So currently the only solution is to use an old nightly compiler? Is the ultimate goal to change the implementation to not depend on llvm_asm!?

Yes. Indeed.

How long currently will exist is unknown. ( It is unknown to me how the LLVM project moves forward )
Known there are workaround projects such as https://www.reddit.com/r/rust/comments/tvtxpv/custom_rust_toolchain_for_avr/

@stappersg
Copy link
Member

OKay, LLVM project moved forward, the blocking bug is closed.

@mbuesch did Fix build: Use the new rust asm! available in rustc 1.63.0-nightly and advised me on releasing avr_delay crate.

@stappersg
Copy link
Member

Insteadof crates at https://crates.io are "crates" in git repositories used.

The error cannot find macro llvm_asm in this scope is solved.

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

3 participants