-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support configuring the set of codegen backends to build per host triple #120348
Conversation
This allows building the compiler itself with one backend while using another backend at runtime. For example this allows compiling rustc to wasm using LLVM, while using Cranelift at runtime to produce actual code. Cranelift can't compile to wasm, but is perfectly capable of running on wasm. LLVM can compile to wasm, but can't run on wasm. [^1] [^1]: The prototype of this still requires a couple of other patches.
(rustbot has picked a reviewer for you, use r? to override) |
This PR modifies If appropriate, please update This PR modifies If appropriate, please update |
@@ -581,6 +581,7 @@ pub struct Target { | |||
pub wasi_root: Option<PathBuf>, | |||
pub qemu_rootfs: Option<PathBuf>, | |||
pub no_std: bool, | |||
pub codegen_backends: Option<Vec<Interned<String>>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a change info for this field? Similar to
rust/src/bootstrap/src/utils/change_tracker.rs
Lines 74 to 78 in 04521fd
ChangeInfo { | |
change_id: 117435, | |
severity: ChangeSeverity::Info, | |
summary: "New option `rust.parallel-compiler` added to config.toml.", | |
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
This comment has been minimized.
This comment has been minimized.
4f107e6
to
f4e279f
Compare
How does this interact with stages ? |
If the host triple matches the build triple, then setting it in |
Thanks for the PR! |
☀️ Test successful - checks-actions |
Finished benchmarking commit (93a65c6): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 639.468s -> 638.862s (-0.09%) |
This allows building the compiler itself with one backend while using another backend at runtime. For example this allows compiling rustc to wasm using LLVM, while using Cranelift at runtime to produce actual code. Cranelift can't compile to wasm, but is perfectly capable of running on wasm. LLVM can compile to wasm, but can't run on wasm. 1
Footnotes
The prototype of this still requires a couple of other patches. ↩