You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/doc/rustc-dev-guide/src/tests/codegen-backend-tests/cg_gcc.md
+30-6Lines changed: 30 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,16 @@
1
1
# GCC codegen backend
2
2
3
-
If you ran into an error related to tests executed with the GCC codegen backend on CI,
4
-
you can use the following command to run UI tests locally using the GCC backend:
3
+
We run a subset of the compiler test suite with the GCC codegen backend on our CI, to help find changes that could break the integration of this backend with the compiler.
4
+
5
+
If you encounter any bugs or problems with the GCC codegen backend in general, don't hesitate to open issues on the
Note that the backend currently only supports the `x86_64-unknown-linux-gnu` target.
9
+
10
+
## Running into GCC backend CI errors
11
+
12
+
If you ran into an error related to tests executed with the GCC codegen backend on CI in the `x86_64-gnu-gcc` job,
13
+
you can use the following command to run UI tests locally using the GCC backend, which reproduces what happens on CI:
5
14
6
15
```bash
7
16
./x test tests/ui \
@@ -12,7 +21,13 @@ you can use the following command to run UI tests locally using the GCC backend:
12
21
13
22
If a different test suite has failed on CI, you will have to modify the `tests/ui` part.
14
23
15
-
Below, you can find more information about how to configure the GCC backend in bootstrap.
24
+
To reproduce the whole CI job locally, you can run `cargo run --manifest-path src/ci/citool/Cargo.toml run-local x86_64-gnu-gcc`. See [Testing with Docker](../docker.md) for more information.
25
+
26
+
### What to do in case of a GCC job failure?
27
+
28
+
If the GCC job test fails and it seems like the failure could be caused by the GCC backend, you can ping the [cg-gcc working group](https://github.com/orgs/rust-lang/teams/wg-gcc-backend) using `@rust-lang/wg-gcc-backend`
29
+
30
+
If fixing a compiler test that fails with the GCC backend is non-trivial, you can ignore that test when executed with `cg_gcc` using the `//@ ignore-backends: gcc`[compiletest directive](../directives.md).
16
31
17
32
## Choosing which codegen backends are built
18
33
@@ -49,13 +64,22 @@ To run compiler tests with the GCC codegen backend being used to build the test
49
64
./x test tests/ui --test-codegen-backend gcc
50
65
```
51
66
52
-
Note that in order for this to work, the tested compiler must have the GCC codegen backend available in its sysroot
53
-
directory. You can achieve that using the [instructions above](#choosing-which-codegen-backends-are-built).
67
+
Note that in order for this to work, the tested compiler must have the GCC codegen backend [available](#choosing-which-codegen-backends-are-built) in its sysroot directory.
54
68
55
69
## Downloading GCC from CI
56
70
57
71
The `gcc.download-ci-gcc` bootstrap option controls if GCC (which is a dependency of the GCC codegen backend)
58
72
will be downloaded from CI or built locally. The default value is `true`, which will download GCC from CI
59
73
if there are no local changes to the GCC sources and the given host target is available on CI.
60
74
61
-
Note that GCC can currently only be downloaded from CI for the `x86_64-unknown-linux-gnu` target.
75
+
## Running tests of the backend itself
76
+
77
+
In addition to running the compiler's test suites using the GCC codegen backend, you can also run the test suite of the backend itself.
78
+
79
+
Now you do that using the following command:
80
+
81
+
```text
82
+
./x test rustc_codegen_gcc
83
+
```
84
+
85
+
The backend needs to be [enabled](#choosing-which-codegen-backends-are-built) for this to work.
Copy file name to clipboardExpand all lines: src/doc/rustc-dev-guide/src/tests/running.md
-35Lines changed: 0 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -396,39 +396,4 @@ Now, tests should just run, you don't have to set up anything else.
396
396
[wasm32-wasip1 target support page]: https://github.com/rust-lang/rust/blob/master/src/doc/rustc/src/platform-support/wasm32-wasip1.md#building-the-target.
397
397
398
398
399
-
## Running rustc_codegen_gcc tests
400
-
401
-
First thing to know is that it only supports linux x86_64 at the moment. We will
402
-
extend its support later on.
403
-
404
-
You need to update `codegen-backends` value in your `bootstrap.toml` file in the
405
-
`[rust]` section and add "gcc" in the array:
406
-
407
-
```toml
408
-
codegen-backends = ["llvm", "gcc"]
409
-
```
410
-
411
-
Then you need to install libgccjit 12. For example with `apt`:
412
-
413
-
```text
414
-
apt install libgccjit-12-dev
415
-
```
416
-
417
-
Now you can run the following command:
418
-
419
-
```text
420
-
./x test compiler/rustc_codegen_gcc/
421
-
```
422
-
423
-
If it cannot find the `.so` library (if you installed it with `apt` for example), you
424
-
need to pass the library file path with `LIBRARY_PATH`:
425
-
426
-
```text
427
-
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/12/ ./x test compiler/rustc_codegen_gcc/
428
-
```
429
-
430
-
If you encounter bugs or problems, don't hesitate to open issues on the
0 commit comments