项目
关于
面向 x86-64/aarch64/riscv64/wasm 的独立 C 编译器、汇编器、链接器和 libc
编程语言与运行时实测星标增长
- 24小时
- +1
- 7天
- +2
- 15天
- +3
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文XCC
C compiler running on Linux or MacOS.
- Supporting architecture: x86-64, aarch64 (arm64), riscv64, wasm
- Binary format: ELF64
Requirements
- Linux (or MacOS)
- C compiler (gcc or clang)
- make
Build
$ make
Generated files:
xcc: Compiler entrycpp: Preprocessorcc1: C compileras: Assemblerld: Linker
Usage
$ ./xcc -o hello examples/hello.c
$ ./hello
Hello, world!
Command line options
-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 crt0
TODO
- Optimization
- Archiver
Reference
WebAssembly
Compile C to WebAssembly/WASI binary.
Requirements
- node.js, npm
llvm-ar
Set up
$ npm ci
Build
$ make wcc
Generated files:
wcc: C compiler (including preprocessor, and output .wasm directly)
Usage
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
Run
$ ./tool/runwasi hello.wasm
Hello, world!
You can also use WASM/WASI runtime (Wasmtime, Wasmer, etc.), too.
Limitation
goto: Can jump ancestor and latter line only.
探索相关项目
加载中…