Update Readme.md

This commit is contained in:
Guillaume Gomez 2022-10-18 17:29:15 +02:00
parent 25d482856e
commit c89e3e9b0c

View File

@ -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): 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 ```bash
$ git clone https://github.com/antoyo/gcc
$ cd gcc $ cd gcc
$ ./contrib/download_prerequisites
$ sudo apt install flex libmpfr-dev libgmp-dev libmpc3 libmpc-dev $ sudo apt install flex libmpfr-dev libgmp-dev libmpc3 libmpc-dev
$ ./configure \ $ ./configure \
--enable-host-shared \ --enable-host-shared \
@ -31,23 +31,33 @@ $ ./configure \
--enable-checking=release \ --enable-checking=release \
--prefix=$(pwd)/install \ --prefix=$(pwd)/install \
--disable-multilib --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`.** **Put the path to your custom build of libgccjit in the file `gcc_path`.**
```bash ```bash
$ git clone https://github.com/rust-lang/rustc_codegen_gcc.git $ dirname $(readlink -f `find . -name libgccjit.so`) > gcc_path
$ cd rustc_codegen_gcc ```
You can set also set RUST_COMPILER_RT_ROOT:
```bash
$ git clone https://github.com/llvm/llvm-project llvm --depth 1 --single-branch $ git clone https://github.com/llvm/llvm-project llvm --depth 1 --single-branch
$ export RUST_COMPILER_RT_ROOT="$PWD/llvm/compiler-rt" $ 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: To run the tests:
```bash ```bash
$ ./prepare.sh # download and patch sysroot src and install hyperfine for benchmarking
$ ./test.sh --release $ ./test.sh --release
``` ```