Skip to content

Commit 6c389fe

Browse files
authored
Add instructions for stdlib builds
1 parent b182f23 commit 6c389fe

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/WebAssembly.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ available yet, specifically:
1616
* Binary size is a high priority requirement. Since WebAssembly payloads are usually served in browsers,
1717
one wouldn't want end users to download multi-megabyte binaries.
1818

19+
## Running Wasm stdlib tests
20+
21+
If you're a compiler/stdlib engineer, this invocation builds LLVM, Swift, installs those together with necessary
22+
tools, and also builds WasmKit to execute stdlib tests:
23+
24+
```
25+
./utils/build-script --build-wasm-stdlib --wasmkit --build-embedded-stdlib --build-embedded-stdlib-cross-compiling \
26+
--install-swift --install-llvm \
27+
'--llvm-install-components=llvm-ar;llvm-nm;llvm-ranlib;llvm-cov;llvm-profdata;llvm-objdump;llvm-objcopy;llvm-symbolizer;IndexStore;clang;clang-resource-headers;builtins;runtimes;clangd;libclang;dsymutil;LTO;clang-features-file;lld' \
28+
--sccache
29+
```
30+
31+
On macOS it's also best to avoid cross-compiling host tools from arm64 to x86 and vice versa, add this option to avoid that: `--infer-cross-compile-hosts-on-darwin=false`.
32+
1933
## Building Swift SDK for WebAssembly
2034

2135
The [Swift SDK](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0387-cross-compilation-destinations.md)

0 commit comments

Comments
 (0)