Go to file
2019-02-18 18:26:59 +01:00
build_sysroot Don't sign commits from patches in sysroot 2019-02-17 17:42:12 -08:00
example Fix discriminant_value intrinsic 2019-02-16 17:18:51 +01:00
patches Remove unnecessary stuff from patch 0002-Disable-u128-and-i128-in-libcore 2019-02-16 12:37:33 +01:00
src Update cranelift 2019-02-18 18:26:59 +01:00
.gitignore
.travis.yml
abc.cpp
Cargo.lock Update cranelift 2019-02-18 18:26:59 +01:00
Cargo.toml Bump tempfile from 3.0.5 to 3.0.7 2019-02-18 08:42:27 +00:00
clean_all.sh
config.sh Cleanup config.sh 2019-02-11 15:42:28 +01:00
copy.clif
flamegraph.sh
LICENSE-APACHE
LICENSE-MIT
prepare.sh
Readme.md Libstd and varargs are now supported. 2019-02-16 12:21:22 +01:00
rust-toolchain
test.sh Fix and enable libstd building 2019-02-11 19:40:07 +01:00

Work in progress cranelift codegen backend for rust

⚠⚠⚠ This doesn't do much useful yet ⚠⚠⚠

Building

$ git clone https://github.com/bjorn3/rustc_codegen_cranelift.git
$ cd rustc_codegen_cranelift
$ ./prepare.sh # downloads and patches sysroot src and installs hyperfine for benchmarking
$ ./test.sh

Usage

$cg_clif_dir is the directory you cloned this repo into in the following instruction.

Rustc

$ rustc -Cpanic=abort -Zcodegen-backend=$cg_clif_dir/target/debug/librustc_codegen_cranelift.so my_crate.rs

Cargo

$ RUSTFLAGS="-Cpanic=abort -Zcodegen-backend=$cg_clif_dir/target/debug/librustc_codegen_cranelift.dylib --sysroot $cg_clif_dir/build_sysroot/sysroot" cargo run

Not yet supported

Troubleshooting

Can't compile

Try updating your nightly compiler. You can try to use an nightly a day or two older if updating rustc doesn't fix it. If you still can't compile it, please fill an issue.