cosmopolitan/third_party/libcxx
Justine Tunney ec480f5aa0
Make improvements
- Every unit test now passes on Apple Silicon. The final piece of this
  puzzle was porting our POSIX threads cancelation support, since that
  works differently on ARM64 XNU vs. AMD64. Our semaphore support on
  Apple Silicon is also superior now compared to AMD64, thanks to the
  grand central dispatch library which lets *NSYNC locks go faster.

- The Cosmopolitan runtime is now more stable, particularly on Windows.
  To do this, thread local storage is mandatory at all runtime levels,
  and the innermost packages of the C library is no longer being built
  using ASAN. TLS is being bootstrapped with a 128-byte TIB during the
  process startup phase, and then later on the runtime re-allocates it
  either statically or dynamically to support code using _Thread_local.
  fork() and execve() now do a better job cooperating with threads. We
  can now check how much stack memory is left in the process or thread
  when functions like kprintf() / execve() etc. call alloca(), so that
  ENOMEM can be raised, reduce a buffer size, or just print a warning.

- POSIX signal emulation is now implemented the same way kernels do it
  with pthread_kill() and raise(). Any thread can interrupt any other
  thread, regardless of what it's doing. If it's blocked on read/write
  then the killer thread will cancel its i/o operation so that EINTR can
  be returned in the mark thread immediately. If it's doing a tight CPU
  bound operation, then that's also interrupted by the signal delivery.
  Signal delivery works now by suspending a thread and pushing context
  data structures onto its stack, and redirecting its execution to a
  trampoline function, which calls SetThreadContext(GetCurrentThread())
  when it's done.

- We're now doing a better job managing locks and handles. On NetBSD we
  now close semaphore file descriptors in forked children. Semaphores on
  Windows can now be canceled immediately, which means mutexes/condition
  variables will now go faster. Apple Silicon semaphores can be canceled
  too. We're now using Apple's pthread_yield() funciton. Apple _nocancel
  syscalls are now used on XNU when appropriate to ensure pthread_cancel
  requests aren't lost. The MbedTLS library has been updated to support
  POSIX thread cancelations. See tool/build/runitd.c for an example of
  how it can be used for production multi-threaded tls servers. Handles
  on Windows now leak less often across processes. All i/o operations on
  Windows are now overlapped, which means file pointers can no longer be
  inherited across dup() and fork() for the time being.

- We now spawn a thread on Windows to deliver SIGCHLD and wakeup wait4()
  which means, for example, that posix_spawn() now goes 3x faster. POSIX
  spawn is also now more correct. Like Musl, it's now able to report the
  failure code of execve() via a pipe although our approach favors using
  shared memory to do that on systems that have a true vfork() function.

- We now spawn a thread to deliver SIGALRM to threads when setitimer()
  is used. This enables the most precise wakeups the OS makes possible.

- The Cosmopolitan runtime now uses less memory. On NetBSD for example,
  it turned out the kernel would actually commit the PT_GNU_STACK size
  which caused RSS to be 6mb for every process. Now it's down to ~4kb.
  On Apple Silicon, we reduce the mandatory upstream thread size to the
  smallest possible size to reduce the memory overhead of Cosmo threads.
  The examples directory has a program called greenbean which can spawn
  a web server on Linux with 10,000 worker threads and have the memory
  usage of the process be ~77mb. The 1024 byte overhead of POSIX-style
  thread-local storage is now optional; it won't be allocated until the
  pthread_setspecific/getspecific functions are called. On Windows, the
  threads that get spawned which are internal to the libc implementation
  use reserve rather than commit memory, which shaves a few hundred kb.

- sigaltstack() is now supported on Windows, however it's currently not
  able to be used to handle stack overflows, since crash signals are
  still generated by WIN32. However the crash handler will still switch
  to the alt stack, which is helpful in environments with tiny threads.

- Test binaries are now smaller. Many of the mandatory dependencies of
  the test runner have been removed. This ensures many programs can do a
  better job only linking the the thing they're testing. This caused the
  test binaries for LIBC_FMT for example, to decrease from 200kb to 50kb

- long double is no longer used in the implementation details of libc,
  except in the APIs that define it. The old code that used long double
  for time (instead of struct timespec) has now been thoroughly removed.

- ShowCrashReports() is now much tinier in MODE=tiny. Instead of doing
  backtraces itself, it'll just print a command you can run on the shell
  using our new `cosmoaddr2line` program to view the backtrace.

- Crash report signal handling now works in a much better way. Instead
  of terminating the process, it now relies on SA_RESETHAND so that the
  default SIG_IGN behavior can terminate the process if necessary.

