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

couldn't allocate input reg for constrain 'w' #37

Closed
str0yd opened this issue Aug 31, 2021 · 4 comments
Closed

couldn't allocate input reg for constrain 'w' #37

str0yd opened this issue Aug 31, 2021 · 4 comments

Comments

@str0yd
Copy link

str0yd commented Aug 31, 2021

I get this error compiling the project.
The whole error message:

PS C:\Users\woppe\Documents\Rust\blink> cargo build -Z build-std=core --target avr-atmega328p.json --release
   Compiling compiler_builtins v0.1.49
warning: target json file contains unused fields: no-compiler-rt

   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
warning: `avr-config` (lib) generated 1 warning (1 duplicate)
warning: `avr-std-stub` (lib) generated 1 warning (1 duplicate)
warning: `avr-config` (lib) generated 1 warning (1 duplicate)
   Compiling ruduino v0.3.2
error: couldn't allocate input reg for constraint 'w'
  --> C:\Users\woppe\.cargo\registry\src\gh.neting.cc-1ecc6299db9ec823\avr_delay-0.3.1\src\lib.rs:34:17
   |
34 |         unsafe {llvm_asm!("1: sbiw $0,1
   |                 ^

warning: `avr_delay` (lib) generated 1 warning (1 duplicate)
error: could not compile `avr_delay` due to previous error; 1 warning emitted
warning: build failed, waiting for other jobs to finish...
LLVM ERROR: Not supported instr: <MCInst 312 <MCOperand Reg:1> <MCOperand Imm:13> <MCOperand Reg:41>>
warning: `compiler_builtins` (lib) generated 1 warning
warning: `ruduino` (lib) generated 1 warning (1 duplicate)
error: build failed

@sawyeke
Copy link

sawyeke commented Oct 9, 2021

I am new to rust and just got the same issue. With some googlefoo I located this issue. The comments from that one are that there's some processor specific work that needs to be done in order for the new asm! macro to work properly. Looks like a manpower issue more than anything else right now. Most of the recent work on the avr-rust project's been by @dylanmckay, and from the looks of it he's working more on other projects right now (which I totally understand, especially if he's mostly been doing this in his spare time).

@pete-eiger
Copy link

I get the same issue :/

@kvisscher
Copy link

kvisscher commented Dec 25, 2021

Probably why this commit was made: 9e97930 to pin the version to a nightly that does still work

I had to take the following steps:

rustup toolchain install nightly-2021-01-05
rustup override set nightly-2021-01-05

Then just run the regular build command as documented.

The first step installs the toolchain like the Dockerfile used in the CI, which still works and the second step makes sure to use that specific nightly toolchain for the following build command.

@stappersg
Copy link
Member

This is fixed.

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

5 participants