Go to file
2018-10-06 14:48:34 +02:00
example Implement Rvalue::Len for arrays 2018-10-06 13:50:31 +02:00
src Use absolute compile time paths for some log files 2018-10-06 14:48:34 +02:00
.gitignore Perform some optimizations 2018-09-02 13:36:45 +02:00
.travis.yml Add RUST_BACKTRACE=1 to .travis.yml 2018-07-19 18:58:30 +02:00
0001-Disable-stdsimd.patch Disable stdsimd in libstd too 2018-10-06 11:12:06 +02:00
0002-Disable-u128-and-i128-in-libcore.patch Don't disable core::time completely 2018-10-06 13:09:46 +02:00
0003-Disable-inline-assembly-in-spin_loop_hint.patch Implement a lot of atomic intrinsics 2018-10-06 10:24:09 +02:00
0004-Disable-some-more-unsupported-stuff-in-libcore.patch Rustup to rustc 1.31.0-nightly (de3d640f5 2018-10-01), fix a atomic bug and implement intrinsic bitreverse 2018-10-02 18:12:03 +02:00
build.sh Rename examples directory to example to prevent rls trying to compile its content 2018-09-22 12:15:56 +02:00
Cargo.lock Bump cranelift from 191638e to 0fd3769 2018-10-03 05:43:03 +00:00
Cargo.toml Optimize all dependencies in debug mode 2018-09-30 10:35:44 +02:00
copy.clif Fix some bugs 2018-08-08 10:26:25 +02:00
LICENSE-APACHE Create LICENSE-APACHE 2018-06-22 19:33:35 +02:00
LICENSE-MIT Add LICENSE-MIT 2018-06-22 19:34:27 +02:00
prepare_libcore.sh Fix build 2018-10-06 11:30:32 +02:00
Readme.md Update Readme.md 2018-10-05 08:34:26 +02:00
rust-toolchain Initial commit 2018-06-17 18:05:11 +02:00

Work in progress cranelift codegen backend for rust

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

Building

$ git clone https://github.com/bjorn3/rustc_codegen_cranelift.git
$ cd rustc_codegen_cranelift
$ rustup override set nightly
$ git submodule update --init
$ cargo build

Usage

$ rustc -Zcodegen-backend=$(pwd)/target/debug/librustc_codegen_cranelift.so my_crate.rs --crate-type lib -Og

Building libcore

$ rustup component add rust-src
$ ./prepare_libcore.sh
$ ./build.sh

Not yet supported

  • Checked binops

  • Drop glue

  • Other call abi's

  • Sub slice

  • Inline assembly

  • Custom sections

Known errors

  • cranelift-module api seems to be used wrong, thus causing panic for some consts
  • cranelift-codegen doesn't have encodings for some instructions for types smaller than I32