Cosmopolitan v3.4.0
Cosmopolitan Libc makes C a build-once run-anywhere language, like Java, except it doesn't need an interpreter or virtual machine. Instead, it reconfigures stock GCC and Clang to output a POSIX-approved polyglot format that runs natively on Linux + Mac + Windows + FreeBSD + OpenBSD + NetBSD + BIOS with the best possible performance and the tiniest footprint imaginable. For further details, read Cosmopolitan Third Edition, the Cosmo README, and the Cosmopolitan Toolchain README.
Improvements
This release makes dlmalloc scalable and zlib crc32 faster. Enterprise
server applications that employ many threads on many cores can now
look upon Cosmopolitan as a serious and viable option for their needs.
This release fixes some showstopper issues on Windows.
- e4d25d6 Drop support for Windows 8
- cd672e2 Improve crash signal reporting on Windows
- f31a98d Fix bug with realpath() on Windows
- 2816df5 Increase tinymalloc granularity
This release brings a more modern standard library for C++. It compiles
slower, but in certain cases that can be worked around since it defines
"breakout" headers for individual functions, e.g. std::move(). Since it
goes so slow, we're experimenting with creating our own STL replacement
- 8e68384 Upgrade to 2022-era LLVM libcxx
- 4937843 9906f29 Introduce Cosmopolitan Templates Library (CTL)
Our --ftrace
function call logger now demangles C++ symbols. This is
thanks to revisions we've made to our FreeBSD demangler that makes it
lockless and reentrant so it's safe to call from signal handlers. It's not as
good as the libcxxabi demangler, but that doesn't make it unimpressive.
For example, calling kprintf("%t", sym)
successfully demangles 90% of
the symbols in the llamafile codebase. Usually when it doesn't work, it's
because a symbol is very very long. Since it's run when nops are hooked
in function prologues, it has to be part of the privileged cosmo runtime,
which is highly constrained and can only use fixed size stack buffers.
Additional improvements:
- 7c8df05 Improve -march=native micro-architecture detection
- b74b974 Introduce #include <tinygetopt.h>
- 4c77acd Add LoadZipArgs() to <cosmo.h>
- fae1c32 Encode ±INFINITY as ±1e5000
Finally, this release sunsets the cosmopolitan amalgamation.