• This repository has been archived on 06/Apr/2019
  • Stars
    star
    133
  • Rank 272,600 (Top 6 %)
  • Language Makefile
  • Created almost 7 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

wasmception

Minimal toolset for building wasm files

Export functions

Use linker's --export parameter to specify exports (with clang use -Wl,--export, e.g. -Wl,--export=foo,--export=bar). The use of __attribute__ ((visibility ("default"))) is no longer preferable way to make methods visible -- --export-dynamic 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

Required main and _start functions

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

More Repositories

1

pdfjs-react

Simple example of using PDF.js components with React.
JavaScript
83
star
2

rtmp.js

Real Time Message Protocol (RTMP) messaging library in JavaScript
TypeScript
76
star
3

zbarjs

Simple barcode scanning application
JavaScript
51
star
4

webassembly-dwarf

Findings to help in understading DWARF sections stored in the WebAssembly binaries.
HTML
22
star
5

wasm-dwarf

Reading DWARF information from wasm files.
Rust
17
star
6

wtmaps-utils

Utils to manage DWARF information in mutating wasm files
Rust
11
star
7

clang-heroku-slug

Source for WebAssembly Studio clang service
JavaScript
9
star
8

old-man-sandbox

My random stuff to be visible on internet
JavaScript
8
star
9

sqlite-playground

Simple WebAssembly demo using source map
C
8
star
10

wasmtext

WebAssembly text output using wasmparser in rust
Rust
8
star
11

rust-heroku-slug

Source for WebAssembly Studio rustc service
JavaScript
8
star
12

vscode-ff-debug

Pilot for Firefox debugger
TypeScript
8
star
13

wasm-source-map-emscripten

Example with WebAssembly source maps
JavaScript
7
star
14

wasm-studio-utils

Set of utils (for gulp, node, etc) to support WebAssembly Studio
TypeScript
6
star
15

scratchplayer

The player for the Scratch project files written in JavaScript/HTML5.
JavaScript
5
star
16

OKCJS_B2G

Set of small demos for Firefox OS
3
star
17

wasmeval

Rust
2
star
18

system-wasm

System.js loader for WASM modules
JavaScript
2
star
19

wasmtextparser

wat parser
Rust
2
star
20

wasm-rust-api

Implementation of wasm-c-api in Rust
Rust
2
star
21

dwarf-to-json

WebAssembly DWARF information to JSON converter
Rust
2
star
22

zbar-wasm

building zbar for webassembly
C
1
star
23

wasmbase-example

Example of WASDK usage
HTML
1
star
24

txt2map4wasm

Translates wasm text source map to JSON map
JavaScript
1
star
25

easypromise

Lightweight implementation of Promises/A+
JavaScript
1
star
26

wasmparser-tanks

Test case for wasmparser (based on WebAssembly tanks demo)
Rust
1
star
27

wasmtime-embed

Rust
1
star