cosmopolitan/third_party/libcxxabi
Trung Nguyen 8b33204f37
Add LLVM libcxxabi (#1063)
* third_party: Add libcxxabi

Added libcxxabi from LLVM 17.0.6
The library implements the Itanium C++ exception handling ABI.

* third_party/libcxxabi: Enable __cxa_thread_atexit

Enable `__cxa_thread_atexit` from libcxxabi.
`__cxa_thread_atexit_impl` is still implemented by the cosmo libc.
The original `__cxa_thread_atexit` has been removed.

* third_party/libcxx: Build with exceptions

Build libcxx with exceptions enabled.

- Removed `_LIBCPP_NO_EXCEPTIONS` from `__config`.
- Switched the exception implementation to `libcxxabi`. These two files
are taken from the same `libcxx` version as mentioned in `README.cosmo`.
- Removed `new_handler_fallback` in favor of `libcxxabi` implementation.
- Enable `-fexceptions` and `-frtti` for `libcxx`.
- Removed `THIRD_PARTY_LIBCXX` dependency from `libcxxabi` and
`libunwind`. These libraries do not use any runtime `libcxx` functions,
just headers.

* libc: Remove remaining redundant cxa functions

- `__cxa_pure_virtual` in `libcxxabi` is also a stub similar to the
existing one.
- `__cxa_guard_*` from `libcxxabi` is used instead of the ones from
Android.

Now there should be no more duplicate implementations.
`__cxa_thread_atexit_impl`, `__cxa_atexit`, and related supporting
functions, are still left to other libraries as in `libcxxabi`.

`libcxxabi` is also now added to `cosmopolitan.a` to make up for the
removed functions.

Affected in-tree libraries (`third_party/double-conversion`) have been
updated.
2024-01-08 08:45:10 -08:00
..
demangle Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
include Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
libcxx/include/__memory Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
abort_message.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
abort_message.h Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
aix_state_tab_eh.inc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
BUILD.mk Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
CREDITS.TXT Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
cxa_aux_runtime.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
cxa_default_handlers.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
cxa_demangle.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
cxa_exception.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
cxa_exception.h Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
cxa_exception_storage.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
cxa_guard.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
cxa_guard_impl.h Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
cxa_handlers.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
cxa_handlers.h Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
cxa_personality.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
cxa_thread_atexit.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
cxa_vector.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
cxa_virtual.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
fallback_malloc.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
fallback_malloc.h Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
LICENSE.TXT Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
private_typeinfo.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
private_typeinfo.h Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
README.cosmo Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
stdlib_exception.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
stdlib_new_delete.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
stdlib_stdexcept.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00
stdlib_typeinfo.cc Add LLVM libcxxabi (#1063) 2024-01-08 08:45:10 -08:00

DESCRIPTION

  libcxxabi - C++ Standard Library Support

ORIGIN

  Obtained from the LLVM monorepo, release 17.0.6.

  https://github.com/llvm/llvm-project/tree/llvmorg-17.0.6/libunwind
  commit 6009708b4367171ccdbf4b5905cb6a803753fe18
  Author: Tobias Hieta <tobias@hieta.se>
  Date:   Tue, 28 Nov 2023 09:52:28 +0100

LOCAL CHANGES

  - Add <__memory/aligned_alloc.h> (contains a few inline functions) from
  upstream libcxx.
  - Enable __cxa_thread_atexit for Cosmopolitan.