Standalone C compiler/assembler/linker/libc for x86-64/aarch64/riscv64/wasm
See the codeC compiler running on Linux or MacOS.
$ make
Generated files:
xcc: Compiler entrycpp: Preprocessorcc1: C compileras: Assemblerld: Linker$ ./xcc -o hello examples/hello.c
$ ./hello
Hello, world!
-o <filename>: Set output filename (default: a.out)-I <path>: Add include path-D <label>(=value): Define macro-S: Output assembly code-E: Preprocess only-c: Output object file-nodefaultlibs: Ignore libc-nostdlib: Ignore libc and crt0Compile C to WebAssembly/WASI binary.
llvm-ar$ npm ci
$ make wcc
Generated files:
wcc: C compiler (including preprocessor, and output .wasm directly)Compile:
$ ./wcc -o hello.wasm examples/hello.c
Command line options:
-o <filename>: Set output filename (default: a.wasm)-I <path>: Add include path-D <label>(=value): Define macro-E: Preprocess only-c: Output object file--entry-point=func_name: Specify entry point (default: _start)-e func_name,...: Export function names (comma separated)--stack-size=<size>: Set stack size (default: 8192)-nodefaultlibs: Ignore libc-nostdlib: Ignore libc and crt0--verbose: Output debug information-Wl,...: Linker option
--allow-undefined: Handles unresolved function symbols as imported on runtime--export-all: Export all non-static functions$ ./tool/runwasi hello.wasm
Hello, world!
You can also use WASM/WASI runtime (Wasmtime, Wasmer, etc.), too.
goto: Can jump ancestor and latter line only.334 followers · starred Nov 2024
857 followers · starred Dec 2022
3,864 followers · starred Apr 2026
832 followers · starred Apr 2026
Standalone C compiler/assembler/linker/libc for x86-64/aarch64/riscv64/wasm
See the codeC compiler running on Linux or MacOS.
$ make
Generated files:
xcc: Compiler entrycpp: Preprocessorcc1: C compileras: Assemblerld: Linker$ ./xcc -o hello examples/hello.c
$ ./hello
Hello, world!
-o <filename>: Set output filename (default: a.out)-I <path>: Add include path-D <label>(=value): Define macro-S: Output assembly code-E: Preprocess only-c: Output object file-nodefaultlibs: Ignore libc-nostdlib: Ignore libc and crt0Compile C to WebAssembly/WASI binary.
llvm-ar$ npm ci
$ make wcc
Generated files:
wcc: C compiler (including preprocessor, and output .wasm directly)Compile:
$ ./wcc -o hello.wasm examples/hello.c
Command line options:
-o <filename>: Set output filename (default: a.wasm)-I <path>: Add include path-D <label>(=value): Define macro-E: Preprocess only-c: Output object file--entry-point=func_name: Specify entry point (default: _start)-e func_name,...: Export function names (comma separated)--stack-size=<size>: Set stack size (default: 8192)-nodefaultlibs: Ignore libc-nostdlib: Ignore libc and crt0--verbose: Output debug information-Wl,...: Linker option
--allow-undefined: Handles unresolved function symbols as imported on runtime--export-all: Export all non-static functions$ ./tool/runwasi hello.wasm
Hello, world!
You can also use WASM/WASI runtime (Wasmtime, Wasmer, etc.), too.
goto: Can jump ancestor and latter line only.334 followers · starred Nov 2024
857 followers · starred Dec 2022
3,864 followers · starred Apr 2026
832 followers · starred Apr 2026