Skip to content
Cranelift backend for rustc
Rust Shell C++
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build_sysroot
crate_patches
example
patches
src
.gitignore
.travis.yml
Cargo.lock
Cargo.toml
LICENSE-APACHE
LICENSE-MIT
Readme.md
abc.cpp
cargo.sh
clean_all.sh
config.sh
copy.clif
flamegraph.sh
prepare.sh
rust-toolchain
test.sh

Readme.md

WIP Cranelift codegen backend for rust

⚠⚠⚠ Threads and certain kinds of FFI don't work yet. ⚠⚠⚠

Building

$ git clone https://github.com/bjorn3/rustc_codegen_cranelift.git
$ cd rustc_codegen_cranelift
$ ./prepare.sh # download and patch sysroot src and install hyperfine for benchmarking
$ ./test.sh

Usage

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

Cargo

$ $cg_clif_dir/cargo.sh run

Rustc

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

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.

You can’t perform that action at this time.