Armv7-unknown-linux-uclibceabi

$ rustc --print=target-list | grep armv7-unknown-linux-uclibceabi
armv7-unknown-linux-uclibceabi
armv7-unknown-linux-uclibceabihf

$ rustup target add armv7-unknown-linux-uclibceabi
error: toolchain 'stable-x86_64-unknown-linux-gnu' does not support target 'armv7-unknown-linux-uclibceabi'
note: you can see a list of supported targets with rustc --print=target-list
note: if you are adding support for a new target to rustc itself, see Adding a new target - Rust Compiler Development Guide

rustc target-list can get the armv7-unknown-linux-uclibceabi target, but rustup target add failed, what's the meaning of that?

It seems 'rustup target list' don't have the uclibc target.
what's the different between rustup target list and rustc --print=target-list.

The key point is what I need to do if we want to support armv7-unknown-linux-uclibceabi
target

it is a tier 3 target.

in short, it is a target that the compiler backend (llvm) can generate code for, but the prebuilt standard libraries is not available to download via the official rustup.

in order to cross compile for the target, you need to build the standard library from source, this is not very difficult to do:

  • first make sure you are using nightly toolchain:
    • rustup default nightly
  • then make sure the rust-src component is installed:
    • rustup component add rust-src
  • configure cargo to use the cross compiler toolchain, example of .cargo/config.toml.:
    [target.armv7-unknown-linux-uclibceabi]
    cc = "/opt/cross-compiler/bin/arm-unknown-linux-uclibcgnueabi-gcc"
    linker = "/opt/cross-compiler/bin/arm-unknown-linux-uclibcgnueabi-gcc"
    
    in my experience, linker is mandatory, other tools (such ar, cxx etc) may or may not be required.
  • build your project with the cargo command line flag -Z build-std and --target, e.g.:
    • cargo build -Z build-std --target armv7-unknown-linux-uclibceabi

Dear Sir,
Thank you very much for your explanation!
OK, we will try to compile the source by our toolchain.