Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explanations on how to run rustc_codegen_gcc tests #1821

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```

Now you can run the following command:

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

If it cannot find the `.so` library (if you installed it with `apt` for example), you
need to pass the library file path with `LIBRARY_PATH`:

```bash
$ LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/12/ ./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/).