cargo objdump fails on `-triple` flag when used with a recent LLVM 11
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- documentation, embedded-iot
Research direction
Start with the Inspecting section of the QEMU chapter and reproduce the documented cargo objdump command using the LLVM 11 output shown. Check the cargo-binutils fix and publication status referenced in the issue, then update the documentation so the documented command works with the supported version; verify the final command against the reported workaround.
Written by the indexing model from the issue text.
Description
Running cargo objdump --bin app --release -- -disassemble -no-show-raw-insn -print-imm-hex as suggested in Inspecting section of QEMU chapter can produce the following error:
cargo objdump --bin app --release -- -disassemble -no-show-raw-insn -print-imm-hex
Finished release [optimized + debuginfo] target(s) in 0.02s
llvm-objdump: Unknown command line argument '-triple'. Try: '/home/vk/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-objdump --help'
llvm-objdump: Did you mean '--triple'?
llvm-objdump: Unknown command line argument '-disassemble'. Try: '/home/vk/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-objdump --help'
llvm-objdump: Did you mean '--disassemble'?
llvm-objdump: Unknown command line argument '-no-show-raw-insn'. Try: '/home/vk/.rustup/toolchains/stable-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'?
llvm-objdump: for the --reloc option: may only occur zero or one times!
llvm-objdump: Unknown command line argument '-print-imm-hex'. Try: '/home/vk/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-objdump --help'
llvm-objdump: Did you mean '--print-imm-hex'?
It seems that it's fixed with https://github.com/rust-embedded/cargo-binutils/commit/aa5464b4eaacfabe808d00db2e155df3740425a2, but might not been yet published on crates.io (https://github.com/rust-embedded/cargo-binutils/issues/93)
I'm using Ubuntu 20.04 with following llvm-objdump version:
bin/llvm-objdump --version
LLVM (http://llvm.org/):
LLVM version 11.0.0-rust-1.47.0-stable
Optimized build.
Default target: x86_64-unknown-linux-gnu
Host CPU: ivybridge
The workaround for me was installing cargo-binutils from GitHub and running it with double hyphens for all flags:
cargo install --git https://github.com/rust-embedded/cargo-binutils.git
cargo objdump --bin app --release -- --disassemble --no-show-raw-insn --print-imm-hex
- Dominant language
- No language data
- Stars
- 1.3k
- Forks
- 223
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-embedded/book
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
rust-embedded/book#414 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
rust-embedded/book#370 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
rust-embedded/book#345 · 2 reactions ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
rust-embedded/book#208 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 65/100
rust-embedded/book#147 ·
All issues in rust-embedded/book
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bancolombia/sentinel#22 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
objectionary/hone-maven-plugin#1061 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
redhat-developer/rhdh-plugins#4887 · 2 comments ·