Skip to content

Commit cc5c387

Browse files
authored
Merge pull request rust-lang#236 from GuillaumeGomez/install-doc
Improve installation documentation
2 parents 618553b + ea52df4 commit cc5c387

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

Readme.md

+30-5
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,46 @@ The patches in [this repository](https://github.com/antoyo/libgccjit-patches) ne
1818
(Those patches should work when applied on master, but in case it doesn't work, they are known to work when applied on 079c23cfe079f203d5df83fea8e92a60c7d7e878.)
1919
You can also use my [fork of gcc](https://github.com/antoyo/gcc) which already includes these patches.**
2020

21+
To build it (most of these instructions come from [here](https://gcc.gnu.org/onlinedocs/jit/internals/index.html), so don't hesitate to take a look there if you encounter an issue):
22+
23+
```bash
24+
$ git clone https://github.com/antoyo/gcc
25+
$ cd gcc
26+
$ sudo apt install flex libmpfr-dev libgmp-dev libmpc3 libmpc-dev
27+
$ ./configure \
28+
--enable-host-shared \
29+
--enable-languages=jit \
30+
--disable-bootstrap \
31+
--enable-checking=release \
32+
--prefix=$(pwd)/install \
33+
--disable-multilib
34+
$ make -j4 # You can replace `4` with another number depending on how many cores you have.
35+
$ cd ..
36+
```
37+
2138
**Put the path to your custom build of libgccjit in the file `gcc_path`.**
2239

2340
```bash
24-
$ git clone https://github.com/rust-lang/rustc_codegen_gcc.git
25-
$ cd rustc_codegen_gcc
41+
$ dirname $(readlink -f `find . -name libgccjit.so`) > gcc_path
42+
```
43+
44+
You also need to set RUST_COMPILER_RT_ROOT:
45+
46+
```bash
2647
$ git clone https://github.com/llvm/llvm-project llvm --depth 1 --single-branch
2748
$ export RUST_COMPILER_RT_ROOT="$PWD/llvm/compiler-rt"
28-
$ ./prepare_build.sh # download and patch sysroot src
29-
$ ./build.sh --release
3049
```
3150

32-
To run the tests:
51+
Then you can run commands like this:
3352

3453
```bash
3554
$ ./prepare.sh # download and patch sysroot src and install hyperfine for benchmarking
55+
$ LIBRARY_PATH=$(cat gcc_path) LD_LIBRARY_PATH=$(cat gcc_path) ./build.sh --release
56+
```
57+
58+
To run the tests:
59+
60+
```bash
3661
$ ./test.sh --release
3762
```
3863

0 commit comments

Comments
 (0)