Skip to content

[BUG] Unsupported Rust target x86_64-unknown-nuttx #3422

@wllenyj

Description

@wllenyj

Description / Steps to reproduce the issue

When I configure sim:nsh in x84_64 Ubuntu, I got the target triples are x86_64-unknown-nuttx. And the error is happend as

echo "Building Rust code with cargo..."
Building Rust code with cargo...
NUTTX_INCLUDE_DIR=/xxx/nuttx/nuttx/include:/xxx/nuttx/nuttx/include/arch cargo build -Zbuild-std=std,panic_abort --manifest-path /xxx//nuttx/nuttx-apps/examples/rust/
hello/Cargo.toml --target x86_64-unknown-nuttx
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/XXX/.rustup/toolchains/nightly-2025-08-20-x86_64-unknown-linux-gnu/bin/rustc - --crate-name ___ --print=file-names --target x86_64-unknown-nuttx --crate-type bin --cr
ate-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 -Wwarnings` (exit status: 1)
  --- stderr
  error: error loading target specification: could not find specification for target "x86_64-unknown-nuttx"
    |
    = help: run `rustc --print target-list` for a list of built-in targets

We can get the target-list in 1.91.0-nightly and 1.95.0-nightly,

╰─[10:57] [0] $ rustc --print target-list | grep nuttx
aarch64-unknown-nuttx
armv7a-nuttx-eabi
armv7a-nuttx-eabihf
riscv32imac-unknown-nuttx-elf
riscv32imafc-unknown-nuttx-elf
riscv32imc-unknown-nuttx-elf
riscv64gc-unknown-nuttx-elf
riscv64imac-unknown-nuttx-elf
thumbv6m-nuttx-eabi
thumbv7a-nuttx-eabi
thumbv7a-nuttx-eabihf
thumbv7em-nuttx-eabi
thumbv7em-nuttx-eabihf
thumbv7m-nuttx-eabi
thumbv8m.base-nuttx-eabi
thumbv8m.main-nuttx-eabi
thumbv8m.main-nuttx-eabihf

There is no x86_64-unknown-nuttx support in the Rust target-list.

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

Ubuntu 22.04.5

NuttX Version

master

Issue Architecture

[Arch: x86_64]

Issue Area

[Area: Build System]

Host information

Ubuntu 22.04.5

Verification

  • I have verified before submitting the report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions