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

`--target` not working properly — could not find any output files #243

Open masklinn opened 2 years ago

masklinn commented 2 years ago

According to e.g. #142, it seems like cargo asm --target=$TARGET should work, but when I try it cargo asm replies:

[ERROR]: cargo asm could not find any output files!%                                                                                                                                                                                                 

All I've done was rustup target add $TARGET, on compilation the artefacts end up into target/$TARGET/release but otherwise seem fine (the binary runs). The Cargo.toml was not updated with any sort of toolchain or target information (not sure it's relevant).

Also if the builddir is not clean, rather than fail cargo asm dumps the contents from the default target.

> rustup --version
rustup 1.24.3 (ce5817a94 2021-05-31)
> cargo --version
cargo 1.58.0 (7f08ace4f 2021-11-24)
> rustup toolchain list
stable-aarch64-apple-darwin (default)
nightly-aarch64-apple-darwin
> rustup target list | rg installed
aarch64-apple-darwin (installed)
x86_64-apple-darwin (installed)

I was trying to look at the x86_64 output from an aarch64 machine.

luojia65 commented 2 years ago

Can reproduce, I uses .cargo/config.toml target.

pacak commented 1 year ago

https://crates.io/crates/cargo-show-asm should support crosscompilation as expected.