Go to file
2018-11-24 12:47:53 +01:00
alloc_system Rustup to rustc 1.32.0-nightly (ca79ecd69 2018-11-11) 2018-11-12 19:37:54 +01:00
example Remove a workaround for icmp.i8/i16 not having an encoding 2018-11-17 15:02:57 +01:00
src Rustfmt 2018-11-24 12:47:53 +01:00
xargo Rustup to rustc 1.32.0-nightly (ca79ecd69 2018-11-11) 2018-11-12 19:37:54 +01:00
.gitignore Some more changes 2018-10-10 19:04:20 +02:00
.travis.yml [Travis] test on macOS too 2018-11-07 14:07:12 +01:00
0001-Disable-stdsimd.patch Rustup to rustc 1.32.0-nightly (ca79ecd69 2018-11-11) 2018-11-12 19:37:54 +01:00
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 Implement a lot of atomic intrinsics 2018-10-06 10:24:09 +02:00
0004-Disable-some-more-unsupported-stuff-in-libcore.patch
0005-Disable-compiler_builtins.patch Add some more patches 2018-10-06 14:57:06 +02:00
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 Cranelift, libc and redox_syscall 2018-11-24 11:51:41 +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 Rustup to rustc 1.32.0-nightly (ca79ecd69 2018-11-11) 2018-11-12 19:37:54 +01:00
Readme.md Some changes to Readme.md 2018-11-17 12:24:35 +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. :(