Releases: jart/cosmopolitan
Cosmopolitan v3.3.8
- 1df4296 Fix stdio for character device regression
Cosmopolitan v3.3.7
- cf70a44 Support shebang on Windows
- ed93fc3 Fix fread() with 2gb+ sizes
- 5f61d27 Add hwap constants to sys/auxv.h
- 2f3c6e7 Revert "Remove zlib namespacing (#1142)"
- 65c9b28 Fix buffer overflow in Lua os.tmpname (#1180)
- bf3531d Make crash reports reliable in multithreaded case
- 13b9ecd Remove outdated restriction on -Werror on cosmocc
- 624119e Fix NT accept/connect not initializing with SO_UPDATE_*_CONTEXT (#1164)
- 0768807 Rename python -> python3 (closes #1144) (#1187)
- 4292348 Import libbsd readpassphrase (#1182)
- 42891e8 Fix #959 (typo in cosmocc --version)
- 0b59f01 Put confstr() in unistd.h
- f029375 Introduce MAP_HUGETLB
- 4718355 Fix sleb64 (#1179)
Cosmopolitan v3.3.6
Cosmopolitan v3.3.5
- b0df6c1 Implement proper time zone support
- 19c8186 Improve crash backtrace reliability
- 7d31fc3 Loaders rewrite argv[0] for old binaries (#1170)
- 57c0b06 Make old C++ demangler asynchronous signal safe
- a6ecbb7 Introduce libc/mem/tinymalloc.inc
- 3bf95ae Invent tool for renaming ELF object symbols
- 5fd7b07 Improve AVX512 feature detection
- 317c8bc Update MODE=tiny time zone list (#1167)
- d5ebb1f Add MapViewOfFile3 WIN32 API
- 06d916b Add VirtualAlloc2 WIN32 API
Cosmopolitan v3.3.4
- 5c6877b Introduce support for trapping math
- 403bc25 Make MXCSR editable by signal handlers on Windows
- 8f6bc9d Let signals interrupt fgets unless SA_RESTART set (#1152)
- deff138 recvfrom: don't convert address if addrsize is 0 (#1153)
- b6e40a3 Add /dev/(u)random on NT (#1163)
- 5488f0b Remove zlib namespacing (#1142)
- 181cd4c Add sysctlbyname() for MacOS
- 3bcd40b Fix regression in apeinstall.sh (#1161)
- fcfdd26 Fix wrong parameter type in redbean documentation (#1162)
- ff2b6fc Add munlock() and mlock2() to pledge
- 0eef971 Add much of C11 threads.h API
- 2bfd6b3 Various paginate improvements (#1148)
- 69db501 Fix fork locking on win32 (#1141)
- 6e6fc38 Apply clang-format update to repo (#1154)
- 342d0c8 vim spells the c++ filetype 'cpp'
- cec4c04 Remove .com logic from GetProgramExecutableName (#1134)
- f8c0186 Fix calling __dns_parse with potentially too large rlen
- 6992d8c Remove arbitrary limit from DNS result parsing
- 1a6b4ab Import mntent bug fixes from Musl Libc
- 223eb35 Import compiler warning fix from Musl
- ea3cc4e math: fix fma(x,y,0) when x*y rounds to -0
- 01267ea Update GetRemoteAddr documentation to clarify that it may return
nil
. (#1149) - bc6c183 Update .clang-format
- 06839ab Change loop bound on uuidv4 test (#1143)
- 39dde41 [Redbean] Add UuidV4 method (#1140)
- 3e16e59 Move store after __asan_unpoison in __zipos_alloc (#1135)
- b9d6e6e Standardize on -fsigned-char
- 49a3213 Upgrade the One True Awk
Cosmopolitan v3.3.3
- 9ff65cf Fix ZipOS extraction of ZIP64 assets
- bef2cb0 Fix AVX512_BF16
- 43885a7 Fix binary formatting for integers 2 and 3 (#1123)
- 74a8508 Support -S in cosmocross
- 045632a Make fixupobj work on Windows
- 9a10ada Remove .com from README
- 0c12c26 Update Emacs config
- 40b7da8 Speed up fmaf() on x86
- 6406689 Clarify MacOS supported versions
- 1c34088 Ignore -pie and -fpie in cosmocc
- bb92347 Add deprecated stubs for _bsf / _bsr
- 8bfd56b Rename _bsr/_bsf to bsr/bsf
- a6baba1 Stop using .com extension in monorepo
Cosmopolitan v3.3.2
This release fixes two issues with the recent 3.3.1 cosmocc release.
Please see the previous release for the latest cosmos and further details.
Cosmopolitan v3.3.1
This release fixes regressions introduced by v3.3, squashes additional bugs,
makes reliability and quality improvements, makes math better, and introduces
the getcpu()
system call.
- 77ddf4c Fix cosmocc on MacOS ARM64
- 29eac8e Fix regression in logger functions
- f7ff515
*scanf()
fixes to make TeX work (#1109) - 77a92f5 Introduce getcpu() system call from glibc
- a5a3e78 Make ftrace/strace C APIs work with cosmocc
- e9a756e Make --ftrace more crash proof with foreign code
- 7c7bf4b Upgrade to superconfigure z0.0.34
- fc3c536 Make --ftrace work better with cosmocc
- 38af54a Fix GCC version in cosmocc wrapper script
- 99f0491 Fix invalid XNU binaries generated by
apelink
in some edge cases (#1106) - 38bceae Give up on making clock_nanosleep() precise
- 592f6eb Address the Musl complex math FIXME comments
- 592f6eb Some libm funcs like pow() now support setting errno
- 592f6eb Use more accurate atan2f() and log1pf() implementations
- 592f6eb atoi() and atol() will no longer saturate or clobber errno
- 592f6eb Import the latest and greatest math functions from ARM Ltd.
- 9b4701b e72a88e Don't include <crypt.h> from <stdlib.h> (#1112)
- 3eb405e Resurrect <windows.h> as <windowsesque.h>
- 68b9479 Make cosmo.h work a little better
- 592f6eb memcpy() on ARM is now faster
- af8f2bd Shave 4kb off each binary
- ad3944a Support any HTTP method
Known Issues
- OpenMP is hairy on MacOS ARM for nontrivial applications.
- Compiling the mono repo on Windows is currently broken due to #1010. In the meantime, use cosmopolitan-3.2.tar.gz
Mirrors
Cosmopolitan v3.3
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.
Major Changes
This release upgrades us to GCC 12.3 and binutils 2.42. The GNU linker
appears to have changed things so that only a single de-duplicated str
table is present in the binary, and it gets placed wherever the linker
wants, regardless of what the linker script says. To cope with that we
need to stop using .ident to embed licenses. As such, this change does
significant work to revamp how third party licenses are defined in the
codebase, using .section .notice,"aR",@progbits
.
This new GCC 12.3 toolchain has support for GNU indirect functions. It
lets us support __target_clones__
for the first time. It is used for
optimizing the performance of libc string functions such as strlen and
friends so far on x86, by ensuring AVX systems favor a second codepath
that uses VEX encoding. It shaves some latency off certain operations.
It's a useful feature to have for scientific computing for the reasons
explained by the test/libcxx/openmp_test.cc example which compiles for
fifteen different microarchitectures. Thanks to the upgrades, it's now
also possible to use newer instruction sets, such as AVX512FP16, VNNI.
Experimental support has been added for OpenMP, which lets you whip up
multithreaded mathematical code very easily. It works on all supported
platforms for simple examples like openmp_test.cc but you may run into
issues on MacOS ARM64 with more complicated usage.
Cosmo now uses the %gs register on x86 by default for TLS. Doing it is
helpful for any program that links cosmo_dlopen()
. Such programs had
to recompile their binaries at startup to change the TLS instructions.
That's not great, since it means every page in the executable needs to
be faulted. The work of rewriting TLS-related x86 opcodes, is moved to
fixupobj.com instead. This is great news for MacOS x86 users, since we
previously needed to morph the binary every time for that platform but
now that's no longer necessary. The only platforms where we need fixup
of TLS x86 opcodes at runtime are now Windows, OpenBSD, and NetBSD. On
Windows we morph TLS to point deeper into the TIB, based on a TlsAlloc
assignment, and on OpenBSD/NetBSD we morph %gs back into %fs since the
kernels do not allow us to specify a value for the %gs register.
OpenBSD users are now required to use APE Loader to run Cosmo binaries
and assimilation is no longer possible. OpenBSD kernel needs to change
to allow programs to specify a value for the %gs register, or it needs
to stop marking executable pages loaded by the kernel as mimmutable().
Other Changes
- This release fixes
__constructor__
, .ctor, .init_array, and .preinit_array so they behave the exact same way as glibc. - The math.h constants no longer use hex notation.
- WinMain() will now ensure
$HOME
and$USER
are always defined. - Redbean Fetch redirect with relative URLs has been fixed (#1034)
- The
complex.h
header now works and support is added forstruct ipv6_mreq
(#1100) MODE=dbg
support is now restored, as of c1e18e7- The static yoinks for blink, i.e.
__static_yoink("blink_linux_aarch64")
, and__static_yoink("blink_xnu_aarch64")
, have been removed. Please build blink from source on your platform to use blink to run cosmo binaries. - There's a now Curve25519() API added to redbean in d50064a and #1096
- Calling
pthread_create()
will no longer raise an assertion error if it fails, as of 8ebe2e9 - cosmocc now properly handles dependency output in #1091
- The
__cxa_thread_atexit
prototype has been fixed in #1088 - The final remaining libcxx source files have been added in #1089
- cosmocc is now fixed so that it doesn't run fixupobj on text output in #1084
- The STL is now more conformant since std::pair can now be trivial fd75fd1
- Most libc functions are now annotated as
dontthrow
, to save on size.
Notes
Cosmopolitan no longer distributes cosmo binaries for QuickJS, because
Fabrice Bellard is now doing it himself on his website. You should use
his binaries instead: https://bellard.org/quickjs/
Errata
cosmocc --version
reports the incorrect gcc version.- cosmocc builds are broken on macos arm (fixed in 77ddf4c)
- Compiling the mono repo on Windows is currently broken due to #1010. In the meantime, use cosmopolitan-3.2.tar.gz
Cosmopolitan v3.2.4
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.
This v3.2.4 release of Cosmopolitan introduces C++ exceptions and RTTI,
which can be enabled by passing the -fexceptions
and/or -rtti
flags
to your cosmocc
compiler.
- b580080 tool/cosmocc: Allow exceptions and rtti (#1074)
- b056634 third_party/libcxxabi: Add test suite (#1076)
- b090966 third_party: Add libunwind (#1053)
- 81ce2e4 Call thread finalizers on exit()
- 94bab16 Add fixes to libunwind (#1069)
- 8b33204 Add LLVM libcxxabi (#1063)
- 6ab0171 Fix aarch64 setjmp abi
If C is your preferred language, then you can use Cosmopolitan garbage
collection via our new gc()
macro. To enable this feature, you need to
pass the -mcosmo
flag to cosmocc. For example, to say gc(malloc(32))
means that memory will be reclaimed when your function returns, and it
will be reclaimed by pthread_exit()
too. There's also defer() which is
generalized and allows any callback. Pointers exist on a shadow stack.
- a4b4551 Bring back
gc()
function
Here's some additional developments since the last release:
- df648fb Revert apeinstall.sh binfmt flags (#1072)
- cafea9a Flesh out tool/zsh/mkofs
- 6cb0354 mkofs improvements
- 1609980 zsh mkofs tool
Known Issues
- Compiling the mono repo on Windows is currently broken due to #1010. In the meantime, use cosmopolitan-3.2.tar.gz