]> git.proxmox.com Git - wasi-libc.git/blob - README.md
Explain why this doesn't have a full libc.
[wasi-libc.git] / README.md
1 # WebAssembly Reference Sysroot
2
3 Caution: This is currently quite experimental and not generally usable yet!
4
5 ## What is this?
6
7 This is a "reference sysroot", which is meant to be part of a common C ABI
8 that can be shared across C libraries and compilers. While it's intended to
9 (eventually) be usable in its own right, we fully expect other
10 implementations to be used in practice by many different systems, though
11 we do hope that in those cases, this library defines a useful ABI that can
12 be followed.
13
14 ## Usage
15
16 Obtain a WebAssembly-supporting C compiler, and then run:
17
18 ```
19 make WASM_CC=/path/to/wasm/supporting/c/compiler
20 ```
21
22 This makes a directory called "sysroot", by default. See the top of the Makefile
23 for customization options.
24
25 To use the sysroot, use the `--sysroot=` option:
26
27 ```
28 /path/to/wasm/supporting/c/compiler --sysroot=/path/to/the/newly/built/sysroot ...
29 ```
30
31 to run the compiler using the newly built sysroot.
32
33 ## Why doesn't this contain a full libc implementation?
34
35 In the short term, one of the main goals is just to provide a reference
36 point for people already maintaining their own libc codebases, to help
37 reduce interface incompatibilities between the several different
38 environments out there.
39
40 In the long term, there may some day be some form of standardized
41 syscall/import layer for wasm which would could support a full
42 "reference libc", at which point this repository might make sense as
43 a place to host such a thing.
44
45 In between, if there are specific pieces of libc functionality which
46 people would find useful to have here, and which don't depend on any
47 syscalls, we could add them, using code from existing third-party
48 codebases as appropriate.