cosmopolitan/third_party/BUILD.mk
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

50 lines
1.7 KiB
Makefile

#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
#── vi: set noet ft=make ts=8 sw=8 fenc=utf-8 :vi ────────────────────┘
.PHONY: o/$(MODE)/third_party
o/$(MODE)/third_party: \
o/$(MODE)/third_party/argon2 \
o/$(MODE)/third_party/awk \
o/$(MODE)/third_party/bash \
o/$(MODE)/third_party/bzip2 \
o/$(MODE)/third_party/chibicc \
o/$(MODE)/third_party/compiler_rt \
o/$(MODE)/third_party/ctags \
o/$(MODE)/third_party/dlmalloc \
o/$(MODE)/third_party/finger \
o/$(MODE)/third_party/gdtoa \
o/$(MODE)/third_party/getopt \
o/$(MODE)/third_party/hiredis \
o/$(MODE)/third_party/less \
o/$(MODE)/third_party/libcxx \
o/$(MODE)/third_party/libcxxabi \
o/$(MODE)/third_party/libunwind \
o/$(MODE)/third_party/linenoise \
o/$(MODE)/third_party/lua \
o/$(MODE)/third_party/lz4cli \
o/$(MODE)/third_party/make \
o/$(MODE)/third_party/maxmind \
o/$(MODE)/third_party/mbedtls \
o/$(MODE)/third_party/musl \
o/$(MODE)/third_party/ncurses \
o/$(MODE)/third_party/nsync \
o/$(MODE)/third_party/pcre \
o/$(MODE)/third_party/puff \
o/$(MODE)/third_party/python \
o/$(MODE)/third_party/quickjs \
o/$(MODE)/third_party/readline \
o/$(MODE)/third_party/regex \
o/$(MODE)/third_party/sed \
o/$(MODE)/third_party/smallz4 \
o/$(MODE)/third_party/sqlite3 \
o/$(MODE)/third_party/stb \
o/$(MODE)/third_party/tidy \
o/$(MODE)/third_party/tr \
o/$(MODE)/third_party/tree \
o/$(MODE)/third_party/unzip \
o/$(MODE)/third_party/vqsort \
o/$(MODE)/third_party/xed \
o/$(MODE)/third_party/xxhash \
o/$(MODE)/third_party/zip \
o/$(MODE)/third_party/zlib \
o/$(MODE)/third_party/zstd