2.2
版本发布时间: 2022-11-07 19:11:08
jart/cosmopolitan最新发布版本:3.8.0(2024-08-31 11:52:21)
Cosmopolitan Libc makes C/C++ a build-once run-anywhere language, like Java, except it doesn't need an interpreter or virtual machine. Instead, it reconfigures stock GCC to output a POSIX-approved polyglot format that runs natively on Linux + Mac + Windows + FreeBSD + OpenBSD + NetBSD + BIOS or UEFI with the best possible performance and the tiniest footprint imaginable.
Getting Started
If you use Linux, then you can build Cosmopolitan and its included software from source as follows:
wget https://justine.lol/cosmopolitan/cosmopolitan-2.2.tar.gz
tar xf cosmopolitan-2.2.tar.gz
cd cosmopolitan
build/bootstrap/make.com -j8
o//examples/hello.com
If you're doing your development work on Linux or BSD and you want to bring your own build system, then you need just five files to get started:
wget https://justine.lol/cosmopolitan/cosmopolitan-amalgamation-2.2.zip
unzip cosmopolitan-amalgamation-2.2.zip
printf 'main() { printf("hello world\\n"); }\n' >hello.c
gcc -g -Os -static -nostdlib -nostdinc -fno-pie -no-pie -mno-red-zone -gdwarf-4 \
-fno-omit-frame-pointer -pg -mnop-mcount -mno-tls-direct-seg-refs \
-o hello.com.dbg hello.c -fuse-ld=bfd -Wl,-T,ape.lds -Wl,--gc-sections \
-include cosmopolitan.h crt.o ape-no-modify-self.o cosmopolitan.a
objcopy -S -O binary hello.com.dbg hello.com
Features
- Implement POSIX semaphores 811146278
- Implement POSIX cancellations 2278327eb 022536cab 3f0bcdc3e 3f0bcdc3e 4a6fd3d91 e522aa3a0
- Implement atomic swar token bucket library for DDOS protection e7329b7cb
- Introduce sigtimedwait() and sigwaitinfo() 467a332e3
- Invent iso8601us() for faster timestamps f7ff77d86
- Work towards zipos / open(argv[0]) on metal cb9a0466f
- Introduce readdir_r, scandir, pthread_kill, sigsetjmp, etc.. e557058ac
- Allow more fine-grained control over bare metal page permissions d38700687
- Make cli commands yoinkable into cosmo shell 3d2d04b25
- Support Ctrl-Left / Ctrl-Right keystrokes in Bestline
- Introduce a ParseCidr() API c995838e5
Fixes and Improvements
- Make fcntl() locks on Windows work well enough to support SQLite 997ce29dd
- Make fork/system/popen thread safe 60cb435cb f52f65b2e
- Fix support for WSL1 platform fc96af058 f44d88707 d6ff4c754 fae0c0286 14d036b68
- Fix bug: do not initialize IDT & TSS if unneeded (#654)
- Integrate upstream dash changes into unbourne shell (#656)
- Import more of the remaining math library routines from Musl e557058ac
- Make the conformance of libc/isystem/ headers nearly perfect e557058ac
- Fixed bug where stdio eof wasn't being sticky d5910e267
- Fixed bug where fseeko() wasn't clearing eof state d5910e267
- Fix ParseHttpMessage failing to store >2 repeatable headers (#657)
- Fix a harmless integer overflow in ParseIp() c995838e5
- Improve cosmo's conformance to libc-test e557058ac
- Improve lock performance on NetBSD c995838e5
- Elevate the quality of getrandom() and getentropy() 3f0bcdc3e
- Make Windows fcntl() and lseek() fixes da8f5009f
- Windows fork() now restores TLS memory of calling thread e522aa3a0
- More cosmocc toolchain FOSS compatibility improvements 5af19b7ee
- Rewrite makedirs() so it doesn't need dynamic memory 0f8914088
- Rewrite putenv() and friends to conform to POSIX f7ff77d86
- Permit Linux OFD fcntl() locks under pledge(flock) f7ff77d86
- Support closefrom() on NetBSD
- Support tgkill() on FreeBSD
Breakages
- Remove underscore prefix from awesome timespec_*() APIs 3f0bcdc3e
- Rename LINUX to _HOSTLINUX etc. to reduce clashes (#655)
- Rename rand64() to _rand64() 7ae556463
1、 cosmopolitan-2.2.tar.gz 61.84MB
2、 cosmopolitan-amalgamation-2.2.zip 7.4MB
3、 cosmopolitan-amalgamation-dbg-2.2.zip 12.16MB
4、 cosmopolitan-amalgamation-rel-2.2.zip 7.39MB
5、 cosmopolitan-amalgamation-tiny-2.2.zip 2.66MB