最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Cross-compiling a Rust application with Yocto SDK for Raspberry Pi 4 fails - Stack Overflow

programmeradmin1浏览0评论

I'm working on a Yocto distribution with Scarthgap for the Raspberry Pi 4, I can successfully build a rust hello-world example within the image build. Now, I want to generate a toolchain to cross compile.

To include the Rust toolchain in my SDK, I added the following line to my configuration:

TOOLCHAIN_HOST_TASK:append =  " nativesdk-rust nativesdk-cargo" 

After building the SDK, I loaded the environment file from the SDK and attempted to cross-compile a simple "Hello, World!" Rust application using cargo. However, I encountered the following error:

$ cargo run
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: Error loading target specification: Could not find specification for target "x86_64-oesdk-linux-gnu". Run `rustc --print target-list` for a list of built-in targets
$ rustc --print target-list
error: Error loading target specification: Could not find specification for target "x86_64-oesdk-linux-gnu". Run `rustc --print target-list` for a list of built-in targets

I couldn't find any resources or tutorials on this topic. I'm looking for guidance on using the SDK. Is cross-compiling Rust with the Yocto SDK still too new and not yet fully functional?

发布评论

评论列表(0)

  1. 暂无评论