Stream: cranelift

Topic: cg_clif can bootstrap rustc


view this post on Zulip bjorn3 (Jul 02 2020 at 18:23):

https://github.com/bjorn3/rustc_codegen_cranelift/issues/743#issuecomment-651108168

Cross posting from https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/bootstrap.20rustc.20using.20cg_clif

$ cd rustc_codegen_cranelift $ cargo build --release $ git clone https://github.com/rust-lang/rust.git $ cd rust $ git apply ../patches/* $ git apply - <<EOF diff --git a/src/bootstrap/bin/ru...
rust-lang org

view this post on Zulip bjorn3 (Jul 02 2020 at 18:23):

Depends on https://github.com/bytecodealliance/wasmtime/pull/1559 and https://github.com/bytecodealliance/wasmtime/pull/1939

According to the SystemV abi, struct arguments must be passed at a fixed stack offset. Cranelift didn't have any way to implement this before. This is necessary to compile proc-macros using cg_...
Fixes bjorn3/rustc_codegen_cranelift#757 Required by bjorn3/rustc_codegen_cranelift#743

view this post on Zulip Chris Fallin (Jul 02 2020 at 18:30):

Very nice!

view this post on Zulip Joey Gouly (Jul 03 2020 at 09:35):

@bjorn3 on x86 I assume?

view this post on Zulip Joey Gouly (Jul 03 2020 at 09:36):

Wondering how hard it would be to try on my arm64 machine

view this post on Zulip bjorn3 (Jul 03 2020 at 09:40):

Yes I used x86_64. arm64 doesn't yet work with cg_clif. The aarch64 backend doesn't yet support 128bit integers. Those are used very extensively in the const eval part of rustc. In fact the last thing I had to solve before cg_clif could bootstrap ristc was adding 128bit support to cranelift_frontend::Switch.

view this post on Zulip Joey Gouly (Jul 03 2020 at 09:42):

Does cranelift not have legalisation for 128 bit integers?

view this post on Zulip Benjamin Bouvier (Jul 03 2020 at 09:43):

We do have some of it; it might be disabled for the aarch64 backend, though, not sure.

view this post on Zulip bjorn3 (Jul 03 2020 at 09:54):

No new style backends have the necessary legalizations enabled. They only enable a small subset.

view this post on Zulip bjorn3 (Jul 03 2020 at 09:55):

Also for function parameters and calls the necessary legalizations are part of the abi handling for the old style backends.

view this post on Zulip bjorn3 (Jul 03 2020 at 09:56):

https://github.com/bytecodealliance/wasmtime/blob/08efcbd9d5638c3d1ff2989f00e65c22ddc3c803/cranelift/codegen/src/legalizer/boundary.rs#L465-L477

Standalone JIT-style runtime for WebAssembly, using Cranelift - bytecodealliance/wasmtime

view this post on Zulip bjorn3 (Jul 13 2020 at 10:45):

Can somebody please review https://github.com/bytecodealliance/wasmtime/pull/1939? It should be easy to do.

Fixes bjorn3/rustc_codegen_cranelift#757 Required by bjorn3/rustc_codegen_cranelift#743

view this post on Zulip bjorn3 (Jul 16 2020 at 18:56):

@Alex Crichton On https://github.com/bytecodealliance/wasmtime/pull/1559 the macOS builder failed without log. Can you restart it?

According to the SystemV abi, struct arguments must be passed at a fixed stack offset. Cranelift didn't have any way to implement this before. This is necessary to compile proc-macros using cg_...

view this post on Zulip Alex Crichton (Jul 16 2020 at 18:56):

eh I wouldn't worry about it, unfortunately we can't restart just one builder

view this post on Zulip Alex Crichton (Jul 16 2020 at 18:57):

and it passed debug tests on macos so it's unlikely to fail in release anyway

view this post on Zulip bjorn3 (Jul 16 2020 at 18:58):

okay

view this post on Zulip bjorn3 (Jul 17 2020 at 11:55):

https://github.com/bytecodealliance/wasmtime/pull/1559 has been merged, so it is no longer necessary to patch cg_clif to bootstrap rustc. Only rustc needs to be patched to integrate with cg_clif. https://github.com/bjorn3/rustc_codegen_cranelift/issues/743#issuecomment-660046919

According to the SystemV abi, struct arguments must be passed at a fixed stack offset. Cranelift didn't have any way to implement this before. This is necessary to compile proc-macros using cg_...

view this post on Zulip Benjamin Bouvier (Jul 17 2020 at 11:57):

Great work @bjorn3 !

view this post on Zulip bjorn3 (Jul 17 2020 at 11:57):

Thanks!


Last updated: Nov 22 2024 at 17:03 UTC