by yurydelendik

yurydelendik / wasmception

Minimal C/C++ language toolset for building wasm files

126 Stars 24 Forks Last release: Not found 53 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

NOTE: this project is archived in favor of WASI SDK.


Minimal toolset for building wasm files

Export functions

Use linker's

parameter to specify exports (with clang use
, e.g.
). The use of
__attribute__ ((visibility ("default")))
is no longer preferable way to make methods visible --
needs to be added.

Compile C file

$(WASMCEPTION)/dist/bin/clang --sysroot=$(WASMCEPTION)/sysroot/ hi.c -o hi.wasm -nostartfiles -Wl,--no-entry,--export=foo

Compile C++ file

$(WASMCEPTION)/dist/bin/clang++ --sysroot=$(WASMCEPTION)/sysroot/ hi.cpp -o hi.wasm -nostartfiles -Wl,--no-entry,--export=bar -fno-exceptions



will not require you to define the
function, but will be looking for the
function: use
clang (linker) option to avoid specified entry point. As alternative, you can add
void _start() {}
extern "C" void _start() { }
in C++) to make linker happy due to

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.