-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
objdump: use -arch-name instead of -triple #19
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
infer the arch-name from the output of `rustc --print cfg` is more robust than just using the target name for the -triple flag. fixes #17
This was referenced Aug 26, 2018
Merged
ping @ryankurte @therealprof anyone of you up for reviewing this? |
therealprof
approved these changes
Aug 28, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
bors r=therealprof |
bors bot
added a commit
that referenced
this pull request
Aug 28, 2018
19: objdump: use -arch-name instead of -triple r=therealprof a=japaric infer the arch-name from the output of `rustc --print cfg` is more robust than just using the target name for the -triple flag. fixes #17 r? @rust-embedded/tools (anyone) cc @danc86 Co-authored-by: Jorge Aparicio <[email protected]>
Build succeeded |
bors bot
added a commit
that referenced
this pull request
Aug 28, 2018
20: build and inspect r=therealprof a=japaric build and inspect this commits extends the UI with the following flag: - `--bin` - `--example` - `--lib` - `--release` if one of `--bin`, `--example` or `--lib` is used then cargo-$tool will first build the Cargo project and then proceed to run the llvm tool on the output artifact -- that is the output artifact will be the first argument passed to the llvm tool. `--release` controls whether the project is compiled with optimizations or not. if none of these three flags is passed then the old behavior is used. No path to an artifact is passed to the llvm tool and the user is expected to provide it. this new logic supports workspaces and the CARGO_TARGET_DIR env variable. closes #15 r? @rust-embedded/tools (anyone) This builds on top on #19 so that should be merged first --- ### Sample outputs: ``` rust $ cargo new --lib foo && cd $_ $ cat >src/lib.rs <<'EOF' #![no_std] #[no_mangle] pub fn foo(x: u32, y: u32) -> u32 { x + y } EOF $ cargo objdump --lib --release -- -disassemble 2>/dev/null /home/japaric/tmp/foo/target/release/libfoo.rlib(foo-136cd7af94a84b98.foo.awvzjwiu-cgu.0.rcgu.o): file format ELF64-x86-64 Disassembly of section .text.foo: foo: 0: 8d 04 37 leal (%rdi,%rsi), %eax 3: c3 retq $ cargo objdump --target aarch64-unknown-linux-gnu --lib --release -- -disassemble 2>/dev/null /home/japaric/tmp/foo/target/aarch64-unknown-linux-gnu/release/libfoo.rlib(foo-05ebc283581f4ba3.foo.9kf7hsz7-cgu.0.rcgu.o): file format ELF64-aarch64-little Disassembly of section .text.foo: foo: 0: 20 00 00 0b add w0, w1, w0 4: c0 03 5f d6 ret $ cargo objdump --target riscv32imac-unknown-none-elf --lib --release -- -disassemble 2>/dev/null /home/japaric/tmp/foo/target/riscv32imac-unknown-none-elf/release/libfoo.rlib(foo-05ebc283581f4ba3.foo.9kf7hsz7-cgu.0.rcgu.o): file format ELF32-riscv Disassembly of section .text.foo: foo: 0: 33 85 a5 00 add a0, a1, a0 4: 67 80 00 00 ret $ cargo objdump --target thumbv7m-none-eabi --lib --release -- -disassemble 2>/dev/null /home/japaric/tmp/foo/target/thumbv7m-none-eabi/release/libfoo.rlib(foo-05ebc283581f4ba3.foo.9kf7hsz7-cgu.0.rcgu.o): file format ELF32-arm-little Disassembly of section .text.foo: foo: 0: 08 44 add r0, r1 2: 70 47 bx lr ``` Help text: ``` console $ cargo nm -h cargo-nm 0.1.2 Proxy for the `llvm-nm` tool shipped with the Rust toolchain. USAGE: cargo-nm [FLAGS] [OPTIONS] [--] [args]... FLAGS: -h, --help Prints help information --lib Build only this package's library --release Build artifacts in release mode, with optimizations -V, --version Prints version information -v, --verbose Use verbose output OPTIONS: --bin <NAME> Build only the specified binary --example <NAME> Build only the specified example --target <TRIPLE> Target triple for which the code is compiled ARGS: <args>... The specified <args>... will all be passed to the final tool invocation. ``` Co-authored-by: Jorge Aparicio <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
infer the arch-name from the output of
rustc --print cfg
is more robust thanjust using the target name for the -triple flag.
fixes #17
r? @rust-embedded/tools (anyone)
cc @danc86