Add instructions to build libcore

This commit is contained in:
bjorn3 2018-07-18 13:35:03 +02:00
parent 425b527dc3
commit 9615f3a137
2 changed files with 15 additions and 2 deletions

View File

@ -5,7 +5,7 @@
## Building
```bash
$ git clone https://github.com/bjorn3/rustc_codegen_cranelift
$ git clone https://github.com/bjorn3/rustc_codegen_cranelift.git
$ cd rustc_codegen_cranelift
$ git submodule update --init
$ cargo build
@ -19,6 +19,19 @@ $ rustc -Zcodegen-backend=$(pwd)/target/debug/librustc_codegen_cranelift.so my_c
> You must compile with `-Og`, because checked binops are not yet supported.
## Building libcore
```bash
$ git clone https://github.com/rust-lang/rust.git
$ cd rust
$ git apply ../0001-Disable-stdsimd-in-libcore.patch
$ git apply ../0002-Disable-u128-and-i128-in-libcore.patch
$ cd ../
$ ./build.sh
```
> ⚠⚠⚠ You will get a panic because of unimplemented stuff ⚠⚠⚠
## Not yet supported
* [ ] Checked binops

View File

@ -1,4 +1,4 @@
cargo build || exit 1
rustc -Zcodegen-backend=$(pwd)/target/debug/librustc_codegen_cranelift.so example.rs --crate-type lib -Og
rustc -Zcodegen-backend=$(pwd)/target/debug/librustc_codegen_cranelift.so ../rust/src/libcore/lib.rs --crate-type lib -Og
rustc -Zcodegen-backend=$(pwd)/target/debug/librustc_codegen_cranelift.so ./rust/src/libcore/lib.rs --crate-type lib -Og