Target

要查看 rust 支持的 target,运行:

rustc --print target-list

rustc 内置支持的 target 可以在 rust-target-spec 中查看。

自定义 target

除了内置的 target 外,rustc 允许添加自定义 target。每个 target 都是一个 json 文件。要查看指定 target 的内容,运行: [1]

rustc +nightly -Z unstable-options --target=wasm32-unknown-unknown --print target-spec-json

在使用自定义 target 的时候,std 也需要重新编译。参见: build-std


1. 此功能的正式名称为:Custom target specification.
Last moify: 2023-07-01 00:26:25
Build time:2025-07-18 09:41:42
Powered By asphinx