Skip to main content

rustc_target/spec/targets/
wasm32_none_component.rs

1use crate::spec::{Arch, Cc, LinkerFlavor, Os, Target, TargetMetadata, base};
2
3pub(crate) fn target() -> Target {
4    let mut options = base::wasm::options();
5
6    options.os = Os::None;
7    options.linker = Some("wasm-component-ld".into());
8
9    options.add_pre_link_args(
10        LinkerFlavor::WasmLld(Cc::No),
11        &[
12            // For now this target just never has an entry symbol no matter the output
13            // type, so unconditionally pass this.
14            "--no-entry",
15        ],
16    );
17
18    Target {
19        llvm_target: "wasm32-none-component".into(),
20        metadata: TargetMetadata {
21            description: Some("WebAssembly".into()),
22            tier: Some(3),
23            host_tools: Some(false),
24            std: Some(false),
25        },
26        pointer_width: 32,
27        data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
28        arch: Arch::Wasm32,
29        options,
30    }
31}