LLVM ERROR: Expected a constant shift amount

193 Views Asked by At

I'm trying to build Rust for an Arduino UNO. The spec sheet of the device can be found here: https://docs.arduino.cc/resources/datasheets/A000066-datasheet.pdf

I'm trying to compile a simple program at: https://github.com/avr-rust/blink

I run the following commands before building:

rustup override set nightly

and

export AVR_CPU_FREQUENCY_HZ=16000000

to set the desired environment.

Then I run the following command to build for the board:

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

The avr-atmega328p.json file is included at the root level.

However I'm faced with the following error:

..
   Compiling adler v1.0.2
   Compiling rustc-demangle v0.1.21
LLVM ERROR: Expected a constant shift amount!
error: could not compile `compiler_builtins` (lib)
warning: build failed, waiting for other jobs to finish...

Has anyone faced this before?

0

There are 0 best solutions below