rustc_target/spec/targets/
wasm32_wali_linux_musl.rs

1//! The `wasm32-wali-linux-musl` target is a wasm32 target compliant with the
2//! [WebAssembly Linux Interface](https://github.com/arjunr2/WALI).
3
4use crate::spec::{Cc, LinkerFlavor, Target, TargetMetadata, base};
5
6pub(crate) fn target() -> Target {
7    let mut options = base::linux_wasm::opts();
8
9    options
10        .add_pre_link_args(LinkerFlavor::WasmLld(Cc::No), &["--export-memory", "--shared-memory"]);
11    options.add_pre_link_args(
12        LinkerFlavor::WasmLld(Cc::Yes),
13        &["--target=wasm32-wasi-threads", "-Wl,--export-memory,", "-Wl,--shared-memory"],
14    );
15
16    Target {
17        llvm_target: "wasm32-wasi".into(),
18        metadata: TargetMetadata {
19            description: Some("WebAssembly Linux Interface with musl-libc".into()),
20            tier: Some(3),
21            host_tools: Some(false),
22            std: None,
23        },
24        pointer_width: 32,
25        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(),
26        arch: "wasm32".into(),
27        options,
28    }
29}