Cargo objdump syntax?

I cannot figure out the correct syntax for running an objdump on my risc-v rust project.

cargo objdump --example user_stack -- -C -d -no-show-raw-insn

error msg

llvm-objdump: Unknown command line argument '-arch-name'.  Try: '/home/dkhayes117/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-objdump --help'
llvm-objdump: Did you mean '--arch-name'?
llvm-objdump: Unknown command line argument '-no-show-raw-insn'.  Try: '/home/dkhayes117/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-objdump --help'
llvm-objdump: Did you mean '--no-show-raw-insn'?

My target is riscv32imac-unknown-none-elf

EDIT:
running cargo objdump -- -version gives me the same error message.

Same issue here for the rust embedded project:

cargo objdump --target thumbv7em-none-eabi --bin interrupt_system_tick_new_version --features "use-stm32f407g-disc1" --release -- -disassemble -no-show-raw-i
nsn
    Finished release [optimized + debuginfo] target(s) in 0.02s
llvm-objdump: Unknown command line argument '-triple'.  Try: '/Users/wison/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/bin/llvm-objdump --help'
llvm-objdump: Did you mean '--triple'?
llvm-objdump: Unknown command line argument '-disassemble'.  Try: '/Users/wison/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/bin/llvm-objdump --help'
llvm-objdump: Did you mean '--disassemble'?
llvm-objdump: Unknown command line argument '-no-show-raw-insn'.  Try: '/Users/wison/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/bin/llvm-objdump --help'
llvm-objdump: Did you mean '--no-show-raw-insn'?

If you're using cargo-binutils (https://github.com/rust-embedded/cargo-binutils) then cargo objdump is just a wrapper around the version of objdump provided by rustc's bundled LLVM. The arguments accepted by llvm-objdump are documented here:

https://releases.llvm.org/11.0.0/docs/CommandGuide/llvm-objdump.html

(LLVM 11 is the version used by rustc as of 1.47, see here.)

In your case the basic issue is that llvm-objdump requires long options to start with --, not just -.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.