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.add_pre_link_args(
10        LinkerFlavor::WasmLld(Cc::No),
11        &["--export-memory", "--shared-memory", "--max-memory=1073741824"],
12    );
13    options.add_pre_link_args(
14        LinkerFlavor::WasmLld(Cc::Yes),
15        &[
16            "--target=wasm32-wasi-threads",
17            "-Wl,--export-memory,",
18            "-Wl,--shared-memory",
19            "-Wl,--max-memory=1073741824",
20        ],
21    );
22
23    Target {
24        llvm_target: "wasm32-wasi".into(),
25        metadata: TargetMetadata {
26            description: Some("WebAssembly Linux Interface with musl-libc".into()),
27            tier: Some(3),
28            host_tools: Some(false),
29            std: None,
30        },
31        pointer_width: 32,
32        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(),
33        arch: "wasm32".into(),
34        options,
35    }
36}