- Our pledge() functionality has now been fully ported to AARCH64 Linux.
2023-09-18 21:04:47 -07:00
..
experimental Add more missing libc/libc++ functions 2022-07-22 07:20:21 -07:00
include Get us closer to building busybox 2023-06-18 04:13:45 -07:00
.clang-format Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
__bit_reference Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
__bsd_locale_fallbacks.h Clean up more code 2023-06-18 01:00:05 -07:00
__config Fix warnings 2023-09-01 20:50:18 -07:00
__debug Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
__errc Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
__functional_base Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
__functional_base_03 Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
__hash_table Import llama.cpp 2023-04-27 14:37:14 -07:00
__locale Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
__mutex_base Remove plenty of makefile misconfigurations 2022-07-21 09:20:59 -07:00
__node_handle Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
__nullptr Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
__split_buffer Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
__sso_allocator Add more missing libc/libc++ functions 2022-07-22 07:20:21 -07:00
__std_stream Add more missing libc/libc++ functions 2022-07-22 07:20:21 -07:00
__string Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
__threading_support Make improvements 2023-09-18 21:04:47 -07:00
__tree Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
__tuple Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
__undef_macros Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
algorithm Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
algorithm.cc Get repository to build with GCC 11 2022-09-13 04:14:55 -07:00
any Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
array Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
atomic Make some fixes for libcxx 2023-07-07 19:35:58 -07:00
atomic_support.hh Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
bit Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
bitset Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
cassert Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
ccomplex Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
cctype Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
cerrno Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
cfenv Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
cfloat Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
charconv Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
charconv.cc Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
chrono Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
chrono.cc Add more missing libc/libc++ functions 2022-07-22 07:20:21 -07:00
cinttypes Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
ciso646 Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
climits Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
clocale Restore strict header checking 2022-08-13 16:02:01 -07:00
cmath Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
codecvt Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
compare Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
complex Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
condition_variable Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
condition_variable.cc Add more missing libc/libc++ functions 2022-07-22 07:20:21 -07:00
condition_variable_destructor.cc Add more missing libc/libc++ functions 2022-07-22 07:20:21 -07:00
config_elast.h Get us closer to building busybox 2023-06-18 04:13:45 -07:00
countof.internal.hh Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
CREDITS.TXT Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
csetjmp Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
csignal Simplify cosmocc builds (#863) 2023-07-23 11:11:08 -07:00
cstdarg Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
cstdbool Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
cstddef Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
cstdint Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
cstdio Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
cstdlib Unbloat the build 2022-08-11 00:15:29 -07:00
cstring Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
ctgmath Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
ctime Make some fixes for libcxx 2023-07-07 19:35:58 -07:00
ctype.h Make some fixes for libcxx 2023-07-07 19:35:58 -07:00
cwchar Restore strict header checking 2022-08-13 16:02:01 -07:00
cwctype Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
deque Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
directory_iterator.cc Add libcxx filesystem modules 2023-07-08 02:40:17 -07:00
errno.h Make some fixes for libcxx 2023-07-07 19:35:58 -07:00
exception Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
exception.cc Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
exception_fallback.hh Get repository to build with GCC 11 2022-09-13 04:14:55 -07:00
exception_pointer_unimplemented.hh Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
execution Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
filesystem Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
filesystem_common.hh Add libcxx filesystem modules 2023-07-08 02:40:17 -07:00
forward_list Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
fstream Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
functional Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
functional.cc Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
future Implement POSIX threads API 2022-09-05 08:27:15 -07:00
future.cc Implement POSIX threads API 2022-09-05 08:27:15 -07:00
hash.cc Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
initializer_list Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
iomanip Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
ios Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
ios.cc Add more missing libc/libc++ functions 2022-07-22 07:20:21 -07:00
iosfwd Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
iostream Add more missing libc/libc++ functions 2022-07-22 07:20:21 -07:00
iostream.cc Add more missing libc/libc++ functions 2022-07-22 07:20:21 -07:00
istream Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
iterator Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
libcxx.mk Fix some aarch64 build issues 2023-07-08 10:47:45 -07:00
LICENSE.TXT Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
limits Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
limits.h Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
list Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
locale Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
locale.h Make some fixes for libcxx 2023-07-07 19:35:58 -07:00
locale1.cc Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
locale2.cc Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
locale3.cc Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
locale4.cc Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
map Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
math.h Make some fixes for libcxx 2023-07-07 19:35:58 -07:00
memory Implement POSIX threads API 2022-09-05 08:27:15 -07:00
memory.cc Add more missing libc/libc++ functions 2022-07-22 07:20:21 -07:00
mutex Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
mutex.cc Add more missing libc/libc++ functions 2022-07-22 07:20:21 -07:00
new Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
new.cc Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
new_handler_fallback.hh Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
numeric Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
operations.cc Add libcxx filesystem modules 2023-07-08 02:40:17 -07:00
optional Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
optional.cc Add more missing libc/libc++ functions 2022-07-22 07:20:21 -07:00
ostream Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
queue Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
random Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
random.cc Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
ratio Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
README.cosmo Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
refstring.hh Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
regex Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
regex.cc Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
scoped_allocator Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
set Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
span Make some fixes for libcxx 2023-07-07 19:35:58 -07:00
sstream Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
stack Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
stdexcept Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
stdexcept.cc Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
stdexcept_default.hh Support thread local storage 2022-05-16 13:20:08 -07:00
stdio.h Make improvements 2023-09-06 12:34:59 -07:00
stdlib.h Make some fixes for libcxx 2023-07-07 19:35:58 -07:00
streambuf Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
string Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
string.cc Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
string.h Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
string_view Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
strstream Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
strstream.cc Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
system_error Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
system_error.cc Support thread local storage 2022-05-16 13:20:08 -07:00
thread Restore strict header checking 2022-08-13 16:02:01 -07:00
thread.cc Switch public headers to getopt_long() entirely 2023-07-02 19:57:43 -07:00
tuple Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
type_traits Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
typeindex Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
typeinfo Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
unordered_map Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
unordered_set Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
utility Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
valarray Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
valarray.cc Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00
variant Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
vector Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
vector.cc Import C++ Standard Template Library 2022-03-22 06:41:54 -07:00
version Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
wchar.h Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
wctype.h Remove plenty of makefile misconfigurations 2022-07-21 09:20:59 -07:00

DESCRIPTION

  LLVM's C++ Standard Template Library

ORIGIN

  git@github.com:llvm-mirror/libcxx.git
  commit 78d6a7767ed57b50122a161b91f59f19c9bd0d19
  Author: Zoe Carver <z.zoelec2@gmail.com>
  Date:   Tue Oct 22 15:16:49 2019 +0000

LOCAL CHANGES

  - Break apart locale.cpp due to its outrageous build times