[英]Is there way to use xbuild instead of build when calling cargo-binutils commands?
I try to use binutils commands for binary of custom build target with cargo xbuild
command.我尝试将 binutils 命令用于自定义构建目标的二进制文件和
cargo xbuild
命令。
However, I get an error like below message.但是,我收到类似以下消息的错误。
$ cargo nm --target i586-rust_dos.json --bin rust_dos --verbose
"cargo" "build" "--target" "i586-rust_dos.json" "--bin" "rust_dos" "--message-format=json"
Compiling rust_dos v0.1.0 (/home/soya/Documents/src/rust/prac/rust_dos)
error[E0463]: can't find crate for `core` ] 0/2
|
= note: the `i586-rust_dos-8410465322435951119` target may not be installed
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: could not compile `rust_dos`.
To learn more, run the command again with --verbose.
error: Failed to parse crate metadata
I realized that cargo nm
uses cargo build
command,我意识到
cargo nm
使用cargo build
命令,
so I think this error should be solved if I make cargo nm
to use cargo xbuild
instead of cargo build
.所以我认为如果我让
cargo nm
使用cargo xbuild
而不是cargo build
应该可以解决这个错误。
However, I cannot find how to do that.但是,我找不到如何做到这一点。
Please teach me if there is a way.如果有办法请教我。
To detect core
crate built with cargo xbuild
, I need to add sysroot
flag in rustflags
in .cargo/config
.要检测使用
cargo xbuild
构建的core
板条箱,我需要在.cargo/config
的rustflags
中添加sysroot
标志。
example is below.示例如下。
rustflags = ["--sysroot", "/full/path/to/sysroot/directory"]
There is sysroot directory in project's target directory.项目的目标目录中有 sysroot 目录。
If adding these flags, cargo-bintuils commands are enabled to use as far as in my environment.如果添加这些标志,则可以在我的环境中使用 cargo-bintuils 命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.