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/rustc_codegen_gcc.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,14 @@ Rust for Linux can be compiled with `rustc_codegen_gcc` which allows to have a G
8
8
9
9
## Building `rustc_codegen_gcc` and the sysroot
10
10
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).
14
12
15
13
## Building Rust for Linux
16
14
17
15
Follow the [Rust for Linux Quick Start instructions](https://docs.kernel.org/rust/quick-start.html) with a few changes as explained below.
18
16
17
+
First, disable `MITIGATION_RETPOLINE` in `menuconfig` at: Mitigations for CPU vulnerabilities -> Avoid speculative indirect branches in kernel.
18
+
19
19
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:
20
20
21
21
```sh
@@ -25,14 +25,14 @@ rustup override set nightly-2023-10-21 # Adjust to the version used by the GCC c
25
25
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`):
26
26
27
27
```sh
28
-
make -j20 KRUSTFLAGS="-Zcodegen-backend=/path/to/rustc_codegen_gcc/target/debug/librustc_codegen_gcc.so \
[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