Skip to content

Commit 1866000

Browse files
authored
Merge pull request #43 from antoyo/update/cg_gcc_page
Update the page for rustc_codegen_gcc
2 parents f5ad8fa + 0247aeb commit 1866000

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/rustc_codegen_gcc.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ Rust for Linux can be compiled with `rustc_codegen_gcc` which allows to have a G
88

99
## Building `rustc_codegen_gcc` and the sysroot
1010

11-
The following have been tested with GCC commit [b334f15ed21c95868059a16484a1948be08e26a3](https://github.com/antoyo/gcc/commit/b334f15ed21c95868059a16484a1948be08e26a3) and `rustc_codegen_gcc` commit [c6bc7ecd65046ee502118664f42637ca318cdfb5](https://github.com/rust-lang/rustc_codegen_gcc/commit/c6bc7ecd65046ee502118664f42637ca318cdfb5).
12-
13-
Follow the build instructions [here](https://github.com/rust-lang/rustc_codegen_gcc#building).
11+
Follow the build instructions [here](https://github.com/rust-lang/rustc_codegen_gcc#quick-start).
1412

1513
## Building Rust for Linux
1614

1715
Follow the [Rust for Linux Quick Start instructions](https://docs.kernel.org/rust/quick-start.html) with a few changes as explained below.
1816

17+
First, disable `MITIGATION_RETPOLINE` in `menuconfig` at: Mitigations for CPU vulnerabilities -> Avoid speculative indirect branches in kernel.
18+
1919
Since the GCC codegen might not work on every nightly version (that should soon be fixed now that we run some tests in the Rust CI), we're going to use [the same nightly version as the GCC codegen](https://github.com/rust-lang/rustc_codegen_gcc/blob/master/rust-toolchain) instead of using the version recommended by Rust for Linux:
2020

2121
```sh
@@ -25,14 +25,14 @@ rustup override set nightly-2023-10-21 # Adjust to the version used by the GCC c
2525
Now, you need to set some variables to build Rust for Linux with the GCC codegen (do not forget to adjust your path to `rustc_codegen_gcc`):
2626

2727
```sh
28-
make -j20 KRUSTFLAGS="-Zcodegen-backend=/path/to/rustc_codegen_gcc/target/debug/librustc_codegen_gcc.so \
29-
--sysroot /path/to/rustc_codegen_gcc/build_sysroot/sysroot" \
28+
make -j20 KRUSTFLAGS="-Zcodegen-backend=/path/to/rustc_codegen_gcc/target/debug/librustc_codegen_gcc.so" \
3029
HOSTRUSTFLAGS="-Zcodegen-backend=/path/to/rustc_codegen_gcc/target/debug/librustc_codegen_gcc.so \
3130
--sysroot /path/to/rustc_codegen_gcc/build_sysroot/sysroot -Clto=no"
3231
```
3332

34-
Since we use a different nightly version, you might need to adjust the code of the `alloc` crate built by Rust for Linux.
35-
You'll see some errors when running the above command in this case.
33+
## CI
34+
35+
We have a [repo](https://github.com/Rust-for-Linux/ci-rustc_codegen_gcc) that runs some tests of Rust for Linux compiled with `rustc_codegen_gcc`.
3636

3737
## Troubleshooting
3838

@@ -49,4 +49,4 @@ That should give you the correct error, which could be one of those:
4949
## Contact
5050

5151
Please contact Antoni Boucher (antoyo) on
52-
[IRC](https://web.libera.chat/#rustc_codegen_gcc).
52+
[Matrix](https://matrix.to/#/#rustc_codegen_gcc:matrix.org) or post a message on [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/386786-rustc-codegen-gcc).

0 commit comments

Comments
 (0)