Go to file
bjorn3 fbe36ad68a Revert "Use CachingSourceMapView::byte_pos_to_line_and_col instead of SourceMap::lookup_char_pos"
This reverts commit eb4fc45310.

It caused a panic while compiling simple-raytracer
2020-02-03 21:36:36 +01:00
build_sysroot Update compiler_builtins 2020-01-25 17:24:45 +01:00
crate_patches
example
patches Rustup to rustc 1.42.0-nightly (3761dcd34 2020-01-28) 2020-01-29 11:21:29 +01:00
src Revert "Use CachingSourceMapView::byte_pos_to_line_and_col instead of SourceMap::lookup_char_pos" 2020-02-03 21:36:36 +01:00
.gitignore
.travis.yml
Cargo.lock Update smallvec to 1.2.0 2020-02-01 12:35:45 +01:00
Cargo.toml
LICENSE-APACHE
LICENSE-MIT
Readme.md Remove outdated troubleshooting section 2020-01-25 12:28:22 +01:00
abc.cpp
cargo.sh
clean_all.sh
config.sh
copy.clif
flamegraph.sh
prepare.sh
rust-toolchain Rustup to rustc 1.42.0-nightly (cd1ef390e 2020-01-31) 2020-02-01 12:35:03 +01:00
rustup.sh
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 --release

Usage

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

Cargo

$ CHANNEL="release" $cg_clif_dir/cargo.sh run

If you compiled cg_clif in debug mode you should use CHANNEL="debug" instead or omit CHANNEL="release" completely.

Rustc

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

Not yet supported