|
1 | 1 | # Cosmopolitan
|
2 | 2 |
|
3 |
| -Fast portable static native textmode executable containers. |
4 |
| - |
5 |
| -For an introduction to this project, please read the <a |
6 |
| -href="https://justine.lol/ape.html">αcτµαlly pδrταblε εxεcµταblε</a> |
7 |
| -blog post and <a |
8 |
| -href="https://justine.lol/cosmopolitan/index.html">cosmopolitan libc</a> |
9 |
| -website. API documentation is available <a |
10 |
| -href="https://justine.lol/cosmopolitan/documentation.html">here</a>. |
| 3 | +[Cosmopolitan Libc](https://justine.lol/cosmopolitan/index.html) makes C |
| 4 | +a build-once run-anywhere language, like Java, except it doesn't need an |
| 5 | +interpreter or virtual machine. Instead, it reconfigures stock GCC to |
| 6 | +output a POSIX-approved polyglot format that runs natively on Linux + |
| 7 | +Mac + Windows + FreeBSD + OpenBSD + BIOS with the best possible |
| 8 | +performance and the tiniest footprint imaginable. |
| 9 | + |
| 10 | +## Background |
| 11 | + |
| 12 | +For an introduction to this project, please read the [αcτµαlly pδrταblε |
| 13 | +εxεcµταblε](https://justine.lol/ape.html) blog post and [cosmopolitan |
| 14 | +libc](https://justine.lol/cosmopolitan/index.html) website. We also have |
| 15 | +[API documentation](https://justine.lol/cosmopolitan/documentation.html). |
| 16 | + |
| 17 | +## Getting Started |
| 18 | + |
| 19 | +Here's how to get started with the freestanding hermetically-sealed |
| 20 | +monolithic source repository: |
| 21 | + |
| 22 | +```sh |
| 23 | +tar xf cosmopolitan-0.1.tar.gz # see our releases page |
| 24 | +cd cosmo |
| 25 | +make -j12 |
| 26 | +o//examples/hello.com |
| 27 | +``` |
| 28 | + |
| 29 | +Here's how to get started with the amalgamated binaries, which let you |
| 30 | +bring your own build system: |
| 31 | + |
| 32 | +```sh |
| 33 | +unzip cosmopolitan-amalgamated-0.1.zip # see our releases page |
| 34 | +echo 'main() { printf("hello world\n"); }' >hello.c |
| 35 | +gcc -g -O -static -fno-pie -no-pie -mno-red-zone -nostdlib -nostdinc \ |
| 36 | + -o hello.com.dbg hello.c -Wl,--gc-sections -Wl,-z,max-page-size=0x1000 -fuse-ld=bfd \ |
| 37 | + -Wl,-T,ape.lds -include cosmopolitan.h crt.o ape.o cosmopolitan.a |
| 38 | +objcopy -SO binary hello.com.dbg hello.com |
| 39 | +./hello.com |
| 40 | +``` |
0 commit comments