1 # Work in progress cranelift codegen backend for rust
3 > ⚠⚠⚠ This doesn't do anything useful yet ⚠⚠⚠
8 $ git clone https://github.com/bjorn3/rustc_codegen_cranelift.git
9 $ cd rustc_codegen_cranelift
10 $ rustup override set nightly
11 $ git submodule update --init
18 $ rustc -Zcodegen-backend=$(pwd)/target/debug/librustc_codegen_cranelift.so my_crate.rs --crate-type lib -Og
24 $ rustup component add rust-src
25 $ ./prepare_libcore.sh
29 > ⚠⚠⚠ You will get a panic because of unimplemented stuff ⚠⚠⚠
49 * cranelift-module api seems to be used wrong, thus causing panic for some consts
50 * cranelift-codegen doesn't have encodings for some instructions for types smaller than I32
54 warning: DefId(0/0:128 ~ lib[8787]::f64[0]::{{impl}}[0]::classify[0]):
55 fn f64::<impl at ./target/libcore/src/libcore/num/f64.rs:156:1: 490:2>::classify(_1: f64) -> num::FpCategory{
59 warning: stmt _5 = BitAnd(move _6, const Unevaluated(DefId(0/0:130 ~ lib[8787]::f64[0]::{{impl}}[0]::classify[0]::MAN_MASK[0]), []):u64)
60 thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:345:21
63 10: <core::option::Option<T>>::unwrap
64 at /checkout/src/libcore/macros.rs:20
65 11: rustc_codegen_cranelift::constant::trans_constant