]> git.lizzy.rs Git - rust.git/blob - Readme.md
615f6c458410fac8e06b1acb52398f178a25d3b5
[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 ## Building libcore
22
23 ```bash
24 $ rustup component add rust-src
25 $ ./prepare_libcore.sh
26 $ ./build.sh
27 ```
28
29 > This should stop with `error: aborting due to <...> previous errors`
30 >
31 > Please submit a bug if not
32
33 ## Not yet supported
34
35 * Checked binops
36 * Statics
37 * Drop glue
38
39 * Building libraries
40 * Other call abi's
41 * Unsized types
42 * Slice indexing
43 * Sub slice
44 * Some rvalue's
45
46 * Inline assembly
47 * Custom sections
48
49 ## Known errors
50
51 * cranelift-module api seems to be used wrong, thus causing panic for some consts
52 * cranelift-codegen doesn't have encodings for some instructions for types smaller than I32