gnzlbg / cargo-asm

cargo subcommand showing the assembly or llvm-ir generated for Rust code
https://github.com/gnzlbg/cargo-asm
Other
1.15k stars 39 forks source link

Support `rustc_codegen_cranelift` #252

Open AccessViolation95 opened 4 weeks ago

AccessViolation95 commented 4 weeks ago

It would be nice if cargo-asm supported rustc_codegen_cranelift. It would be nice for comparing the output of Cranelift and LLVM.

In order to make rustc use Cranelift, I have installed it following these instructions: https://github.com/rust-lang/rustc_codegen_cranelift

My project's Cargo.toml looks like this:

# This line needs to come before anything else in Cargo.toml
cargo-features = ["codegen-backend"]

[package]
name = "quick_test"
version = "0.1.0"
edition = "2021"

[profile.release]
codegen-backend = "cranelift"

The output I get when running cargo asm is:

error: Unknown option `-x86-asm-syntax`

error: could not compile `quick_test` (bin "quick_test") due to 1 previous error

Cargo failed with exit status: 101
mert-kurttutan commented 3 weeks ago

Fyi, this project is unmaintained. You might want to try this issue on cargo-show-asm, which is well maintained and the author is quite responsive.

AccessViolation95 commented 3 weeks ago

Already found that out and did that shortly after creating this issue here. Thanks 👍

mert-kurttutan commented 3 weeks ago

Oh, great. Anyways, it is a good documentation for whoever stumbles upon this issue.

AccessViolation95 commented 3 weeks ago

I'll link to the issue on the other repo, which was answered turned into an FAQ item, for whoever finds this: https://github.com/pacak/cargo-show-asm/discussions/287