tyfkda / xcc

Standalone C compiler/assembler/linker/libc for x86-64/aarch64/riscv64/wasm
https://tyfkda.github.io/xcc/
MIT License
197 stars 14 forks source link
aarch64 arm64 assembler c c-compiler compiler elf64 linker mach-o posix preprocessor riscv64 self-hosting wasi wasm x86-64

XCC

Action Status Open in Gitpod

C compiler running on Linux or MacOS.

Requirements

Build

$ make

Generated files:

Usage

$ ./xcc -o hello examples/hello.c
$ ./hello
Hello, world!

Command line options

TODO

Reference


WebAssembly

Compile C to WebAssembly/WASI binary.

Online demo

Requirements

Set up

$ npm ci

Build

$ make wcc

Generated files:

Usage

Compile:

$ ./wcc -o hello.wasm examples/hello.c

Command line options:

Run

$ ./tool/runwasi hello.wasm
Hello, world!

You can also use WASM/WASI runtime (Wasmtime, Wasmer, etc.), too.

Missing features