Skip to content

llvm_asm macro has been deprecated #10

Closed

Description

@ergpopler

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

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

Activity

  1. dylanmckay commented on Oct 29, 2020

    @dylanmckay
    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?

  2. ArthurFleischman commented on Jan 31, 2021

    @ArthurFleischman

    any improvements?

  3. dylanmckay commented on Feb 1, 2021

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

  4. andrewshadura commented on Feb 25, 2021

    @andrewshadura

    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
       |             ^
    
    
  5. benstockil commented on Jul 5, 2021

    @benstockil

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

  6. polawat commented on Aug 29, 2021

    @polawat

    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

  7. zag2art commented on Jan 31, 2022

    @zag2art

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

  8. changed the title [-]Doesn't work![/-] [+]llvm_asm macro has been deprecated[/+] on Jan 31, 2022
  9. stappersg commented on Jan 31, 2022

    @stappersg
    Member

    Any improvements according to this?

    Rahix/avr-device#91

  10. stappersg commented on May 21, 2022

    @stappersg
    Member

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

  11. stappersg commented on Jun 8, 2022

    @stappersg
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions