Skip to content
The missing libclang_rt.builtins-wasm32.a file to compile to WebAssembly.
Branch: master
Clone or download
jedisct1 Use wasm32-wasi
Signed-off-by: Frank Denis <github@pureftpd.org>
Latest commit 2f799ab May 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
precompiled Import Apr 7, 2019
README.md Use wasm32-wasi May 18, 2019

README.md

libclang_rt.builtins-wasm32.a

LLVM 8 can compile to WebAssembly out of the box.

If you are using macOS with Homebrew, or another operating system with up-to-date LLVM packages, you're all set.

Almost.

Unless your WebAssembly application is compute-only, you still need some kind of interface with the system.

WASI is the de facto standard, and can be compiled using a stock clang/LLVM 8 installation.

Its source code can be found here: WASI sysroot, and compiles fine even on non-Linux system.

Now you should be all set:

clang --target=wasm32-wasi --sysroot=/opt/wasi-sysroot -O2 test.c

Almost.

Building an object file or library will work, but building a module will not, due to the libclang_rt.builtins-wasm32.a file missing.

You can either recompile clang_rt from the wasi-sdk repository to get it.

Or directly download that file here: libclang_rt.builtins-wasm32.a.

It is now also distributed with the WASI SDK releases, as a separate tarball.

You can’t perform that action at this time.