From 25d482856e3042b862d6741cfdac56f244fac04a Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 17 Oct 2022 23:47:18 +0200 Subject: [PATCH 1/3] Improve installation documentation --- Readme.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Readme.md b/Readme.md index cdd7f55dcde..274538a0e63 100644 --- a/Readme.md +++ b/Readme.md @@ -18,6 +18,21 @@ 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 +$ cd gcc +$ ./contrib/download_prerequisites +$ 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 +``` + **Put the path to your custom build of libgccjit in the file `gcc_path`.** ```bash From c89e3e9b0c9e1566b88465b738dcc699993551e5 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 18 Oct 2022 17:29:15 +0200 Subject: [PATCH 2/3] Update Readme.md --- Readme.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Readme.md b/Readme.md index 274538a0e63..7a29986739a 100644 --- a/Readme.md +++ b/Readme.md @@ -21,8 +21,8 @@ You can also use my [fork of gcc](https://github.com/antoyo/gcc) which already i 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 -$ ./contrib/download_prerequisites $ sudo apt install flex libmpfr-dev libgmp-dev libmpc3 libmpc-dev $ ./configure \ --enable-host-shared \ @@ -31,23 +31,33 @@ $ ./configure \ --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 can set also 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 +``` + +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 -$ ./prepare.sh # download and patch sysroot src and install hyperfine for benchmarking $ ./test.sh --release ``` From ea52df463b8d826fcc2086485ed71d3d5eb1430e Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 19 Oct 2022 23:47:42 +0200 Subject: [PATCH 3/3] Fix typo --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 7a29986739a..4d776b6c7a3 100644 --- a/Readme.md +++ b/Readme.md @@ -41,7 +41,7 @@ $ cd .. $ dirname $(readlink -f `find . -name libgccjit.so`) > gcc_path ``` -You can set also set RUST_COMPILER_RT_ROOT: +You also need to set RUST_COMPILER_RT_ROOT: ```bash $ git clone https://github.com/llvm/llvm-project llvm --depth 1 --single-branch