WebAssembly/wasi-sdk logo

WebAssembly/wasi-sdk

Free

WASI-enabled WebAssembly C/C++ toolchain

FreeFree tier
Type
Open Source
Company
WebAssembly

About WebAssembly/wasi-sdk

WASI SDK is an open-source C/C++ toolchain for compiling programs to WebAssembly with WASI (WebAssembly System Interface) support. It provides prebuilt SDK packages that include a Clang/LLVM compiler configured to target WASI, along with a sysroot based on wasi-libc. The toolchain uses git submodules to pull upstream Clang, LLVM, and wasi-libc sources, and offers a two-step CMake build process (first the compiler, then the sysroot). It also supports cross-compilation via Rust target triples and includes runtime library objects needed for proper compilation. The SDK is maintained under the official WebAssembly GitHub organization and leverages mature compiler infrastructure for reliable code generation.

Key Features

Prebuilt SDK packages for WASI-enabled WebAssembly
Uses git submodules to pull upstream Clang, LLVM, and wasi-libc
Builds configured to set default target and sysroot out of the box
Supports standard Clang with --target=wasm32-wasi and sysroot
Two-step CMake build process: toolchain then sysroot
Supports cross-compilation with Rust target triple
Includes libclang_rt.*.a objects for runtime support
Open source under WebAssembly organization

Pros & Cons

Pros
  • Free and open source, with full source code available on GitHub
  • Leverages mature LLVM/Clang compiler infrastructure
  • Prebuilt SDK packages simplify setup for quick start
  • Integration with CMake for building projects
  • Part of the official WebAssembly project ensures long-term support
Cons
  • Build process requires multiple dependencies (cmake, clang, ninja, python3, cargo)
  • Two-step build (toolchain and sysroot) can be time-consuming
  • Limited to WASI target; not for browser WebAssembly with DOM APIs

Best For

Compiling C/C++ programs to WebAssembly for WASI runtimeBuilding portable WebAssembly modules for server-side or edge computingDeveloping cross-platform applications with WebAssembly outside the browser

FAQ

How to clone the repository?
Use git clone --recursive https://github.com/WebAssembly/wasi-sdk.git to include submodules.
What are the requirements to build wasi-sdk?
The build process needs cmake, clang, ninja, python3, and cargo installed on your system.
How to build the toolchain?
First build the toolchain with: cmake -G Ninja -B build/toolchain -S . -DWASI_SDK_BUILD_TOOLCHAIN=ON -DCMAKE_INSTALL_PREFIX=build/install, then cmake --build build/toolchain --target install.