-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #123502 - bjorn3:sync_cg_clif-2024-04-05, r=bjorn3
Subtree sync for rustc_codegen_cranelift This fixes an ICE when compiling unchecked_shl/unchecked_shr. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
- Loading branch information
Showing
16 changed files
with
85 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ name: Abi-cafe | |
on: | ||
- push | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
abi_cafe: | ||
runs-on: ${{ matrix.os }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ name: Various rustc tests | |
on: | ||
- push | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
bootstrap_rustc: | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Building and testing with changes in rustc code | ||
|
||
This is useful when changing code in `rustc_codegen_cranelift` as part of changing [main Rust repository](https://github.com/rust-lang/rust/). | ||
This can happen, for example, when you are implementing a new compiler intrinsic. | ||
|
||
Instruction below uses `$RustCheckoutDir` as substitute for any folder where you cloned Rust repository. | ||
|
||
You need to do this steps to successfully compile and use the cranelift backend with your changes in rustc code: | ||
|
||
1. `cd $RustCheckoutDir` | ||
2. Run `python x.py setup` and choose option for compiler (`b`). | ||
3. Build compiler and necessary tools: `python x.py build --stage=2 compiler library/std src/tools/rustdoc src/tools/rustfmt` | ||
* (Optional) You can also build cargo by adding `src/tools/cargo` to previous command. | ||
4. Copy cargo from a nightly toolchain: `cp $(rustup +nightly which cargo) ./build/host/stage2/bin/cargo`. Note that you would need to do this every time you rebuilt `rust` repository. | ||
5. Link your new `rustc` to toolchain: `rustup toolchain link stage2 ./build/host/stage2/`. | ||
6. (Windows only) compile the build system: `rustc +stage2 -O build_system/main.rs -o y.exe`. | ||
7. You need to prefix every `./y.sh` (or `y` if you built `build_system/main.rs` as `y`) command by `rustup run stage2` to make cg_clif use your local changes in rustc. | ||
* `rustup run stage2 ./y.sh prepare` | ||
* `rustup run stage2 ./y.sh build` | ||
* (Optional) run tests: `rustup run stage2 ./y.sh test` | ||
8. 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`. | ||
|
||
You can also set `rust-analyzer.rustc.source` to your rust workspace to get rust-analyzer to understand your changes. |
Oops, something went wrong.