Go to file
2018-12-01 11:49:44 +01:00
alloc_system
example Remove a workaround for icmp.i8/i16 not having an encoding 2018-11-17 15:02:57 +01:00
src Some small changes 2018-12-01 11:49:44 +01:00
xargo
.gitignore
.travis.yml
0001-Disable-stdsimd.patch
0002-Disable-u128-and-i128-in-libcore.patch Rustup to rustc 1.32.0-nightly (65204a97d 2018-11-12) 2018-11-13 18:25:21 +01:00
0003-Disable-inline-assembly-in-spin_loop_hint.patch
0004-Disable-some-more-unsupported-stuff-in-libcore.patch Implement cast C enum -> int 2018-11-30 18:28:33 +01:00
0005-Disable-compiler_builtins.patch
0006-alloc-Disable-some-unsupported-stuff.patch Implement ProjectionElem::ConstantIndex 2018-11-13 18:28:10 +01:00
0007-Fix-libstd-building.patch Update libstd patches for latest nightly and macOS 2018-11-17 11:51:49 +01:00
0008-Replace-some-variadic-function-calls-with-unimplemen.patch Update libstd patches for latest nightly and macOS 2018-11-17 11:51:49 +01:00
build.sh Benchmark compilations speed 2018-11-16 18:39:31 +01:00
Cargo.lock Update Cargo.lock 2018-11-30 18:12:08 +01:00
Cargo.toml Rustup to rustc 1.32.0-nightly (1f57e4841 2018-11-23) 2018-11-24 11:23:49 +01:00
copy.clif
LICENSE-APACHE
LICENSE-MIT
prepare_libcore.sh
Readme.md Update SIMD entry in Readme 2018-11-27 11:21:20 +01:00
rust-toolchain

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
$ rustup override set nightly # This uses unstable api's which will never be stabilized
$ cargo install xargo         # Used for building the sysroot
$ cargo install hyperfine     # Used for benchmarking in build.sh
$ cargo build

Usage

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

Build sysroot and test

$ rustup component add rust-src # Make sure the sysroot source is available
$ ./prepare_libcore.sh          # Patch the sysroot source for some not yet supported things
$ ./build.sh

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.

error[E0463]: can't find crate for std while compiling a no_std crate

If you use RUSTFLAGS to pass -Zcodegen-backend to rustc, cargo will compile build-dependencies with those flags too. Because this project doesn't support libstd yet, that will result in an error. I don't know of any way to fix this. :(