Skip to content

Commit

Permalink
Add explanations on how to run rustc_codegen_gcc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 4, 2023
1 parent f42a31f commit 7dd2402
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/tests/running.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,3 +320,36 @@ communicate with the server to coordinate running tests (see
[remote-test-server]: https://github.com/rust-lang/rust/tree/master/src/tools/remote-test-server
[src/bootstrap/test.rs]: https://github.com/rust-lang/rust/tree/master/src/bootstrap/test.rs

## Running rustc_codegen_gcc tests

First thing to know is that it only supports linux x86_64 at the moment. We will
extend its support later on.

You need to update `codegen-backends` value in your `config.toml` file in the
`[rust]` section and add "gcc" in the array:

```toml
codegen-backends = ["llvm", "gcc"]
```

Then you need to install libgccjit 12. For example with `apt`:

```bash
$ apt install libgccjit-12-dev
```

Don't forget to check if the `.so` is available in your test. With `apt` it's not
and you need to do:

```bash
$ ln -s /usr/lib/gcc/x86_64-linux-gnu/12/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so
```

Now you can run the following command:

```bash
$ ./x.py test compiler/rustc_codegen_gcc/
```

If you encounter bugs or problems, don't hesitate to open issues on
[rustc_codegen_gcc repository](github.com/rust-lang/rustc_codegen_gcc/).

0 comments on commit 7dd2402

Please sign in to comment.