I got rustc bootstrapping using cg_clif. Unfortunately the rustc built using cg_clif crashes when you try to use it. So far I have been able to pin point that
make_input returns an
io::Error. When trying to
.to_string() it it turns out that the
io::Error has an invalid discriminant.
How do I continue debugging from this point on? I normally just removed code piece by piece and added printf for values I suspected to be corrupted. However for rustc this is not feasible, as the recompilation takes way too long.
Rust fork: https://github.com/bjorn3/rust/commit/e5c309197bf97c12c5d0782b9300417a52c80f66 (branch cg_clif_subtree)
cg_clif commit: https://github.com/bjorn3/rustc_codegen_cranelift/commit/f7eb36070c602f0dccca26ccec83f1c003cb27dd (branch wip_proc_macro_fixes, clone it to
src/rustc_codegen_cranelift in the rust source repo)
Cranelift commit: https://github.com/bjorn3/wasmtime/commit/2d60da466dc375b0cb08ad62e49879927f176619 (pr bytecodealliance/wasmtime#1559, clone it to the parent dir of the rust repo, or edit Cargo.toml of the rust repo to point to it in the patch section)
[rust] codegen-backends = ["cranelift"] deny-warnings = false
^ any suggestions?
@bjorn3 you can try to use
rr to find the code that last wrote the memory address containing the bad discriminant