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 ERROR: Expected a constant shift amount #46

Open
saki-osive opened this issue May 14, 2023 · 2 comments
Open

LLVM ERROR: Expected a constant shift amount #46

saki-osive opened this issue May 14, 2023 · 2 comments

Comments

@saki-osive
Copy link

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

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?

@Patryk27
Copy link

Patryk27 commented Jun 3, 2023

Hi, yes, it's a known issue - rust-lang/rust#112140; I'm working on a fix 🙂

@b-camacho
Copy link

Thanks for fixing this! The fix already landed in nightly, in the mean time
rustup toolchain install nightly fixes this.

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

3 participants