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
Auto merge of #112080 - matthiaskrgr:rollup-pmpbe49, r=matthiaskrgr
Rollup of 6 pull requests
Successful merges:
- #111558 (Move tests)
- #111827 (Add build instructions for cranelift backend as part of Rust repo)
- #111988 (Make `TyKind: Debug` have less verbose output)
- #112022 (Check nested obligations during coercion unify in new solver)
- #112057 (Suggest correct `self_ty`)
- #112063 (Add a test for issue 110457/incremental ICE with closures with the same span)
Failed merges:
- #112068 (Move tests from `ui/discrim` dir)
r? `@ghost`
`@rustbot` modify labels: rollup
Copy file name to clipboardExpand all lines: compiler/rustc_codegen_cranelift/Readme.md
+26
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,32 @@ This will build your project with rustc_codegen_cranelift instead of the usual L
42
42
43
43
For additional ways to use rustc_codegen_cranelift like the JIT mode see [usage.md](docs/usage.md).
44
44
45
+
## Building and testing with changes in rustc code
46
+
47
+
This is useful when changing code in `rustc_codegen_cranelift` as part of changing [main Rust repository](https://github.com/rust-lang/rust/).
48
+
This can happen, for example, when you are implementing a new compiler intrinsic.
49
+
50
+
Instruction below uses `$RustCheckoutDir` as substitute for any folder where you cloned Rust repository.
51
+
52
+
You need to do this steps to successfully compile and use the cranelift backend with your changes in rustc code:
53
+
54
+
1.`cd $RustCheckoutDir`
55
+
2. Run `python x.py setup` and choose option for compiler (`b`).
8. You need to prefix every `./y.rs` (or `y` if you built `y.rs`) command by `rustup run stage2` to make cg_clif use your local changes in rustc.
65
+
66
+
*`rustup run stage2 ./y.rs prepare`
67
+
*`rustup run stage2 ./y.rs build`
68
+
* (Optional) run tests: `rustup run stage2 ./y.rs test`
69
+
9. Now you can use your cg_clif build to compile other Rust programs, e.g. you can open any Rust crate and run commands like `$RustCheckoutDir/compiler/rustc_codegen_cranelift/dist/cargo-clif build --release`.
70
+
45
71
## Configuration
46
72
47
73
See the documentation on the `BackendConfig` struct in [config.rs](src/config.rs) for all
0 commit comments