1
Fork 0

Fix gcc build instructions

This commit is contained in:
Guillaume Gomez 2022-10-23 21:43:00 +02:00
parent cc5c38717d
commit 1a2c8b01cb

View file

@ -22,17 +22,32 @@ To build it (most of these instructions come from [here](https://gcc.gnu.org/onl
```bash ```bash
$ git clone https://github.com/antoyo/gcc $ git clone https://github.com/antoyo/gcc
$ cd gcc
$ sudo apt install flex libmpfr-dev libgmp-dev libmpc3 libmpc-dev $ sudo apt install flex libmpfr-dev libgmp-dev libmpc3 libmpc-dev
$ ./configure \ $ mkdir gcc-build gcc-install
--enable-host-shared \ $ cd gcc-build
--enable-languages=jit \ $ ../gcc/configure \
--disable-bootstrap \ --enable-host-shared \
--enable-checking=release \ --enable-languages=jit \
--prefix=$(pwd)/install \ --enable-checking=release \ # it enables extra checks which allow to find bugs
--disable-multilib --disable-bootstrap \
--disable-multilib \
--prefix=$(pwd)/../gcc-install
$ make -j4 # You can replace `4` with another number depending on how many cores you have. $ make -j4 # You can replace `4` with another number depending on how many cores you have.
$ cd .. ```
If you want to run libgccjit tests, you will need to also enable the C++ language in the `configure`:
```bash
--enable-languages=jit,c++
```
Then to run libgccjit tests:
```bash
$ cd gcc # from the `gcc-build` folder
$ make check-jit
# To run one specific test:
$ make check-jit RUNTESTFLAGS="-v -v -v jit.exp=jit.dg/test-asm.cc"
``` ```
**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`.**