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

llvm_asm macro has been deprecated #10

Closed
ergpopler opened this issue Sep 24, 2020 · 10 comments
Closed

llvm_asm macro has been deprecated #10

ergpopler opened this issue Sep 24, 2020 · 10 comments

Comments

@ergpopler
Copy link

ergpopler commented Sep 24, 2020

llvm_asm! has been deprecated, and it no longer works...

and trying to get it to work makes it not work in other ways.

@dylanmckay
Copy link
Member

Hey there,

I notice that the llvm_asm! macro has been semi deprecated, but it still should be working.

It works for me with current master at 2b14a08 and up-to-date nightly compiler version:

rustc 1.49.0-nightly (07e968b64 2020-10-27)
cargo 1.49.0-nightly (dd83ae55c 2020-10-20)

I notice in rust-lang/rust#70173 that some time ago people temporarily started getting errors saying that llvm_asm! is gone, but that seems to be an old temporary rust nightly issue.

I can compile the crate fine on my machine.

Re. updating to the new asm! macro:

The Rust toolchain needs currently not-implemented target-specific support for enabling the asm! macro on AVR:

error[E0472]: asm! is unsupported on this target
  --> src/lib.rs:36:13
   |
36 |             asm!("nop");
   |             ^

What version of nightly are you using/does upgrading fix the problem?

@ArthurFleischman
Copy link

any improvements?

@dylanmckay
Copy link
Member

The llvm_asm macro should still work. I added an example in d9eff38 and it compiles on my machine fine. I vaguely remember that a temporary llvm_asm macro regression caused it to stop working around this time. The asm macro is still not supported by AVR.

@andrewshadura
Copy link

andrewshadura commented Feb 25, 2021

I’m getting an error with the latest nightly with both 0.3.1 and 0.3.2:

error: couldn't allocate input reg for constraint 'w'
  --> .../avr_delay-0.3.2/src/lib.rs:34:17
   |
34 |         unsafe {llvm_asm!("1: sbiw $0,1
   |                 ^

error: couldn't allocate input reg for constraint 'w'
  --> .../avr_delay-0.3.2/src/lib.rs:41:13
   |
41 |     unsafe {llvm_asm!("1: sbiw $0,1
   |             ^

@benstockil
Copy link

Yeah, I'm getting the same issue as @andrewshadura. Is there a way around this error?

@polawat
Copy link

polawat commented Aug 29, 2021

I got a similar issue and got it to work bychanging the nightly version to nightly-2021-01-07

rustup override set nightly-2021-01-07

@zag2art
Copy link

zag2art commented Jan 31, 2022

rust-lang/rust#92816
Any improvements according to this?

@stappersg stappersg changed the title Doesn't work! llvm_asm macro has been deprecated Jan 31, 2022
@stappersg
Copy link
Member

Any improvements according to this?

Rahix/avr-device#91

@stappersg
Copy link
Member

#18 has been merged, now dealing with #19 ...

@stappersg
Copy link
Member

This not an issue any more.

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

8 participants