Upgrade to 2022-era LLVM LIBCXX

This commit is contained in:
Justine Tunney 2024-05-27 02:12:27 -07:00
parent 2f4ca71f26
commit 8e68384e15
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2078 changed files with 165657 additions and 65010 deletions

View file

@ -362,7 +362,6 @@ include test/libc/fmt/BUILD.mk
include test/libc/time/BUILD.mk
include test/libc/proc/BUILD.mk
include test/libc/stdio/BUILD.mk
include test/libc/release/BUILD.mk
include test/libc/BUILD.mk
include test/net/http/BUILD.mk
include test/net/https/BUILD.mk
@ -542,15 +541,6 @@ COSMOPOLITAN_H_ROOT_HDRS = \
libc/integral/normalize.inc \
$(foreach x,$(COSMOPOLITAN_H_PKGS),$($(x)_HDRS))
o/cosmopolitan.h.txt: Makefile
$(file >$@, $(call uniq,$(COSMOPOLITAN_H_ROOT_HDRS)))
o/cosmopolitan.h: o/cosmopolitan.h.txt \
$(wildcard libc/integral/*) \
$(foreach x,$(COSMOPOLITAN_H_PKGS),$($(x)_HDRS)) \
$(foreach x,$(COSMOPOLITAN_H_PKGS),$($(x)_INCS))
@$(COMPILE) -AROLLUP -T$@ build/bootstrap/rollup @$< >>$@
o/cosmopolitan.html: private .UNSANDBOXED = 1
o/cosmopolitan.html: \
o/$(MODE)/third_party/chibicc/chibicc.dbg \
@ -572,7 +562,6 @@ $(SRCS): \
ifeq ($(ARCH), x86_64)
TOOLCHAIN_ARTIFACTS = \
o/cosmopolitan.h \
o/$(MODE)/ape/ape.lds \
o/$(MODE)/libc/crt/crt.o \
o/$(MODE)/ape/ape.elf \

View file

@ -144,12 +144,14 @@ DEFAULT_CFLAGS = \
-std=gnu2x
DEFAULT_CXXFLAGS = \
-std=gnu++20 \
-fno-rtti \
-fno-exceptions \
-fuse-cxa-atexit \
-Wno-int-in-bool-context \
-Wno-narrowing \
-Wno-literal-suffix
-Wno-literal-suffix \
-isystem third_party/libcxx
DEFAULT_ASFLAGS = \
-W \
@ -256,12 +258,12 @@ LD.libs = \
$(LIBS)
COMPILE.c.flags = $(cc.flags) $(copt.flags) $(cpp.flags) $(c.flags)
COMPILE.cxx.flags = $(cc.flags) $(copt.flags) $(cpp.flags) $(cxx.flags)
COMPILE.cxx.flags = $(cc.flags) $(copt.flags) $(cxx.flags) $(cpp.flags)
COMPILE.i.flags = $(cc.flags) $(copt.flags) $(c.flags)
COMPILE.ii.flags = $(cc.flags) $(copt.flags) $(cxx.flags)
LINK.flags = $(DEFAULT_LDFLAGS) $(CONFIG_LDFLAGS) $(LDFLAGS)
OBJECTIFY.c.flags = $(cc.flags) $(o.flags) $(S.flags) $(cpp.flags) $(copt.flags) $(c.flags)
OBJECTIFY.cxx.flags = $(cc.flags) $(o.flags) $(S.flags) $(cpp.flags) $(copt.flags) $(cxx.flags)
OBJECTIFY.cxx.flags = $(cc.flags) $(o.flags) $(S.flags) $(cxx.flags) $(cpp.flags) $(copt.flags)
OBJECTIFY.s.flags = $(ASONLYFLAGS) $(s.flags)
OBJECTIFY.S.flags = $(cc.flags) $(o.flags) $(S.flags) $(cpp.flags)
PREPROCESS.flags = -E $(copt.flags) $(cc.flags) $(cpp.flags)

View file

@ -4,10 +4,8 @@
PKGS += LIBC
LIBC_ISYSTEM = \
libc/isystem/algorithm \
libc/isystem/alloca.h \
libc/isystem/ammintrin.h \
libc/isystem/any \
libc/isystem/ar.h \
libc/isystem/arm_acle.h \
libc/isystem/arm_bf16.h \
@ -15,51 +13,16 @@ libc/isystem/arm_fp16.h \
libc/isystem/arm_neon.h \
libc/isystem/arpa/inet.h \
libc/isystem/arpa/nameser.h \
libc/isystem/array \
libc/isystem/assert.h \
libc/isystem/atomic \
libc/isystem/bit \
libc/isystem/bitset \
libc/isystem/byteswap.h \
libc/isystem/cassert \
libc/isystem/ccomplex \
libc/isystem/cctype \
libc/isystem/cerrno \
libc/isystem/cfenv \
libc/isystem/cfloat \
libc/isystem/charconv \
libc/isystem/chrono \
libc/isystem/cinttypes \
libc/isystem/ciso646 \
libc/isystem/climits \
libc/isystem/clocale \
libc/isystem/clzerointrin.h \
libc/isystem/cmath \
libc/isystem/codecvt \
libc/isystem/compare \
libc/isystem/complex \
libc/isystem/complex.h \
libc/isystem/condition_variable \
libc/isystem/cosmo.h \
libc/isystem/cpio.h \
libc/isystem/cpuid.h \
libc/isystem/crypt.h \
libc/isystem/csetjmp \
libc/isystem/csignal \
libc/isystem/cstdarg \
libc/isystem/cstdbool \
libc/isystem/cstddef \
libc/isystem/cstdint \
libc/isystem/cstdio \
libc/isystem/cstdlib \
libc/isystem/cstring \
libc/isystem/ctgmath \
libc/isystem/ctime \
libc/isystem/ctype.h \
libc/isystem/cwchar \
libc/isystem/cwctype \
libc/isystem/cxxabi.h \
libc/isystem/deque \
libc/isystem/dirent.h \
libc/isystem/dlfcn.h \
libc/isystem/elf.h \
@ -67,57 +30,37 @@ libc/isystem/emmintrin.h \
libc/isystem/endian.h \
libc/isystem/err.h \
libc/isystem/errno.h \
libc/isystem/exception \
libc/isystem/execution \
libc/isystem/fcntl.h \
libc/isystem/features.h \
libc/isystem/fenv.h \
libc/isystem/filesystem \
libc/isystem/float.h \
libc/isystem/fnmatch.h \
libc/isystem/forward_list \
libc/isystem/fstream \
libc/isystem/ftw.h \
libc/isystem/functional \
libc/isystem/future \
libc/isystem/getopt.h \
libc/isystem/glob.h \
libc/isystem/grp.h \
libc/isystem/iconv.h \
libc/isystem/ifaddrs.h \
libc/isystem/immintrin.h \
libc/isystem/initializer_list \
libc/isystem/inttypes.h \
libc/isystem/iomanip \
libc/isystem/ios \
libc/isystem/iosfwd \
libc/isystem/iostream \
libc/isystem/iso646.h \
libc/isystem/istream \
libc/isystem/iterator \
libc/isystem/langinfo.h \
libc/isystem/libgen.h \
libc/isystem/limits \
libc/isystem/limits.h \
libc/isystem/link.h \
libc/isystem/linux/futex.h \
libc/isystem/linux/limits.h \
libc/isystem/linux/param.h \
libc/isystem/linux/types.h \
libc/isystem/list \
libc/isystem/locale \
libc/isystem/locale.h \
libc/isystem/malloc.h \
libc/isystem/map \
libc/isystem/math.h \
libc/isystem/memory \
libc/isystem/memory.h \
libc/isystem/mm3dnow.h \
libc/isystem/mm_malloc.h \
libc/isystem/mmintrin.h \
libc/isystem/mntent.h \
libc/isystem/monetary.h \
libc/isystem/mutex \
libc/isystem/mwaitxintrin.h \
libc/isystem/net/ethernet.h \
libc/isystem/net/if.h \
@ -127,7 +70,6 @@ libc/isystem/netinet/in.h \
libc/isystem/netinet/ip.h \
libc/isystem/netinet/tcp.h \
libc/isystem/netinet/udp.h \
libc/isystem/new \
libc/isystem/nl_types.h \
libc/isystem/nmmintrin.h \
libc/isystem/nsync.h \
@ -141,12 +83,9 @@ libc/isystem/nsync_note.h \
libc/isystem/nsync_once.h \
libc/isystem/nsync_time.h \
libc/isystem/nsync_waiter.h \
libc/isystem/numeric \
libc/isystem/omp-tools.h \
libc/isystem/omp.h \
libc/isystem/ompx.h \
libc/isystem/optional \
libc/isystem/ostream \
libc/isystem/paths.h \
libc/isystem/pmmintrin.h \
libc/isystem/poll.h \
@ -154,27 +93,17 @@ libc/isystem/popcntintrin.h \
libc/isystem/pthread.h \
libc/isystem/pty.h \
libc/isystem/pwd.h \
libc/isystem/queue \
libc/isystem/random \
libc/isystem/ratio \
libc/isystem/regex \
libc/isystem/regex.h \
libc/isystem/resolv.h \
libc/isystem/sched.h \
libc/isystem/scoped_allocator \
libc/isystem/search.h \
libc/isystem/semaphore.h \
libc/isystem/set \
libc/isystem/setjmp.h \
libc/isystem/sgxintrin.h \
libc/isystem/shadow.h \
libc/isystem/shared_mutex \
libc/isystem/signal.h \
libc/isystem/smmintrin.h \
libc/isystem/span \
libc/isystem/spawn.h \
libc/isystem/sstream \
libc/isystem/stack \
libc/isystem/stdalign.h \
libc/isystem/stdarg.h \
libc/isystem/stdatomic.h \
@ -182,18 +111,13 @@ libc/isystem/stdbool.h \
libc/isystem/stdc-predef.h \
libc/isystem/stdckdint.h \
libc/isystem/stddef.h \
libc/isystem/stdexcept \
libc/isystem/stdint.h \
libc/isystem/stdio.h \
libc/isystem/stdio_ext.h \
libc/isystem/stdlib.h \
libc/isystem/stdnoreturn.h \
libc/isystem/streambuf \
libc/isystem/string \
libc/isystem/string.h \
libc/isystem/string_view \
libc/isystem/strings.h \
libc/isystem/strstream \
libc/isystem/sys/auxv.h \
libc/isystem/sys/cdefs.h \
libc/isystem/sys/dir.h \
@ -238,39 +162,26 @@ libc/isystem/sys/vfs.h \
libc/isystem/sys/wait.h \
libc/isystem/sysexits.h \
libc/isystem/syslog.h \
libc/isystem/system_error \
libc/isystem/termios.h \
libc/isystem/tgmath.h \
libc/isystem/thread \
libc/isystem/threads.h \
libc/isystem/time.h \
libc/isystem/tmmintrin.h \
libc/isystem/tuple \
libc/isystem/type_traits \
libc/isystem/typeindex \
libc/isystem/typeinfo \
libc/isystem/uchar.h \
libc/isystem/ucontext.h \
libc/isystem/uio.h \
libc/isystem/unistd.h \
libc/isystem/unordered_map \
libc/isystem/unordered_set \
libc/isystem/unwind.h \
libc/isystem/utility \
libc/isystem/utime.h \
libc/isystem/utmp.h \
libc/isystem/utmpx.h \
libc/isystem/valarray \
libc/isystem/variant \
libc/isystem/vector \
libc/isystem/version \
libc/isystem/wait.h \
libc/isystem/wchar.h \
libc/isystem/wctype.h \
libc/isystem/winternl.h \
libc/isystem/wmmintrin.h \
libc/isystem/x86intrin.h \
libc/isystem/xmmintrin.h
libc/isystem/xmmintrin.h \
LIBC_HDRS = $(filter %.h,$(LIBC_FILES)) $(LIBC_ISYSTEM)
LIBC_HDRS_H = $(filter %.h,$(LIBC_HDRS))

View file

@ -74,7 +74,7 @@
#endif
#if __STDC_VERSION__ + 0 < 201112
#define _Atomic(TYPE) TYPE volatile
#define _Atomic(t) volatile t *
#endif
#ifdef __llvm__
@ -107,8 +107,6 @@ typedef __CHAR32_TYPE__ char32_t;
#include "libc/stdbool.h"
#endif
#define _LIBCPP_STDINT_H
typedef int errno_t;
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ssize_t;

View file

@ -12,16 +12,14 @@
* @see libc/atomic.h
*/
typedef int memory_order;
enum {
typedef enum {
memory_order_relaxed,
memory_order_consume,
memory_order_acquire,
memory_order_release,
memory_order_acq_rel,
memory_order_seq_cst,
};
} memory_order;
#define ATOMIC_VAR_INIT(...) __VA_ARGS__
#define atomic_is_lock_free(obj) ((void)(obj), sizeof(obj) <= sizeof(void *))

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/adjacent_find.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/all_of.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/any_of.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/binary_search.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/clamp.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/comp.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/comp_ref_type.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/copy.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/copy_backward.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/copy_if.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/copy_move_common.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/copy_n.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/count.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/count_if.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/equal.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/equal_range.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/fill.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/fill_n.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/find.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/find_end.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/find_first_of.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/find_if.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/find_if_not.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/for_each.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/for_each_n.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/for_each_segment.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/generate.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/generate_n.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/half_positive.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/in_found_result.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/in_fun_result.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/in_in_out_result.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/in_in_result.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/in_out_out_result.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/in_out_result.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/includes.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/inplace_merge.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/is_heap.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/is_heap_until.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/is_partitioned.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/is_permutation.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/is_sorted.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/is_sorted_until.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/iter_swap.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/iterator_operations.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/lexicographical_compare.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/lexicographical_compare_three_way.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/lower_bound.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/make_heap.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/make_projected.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/max.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/max_element.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/merge.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/min.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/min_element.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/min_max_result.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/minmax.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/minmax_element.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/mismatch.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/move.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/move_backward.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/next_permutation.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/none_of.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/nth_element.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/partial_sort.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/partial_sort_copy.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/partition.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/partition_copy.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/partition_point.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pop_heap.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/prev_permutation.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_any_all_none_of.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_backend.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_backends/cpu_backend.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_backends/cpu_backends/any_of.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_backends/cpu_backends/backend.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_backends/cpu_backends/fill.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_backends/cpu_backends/find_if.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_backends/cpu_backends/for_each.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_backends/cpu_backends/merge.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_backends/cpu_backends/serial.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_backends/cpu_backends/thread.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_backends/cpu_backends/transform.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_copy.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_fill.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_find.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_for_each.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_frontend_dispatch.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_merge.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/pstl_transform.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/push_heap.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/ranges_adjacent_find.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/ranges_all_of.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/ranges_any_of.h"

View file

@ -0,0 +1 @@
#include "third_party/libcxx/__algorithm/ranges_binary_search.h"

Some files were not shown because too many files have changed in this diff Show more