about summary refs log tree commit diff
diff options
context:
space:
mode:
authorantoyo <antoyo@users.noreply.github.com>2022-10-19 18:27:22 -0400
committerGitHub <noreply@github.com>2022-10-19 18:27:22 -0400
commitcc5c38717da46b561a392d56ba27848533056b7b (patch)
treea18f59788594aa6576363f664764f6cd3b7457f8
parent618553b9b4a5996c23285a8efc62f29a940208e6 (diff)
parentea52df463b8d826fcc2086485ed71d3d5eb1430e (diff)
downloadrust-cc5c38717da46b561a392d56ba27848533056b7b.tar.gz
rust-cc5c38717da46b561a392d56ba27848533056b7b.zip
Merge pull request #236 from GuillaumeGomez/install-doc
Improve installation documentation
-rw-r--r--Readme.md35
1 files changed, 30 insertions, 5 deletions
diff --git a/Readme.md b/Readme.md
index cdd7f55dcde..4d776b6c7a3 100644
--- a/Readme.md
+++ b/Readme.md
@@ -18,21 +18,46 @@ The patches in [this repository](https://github.com/antoyo/libgccjit-patches) ne
 (Those patches should work when applied on master, but in case it doesn't work, they are known to work when applied on 079c23cfe079f203d5df83fea8e92a60c7d7e878.)
 You can also use my [fork of gcc](https://github.com/antoyo/gcc) which already includes these patches.**
 
+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):
+
+```bash
+$ git clone https://github.com/antoyo/gcc
+$ cd gcc
+$ sudo apt install flex libmpfr-dev libgmp-dev libmpc3 libmpc-dev
+$ ./configure \
+   --enable-host-shared \
+   --enable-languages=jit \
+   --disable-bootstrap \
+   --enable-checking=release \
+   --prefix=$(pwd)/install \
+   --disable-multilib
+$ make -j4 # You can replace `4` with another number depending on how many cores you have.
+$ cd ..
+```
+
 **Put the path to your custom build of libgccjit in the file `gcc_path`.**
 
 ```bash
-$ git clone https://github.com/rust-lang/rustc_codegen_gcc.git
-$ cd rustc_codegen_gcc
+$ dirname $(readlink -f `find . -name libgccjit.so`) > gcc_path
+```
+
+You also need to set RUST_COMPILER_RT_ROOT:
+
+```bash
 $ git clone https://github.com/llvm/llvm-project llvm --depth 1 --single-branch
 $ export RUST_COMPILER_RT_ROOT="$PWD/llvm/compiler-rt"
-$ ./prepare_build.sh # download and patch sysroot src
-$ ./build.sh --release
 ```
 
-To run the tests:
+Then you can run commands like this:
 
 ```bash
 $ ./prepare.sh # download and patch sysroot src and install hyperfine for benchmarking
+$ LIBRARY_PATH=$(cat gcc_path) LD_LIBRARY_PATH=$(cat gcc_path) ./build.sh --release
+```
+
+To run the tests:
+
+```bash
 $ ./test.sh --release
 ```