]> git.lizzy.rs Git - rust.git/blob - Readme.md
643611ce74f11a21366d41b1c8327de0386fa68b
[rust.git] / Readme.md
1 # Work in progress cranelift codegen backend for rust
2
3 > ⚠⚠⚠ This doesn't do anything useful yet ⚠⚠⚠
4
5 ## Building
6
7 ```bash
8 $ git clone https://github.com/bjorn3/rustc_codegen_cranelift.git
9 $ cd rustc_codegen_cranelift
10 $ rustup override set nightly
11 $ git submodule update --init
12 $ cargo build
13 ```
14
15 ## Usage
16
17 ```bash
18 $ rustc -Zcodegen-backend=$(pwd)/target/debug/librustc_codegen_cranelift.so my_crate.rs --crate-type lib -Og
19 ```
20
21 > You must compile with `-Og`, because checked binops are not yet supported.
22
23 ## Building libcore
24
25 ```bash
26 $ git clone https://github.com/rust-lang/rust.git
27 $ cd rust
28 $ git apply ../0001-Disable-stdsimd-in-libcore.patch
29 $ git apply ../0002-Disable-u128-and-i128-in-libcore.patch
30 $ cd ../
31 $ ./build.sh
32 ```
33
34 > ⚠⚠⚠ You will get a panic because of unimplemented stuff ⚠⚠⚠
35
36 ## Not yet supported
37
38 * [ ] Checked binops
39 * [ ] Statics
40 * [ ] Drop glue
41
42 * [ ] Building libraries
43 * [ ] Other call abi's
44 * [ ] Unsized types
45 * [ ] Slice indexing
46 * [ ] Sub slice
47 * [ ] Closures
48 * [ ] Some rvalue's
49
50 * [ ] Inline assembly
51 * [ ] Custom sections
52
53 ## Known errors
54
55 * [ ] cranelift-module api seems to be used wrong, thus causing panic for some consts
56 * [ ] cranelift-codegen doesn't have encodings for some instructions for types smaller than I32