cosmopolitan/examples
Justine Tunney 957c61cbbf
Release Cosmopolitan v3.3
This change upgrades to GCC 12.3 and GNU 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. This 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.

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().

This release fixes __constructor__, .ctor, .init_array, and lastly the
.preinit_array so they behave the exact same way as glibc.

We no longer use hex constants to define math.h symbols like M_PI.
2024-02-20 13:27:59 -08:00
..
package more modeline errata (#1019) 2023-12-16 23:07:10 -05:00
pyapp more modeline errata (#1019) 2023-12-16 23:07:10 -05:00
pylife more modeline errata (#1019) 2023-12-16 23:07:10 -05:00
BUILD.mk Make improvements 2024-02-12 10:23:00 -08:00
clear.c Overhaul process spawning 2023-09-10 08:17:44 -07:00
crashreport.c Make improvements 2023-09-18 21:04:47 -07:00
crashreport2.cc Introduce FreeBSD ARM64 support 2023-12-29 20:14:02 -08:00
ctrlc.c Fix some additional Windows TTY issues 2023-10-04 02:17:25 -07:00
date.c Make improvements to cosmocc toolchain 2023-06-10 15:50:01 -07:00
dlopen.c Fix dlopen() for FreeBSD and NetBSD 2023-11-18 04:35:48 -08:00
env.c Loader path security (#1012) 2023-12-15 12:23:58 -05:00
greenbean.c Bring back gc() function 2024-01-08 10:26:28 -08:00
gui.c Make examples folder somewhat more focused 2021-03-05 06:09:12 -08:00
hangman.c Fix warnings 2023-09-01 20:50:18 -07:00
hello.c Remove printf() linking hack 2023-06-17 10:13:50 -07:00
hello2.c Introduce new linker for fat ape binaries 2023-08-11 04:39:19 -07:00
hellolua.c Fix warnings 2023-09-01 20:50:18 -07:00
hellolua.lua Add Hello World example for LUA C API (#97) 2021-03-08 14:15:59 -08:00
hiredis.c Clean up some code 2023-11-16 17:31:07 -08:00
kilo.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
life.c Always initialize thread local storage 2022-07-19 00:21:46 -07:00
linenoise.c Clean up some code 2023-10-11 11:45:31 -07:00
ls.c Bring back gc() function 2024-01-08 10:26:28 -08:00
nc.c Use DNS implementation from Musl Libc 2023-12-28 23:04:35 -08:00
nesemu1.cc Reduce header complexity 2023-11-28 14:39:42 -08:00
parsefloat.c Floating point parsing support for scanf family (#924) 2023-11-18 02:25:36 -08:00
pause.c Write more tests and improve kill() on Windows 2023-10-13 04:38:45 -07:00
picol.c Clean up some code 2023-11-16 17:31:07 -08:00
portscan.c Clean up some code 2023-11-16 17:31:07 -08:00
print-struct.c Cull the examples folder 2023-10-11 21:45:32 -07:00
printargs.c Make improvements 2022-04-24 10:06:05 -07:00
rusage.c Simplify the rusage.com command 2023-09-07 05:41:18 -07:00
script.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
script.txt Add script.com and whois.com courtesy of FreeBSD 2022-09-13 20:26:13 -07:00
seq.c Cull the examples folder 2023-10-11 21:45:32 -07:00
setcontext.c Implement swapcontext() and makecontext() 2023-07-02 09:01:44 -07:00
setitimer.c Cull the examples folder 2023-10-11 21:45:32 -07:00
spawn_bench.c Make improvements 2023-09-18 21:04:47 -07:00
stackexplorer.c Mint APE Loader v1.7 2023-08-17 09:04:50 -07:00
stat.c Bring back gc() function 2024-01-08 10:26:28 -08:00
statfs.c Mint APE Loader v1.7 2023-08-17 09:04:50 -07:00
stringbuffer.c Clean up some code 2023-11-16 17:31:07 -08:00
sysconf.c Clean up some code 2023-10-11 11:45:31 -07:00
sysinfo.c Clean up some code 2023-10-11 11:45:31 -07:00
system.c Make improvements 2024-02-12 10:23:00 -08:00
ttyinfo.c Clean up some code 2023-11-16 17:31:07 -08:00
ucontext-sigfpe-recovery.c Cull the examples folder 2023-10-11 21:45:32 -07:00
uname.c Improve quality of uname/gethostname/getdomainname 2022-09-03 20:20:40 -07:00
unbourne.c Make improvements 2024-02-12 10:23:00 -08:00
vga.c Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00
vga2.c [metal] Add a uprintf() routine, for non-emergency boot logging (#905) 2023-10-25 14:32:20 -07:00
walk.c Make fixes and improvements 2023-07-09 05:21:11 -07:00
wall.c Clean up some code 2023-11-16 17:31:07 -08:00
whois.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00