-
Notifications
You must be signed in to change notification settings - Fork 14
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
Could not compile core - LLVM Error: Cannot Select #164
Comments
I've ran into the same issue, unfortunately. Trying to make my university project in Rust. The deadline approaches rapidly, so most likely I'll just pick C. |
@Logarithmus Sorry for the delay in seeing this, hope it's not too late. If you use the older more stable |
I have a Gist I put together to go from zero to having a Blink program compiled. Hope this helps. https://gist.github.com/jonahbron/640a825dd9a526d3a1c24f2c20ca44ac |
@jonahbron Thank you for help, but I've figured out it myself short after my previous comment. Now I'm stuck with interrupts. |
@Logarithmus, maybe the code I wrote for #[no_mangle]
pub unsafe extern "avr-interrupt" fn <vector_id>() {
// ...
} where The mapping of IRQ to ID can be found in the datasheet. |
FYI I gave this another shot today, commit ID 54014d0. Still the same error. $ XARGO_RUST_SRC="$(realpath ../avr-rust/src)" rustup run avr cargo xbuild --target avr-unknown-unknown --example leonardo-blink
WARNING: There is no root package to read the cargo-xbuild config from.
Updating crates.io index
Downloaded compiler_builtins v0.1.28
Downloaded 1 crate (135.1 KB) in 0.74s
Compiling core v0.0.0 (/run/media/jonah/data/Projects/avr-rust/src/libcore)
Compiling compiler_builtins v0.1.28
Compiling rustc-std-workspace-core v1.99.0 (/run/media/jonah/data/Projects/avr-rust/src/tools/rustc-std-workspace-core)
Compiling alloc v0.0.0 (/tmp/xargo.cVO5liTsZqc7)
LLVM ERROR: Cannot select: 0x7f66c48f3bc0: i16 = bitcast 0x7f66c46d9e20
0x7f66c46d9e20: i8,ch,glue = CopyFromReg 0x7f66c4a1b1d0:1, Register:i8 $r24, 0x7f66c4a1b1d0:2
0x7f66c4073160: i8 = Register $r24
0x7f66c4a1b1d0: i16,ch,glue = CopyFromReg 0x7f66c4041f08:1, Register:i16 $r23r22, 0x7f66c4041f08:2
0x7f66c473d1c8: i16 = Register $r23r22
0x7f66c4041f08: i16,ch,glue = CopyFromReg 0x7f66c4073778, Register:i16 $r21r20, 0x7f66c4073778:1
0x7f66c4042248: i16 = Register $r21r20
0x7f66c4073778: ch,glue = callseq_end 0x7f66c40d6890, TargetConstant:i16<0>, TargetConstant:i16<0>, 0x7f66c40d6890:1
0x7f66c4041bc8: i16 = TargetConstant<0>
0x7f66c4041bc8: i16 = TargetConstant<0>
0x7f66c40d6890: ch,glue = CALL 0x7f66c4041c98, TargetGlobalAddress:i16<{ i8, i32 } (i32) addrspace(1)* @_ZN4core3num7flt2dec8strategy5grisu22max_pow10_no_more_than17h24eda0bf549557d4E> 0, Register:i16 $r23r22, Register:i16 $r25r24, RegisterMask:Untyped, 0x7f66c4041c98:1
0x7f66c4da4890: i16 = TargetGlobalAddress<{ i8, i32 } (i32) addrspace(1)* @_ZN4core3num7flt2dec8strategy5grisu22max_pow10_no_more_than17h24eda0bf549557d4E> 0
0x7f66c473d1c8: i16 = Register $r23r22
0x7f66c46d98d8: i16 = Register $r25r24
0x7f66c4951270: Untyped = RegisterMask
0x7f66c4041c98: ch,glue = CopyToReg 0x7f66c49514e0, Register:i16 $r25r24, 0x7f66c4565a98, 0x7f66c49514e0:1
0x7f66c46d98d8: i16 = Register $r25r24
0x7f66c4565a98: i16,ch,glue = CopyFromReg 0x7f66c4565a30:1, Register:i16 $r21r20, 0x7f66c4565a30:2
0x7f66c4042248: i16 = Register $r21r20
0x7f66c4565a30: i16,ch,glue = CopyFromReg 0x7f66c45659c8, Register:i16 $r19r18, 0x7f66c45659c8:1
0x7f66c4565688: i16 = Register $r19r18
0x7f66c45659c8: ch,glue = callseq_end 0x7f66c4565960, TargetConstant:i16<0>, TargetConstant:i16<0>, 0x7f66c4565960:1
0x7f66c49514e0: ch,glue = CopyToReg 0x7f66c40aa9f0, Register:i16 $r23r22, 0x7f66c4565a30
0x7f66c473d1c8: i16 = Register $r23r22
0x7f66c4565a30: i16,ch,glue = CopyFromReg 0x7f66c45659c8, Register:i16 $r19r18, 0x7f66c45659c8:1
0x7f66c4565688: i16 = Register $r19r18
0x7f66c45659c8: ch,glue = callseq_end 0x7f66c4565960, TargetConstant:i16<0>, TargetConstant:i16<0>, 0x7f66c4565960:1
In function: _ZN4core3num7flt2dec8strategy5grisu19format_shortest_opt17hfcc742cc4fb3bf66E
error: could not compile `core`.
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
error: `"/home/jonah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo" "rustc" "-p" "alloc" "--release" "--manifest-path" "/tmp/xargo.cVO5liTsZqc7/Cargo.toml" "--target" "avr-unknown-unknown" "--" "-Z" "force-unstable-if-unmarked"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace |
I just built the latest from the
avr-support-upstream
branch the other day (6a48e6e). When compiling another library (avr-hal), it tries to buildcore
and fails.When I built Rust, I simply edited the config.toml to include the experimental AVR target, and set the prefix. Other than that, I ran
./x.py build && ./x.py install
; nothing special.Is there another commit I should have compiled that can compile core, or something else I did wrong?
The text was updated successfully, but these errors were encountered: