LLVM ERROR: Expected a constant shift amount!

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: GitHub - avr-rust/blink: A blinking LED program written in Rust for the AVR

I run the following commands before building:

rustup override set nightly


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?

I know nothing about your problem, but while browsing posts in the embedded category just now, I came across this one: Adding host unit tests to an embedded project

The author of that post also saw LLVM ERROR: Expected a constant shift amount!, and posted a solution to their problem in the thread. Maybe that will help!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.