Skip to content

Commit 8e68384

Browse files
committed
Upgrade to 2022-era LLVM LIBCXX
1 parent 2f4ca71 commit 8e68384

File tree

2,106 files changed

+171188
-70541
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,106 files changed

+171188
-70541
lines changed

Makefile

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ include test/libc/fmt/BUILD.mk
362362
include test/libc/time/BUILD.mk
363363
include test/libc/proc/BUILD.mk
364364
include test/libc/stdio/BUILD.mk
365-
include test/libc/release/BUILD.mk
366365
include test/libc/BUILD.mk
367366
include test/net/http/BUILD.mk
368367
include test/net/https/BUILD.mk
@@ -542,15 +541,6 @@ COSMOPOLITAN_H_ROOT_HDRS = \
542541
libc/integral/normalize.inc \
543542
$(foreach x,$(COSMOPOLITAN_H_PKGS),$($(x)_HDRS))
544543

545-
o/cosmopolitan.h.txt: Makefile
546-
$(file >$@, $(call uniq,$(COSMOPOLITAN_H_ROOT_HDRS)))
547-
548-
o/cosmopolitan.h: o/cosmopolitan.h.txt \
549-
$(wildcard libc/integral/*) \
550-
$(foreach x,$(COSMOPOLITAN_H_PKGS),$($(x)_HDRS)) \
551-
$(foreach x,$(COSMOPOLITAN_H_PKGS),$($(x)_INCS))
552-
@$(COMPILE) -AROLLUP -T$@ build/bootstrap/rollup @$< >>$@
553-
554544
o/cosmopolitan.html: private .UNSANDBOXED = 1
555545
o/cosmopolitan.html: \
556546
o/$(MODE)/third_party/chibicc/chibicc.dbg \
@@ -572,7 +562,6 @@ $(SRCS): \
572562

573563
ifeq ($(ARCH), x86_64)
574564
TOOLCHAIN_ARTIFACTS = \
575-
o/cosmopolitan.h \
576565
o/$(MODE)/ape/ape.lds \
577566
o/$(MODE)/libc/crt/crt.o \
578567
o/$(MODE)/ape/ape.elf \

build/definitions.mk

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,14 @@ DEFAULT_CFLAGS = \
144144
-std=gnu2x
145145

146146
DEFAULT_CXXFLAGS = \
147+
-std=gnu++20 \
147148
-fno-rtti \
148149
-fno-exceptions \
149150
-fuse-cxa-atexit \
150151
-Wno-int-in-bool-context \
151152
-Wno-narrowing \
152-
-Wno-literal-suffix
153+
-Wno-literal-suffix \
154+
-isystem third_party/libcxx
153155

154156
DEFAULT_ASFLAGS = \
155157
-W \
@@ -256,12 +258,12 @@ LD.libs = \
256258
$(LIBS)
257259

258260
COMPILE.c.flags = $(cc.flags) $(copt.flags) $(cpp.flags) $(c.flags)
259-
COMPILE.cxx.flags = $(cc.flags) $(copt.flags) $(cpp.flags) $(cxx.flags)
261+
COMPILE.cxx.flags = $(cc.flags) $(copt.flags) $(cxx.flags) $(cpp.flags)
260262
COMPILE.i.flags = $(cc.flags) $(copt.flags) $(c.flags)
261263
COMPILE.ii.flags = $(cc.flags) $(copt.flags) $(cxx.flags)
262264
LINK.flags = $(DEFAULT_LDFLAGS) $(CONFIG_LDFLAGS) $(LDFLAGS)
263265
OBJECTIFY.c.flags = $(cc.flags) $(o.flags) $(S.flags) $(cpp.flags) $(copt.flags) $(c.flags)
264-
OBJECTIFY.cxx.flags = $(cc.flags) $(o.flags) $(S.flags) $(cpp.flags) $(copt.flags) $(cxx.flags)
266+
OBJECTIFY.cxx.flags = $(cc.flags) $(o.flags) $(S.flags) $(cxx.flags) $(cpp.flags) $(copt.flags)
265267
OBJECTIFY.s.flags = $(ASONLYFLAGS) $(s.flags)
266268
OBJECTIFY.S.flags = $(cc.flags) $(o.flags) $(S.flags) $(cpp.flags)
267269
PREPROCESS.flags = -E $(copt.flags) $(cc.flags) $(cpp.flags)

libc/BUILD.mk

Lines changed: 1 addition & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -4,120 +4,63 @@
44
PKGS += LIBC
55

66
LIBC_ISYSTEM = \
7-
libc/isystem/algorithm \
87
libc/isystem/alloca.h \
98
libc/isystem/ammintrin.h \
10-
libc/isystem/any \
119
libc/isystem/ar.h \
1210
libc/isystem/arm_acle.h \
1311
libc/isystem/arm_bf16.h \
1412
libc/isystem/arm_fp16.h \
1513
libc/isystem/arm_neon.h \
1614
libc/isystem/arpa/inet.h \
1715
libc/isystem/arpa/nameser.h \
18-
libc/isystem/array \
1916
libc/isystem/assert.h \
20-
libc/isystem/atomic \
21-
libc/isystem/bit \
22-
libc/isystem/bitset \
2317
libc/isystem/byteswap.h \
24-
libc/isystem/cassert \
25-
libc/isystem/ccomplex \
26-
libc/isystem/cctype \
27-
libc/isystem/cerrno \
28-
libc/isystem/cfenv \
29-
libc/isystem/cfloat \
30-
libc/isystem/charconv \
31-
libc/isystem/chrono \
32-
libc/isystem/cinttypes \
33-
libc/isystem/ciso646 \
34-
libc/isystem/climits \
35-
libc/isystem/clocale \
3618
libc/isystem/clzerointrin.h \
37-
libc/isystem/cmath \
38-
libc/isystem/codecvt \
39-
libc/isystem/compare \
40-
libc/isystem/complex \
4119
libc/isystem/complex.h \
42-
libc/isystem/condition_variable \
4320
libc/isystem/cosmo.h \
4421
libc/isystem/cpio.h \
4522
libc/isystem/cpuid.h \
4623
libc/isystem/crypt.h \
47-
libc/isystem/csetjmp \
48-
libc/isystem/csignal \
49-
libc/isystem/cstdarg \
50-
libc/isystem/cstdbool \
51-
libc/isystem/cstddef \
52-
libc/isystem/cstdint \
53-
libc/isystem/cstdio \
54-
libc/isystem/cstdlib \
55-
libc/isystem/cstring \
56-
libc/isystem/ctgmath \
57-
libc/isystem/ctime \
5824
libc/isystem/ctype.h \
59-
libc/isystem/cwchar \
60-
libc/isystem/cwctype \
6125
libc/isystem/cxxabi.h \
62-
libc/isystem/deque \
6326
libc/isystem/dirent.h \
6427
libc/isystem/dlfcn.h \
6528
libc/isystem/elf.h \
6629
libc/isystem/emmintrin.h \
6730
libc/isystem/endian.h \
6831
libc/isystem/err.h \
6932
libc/isystem/errno.h \
70-
libc/isystem/exception \
71-
libc/isystem/execution \
7233
libc/isystem/fcntl.h \
7334
libc/isystem/features.h \
7435
libc/isystem/fenv.h \
75-
libc/isystem/filesystem \
7636
libc/isystem/float.h \
7737
libc/isystem/fnmatch.h \
78-
libc/isystem/forward_list \
79-
libc/isystem/fstream \
8038
libc/isystem/ftw.h \
81-
libc/isystem/functional \
82-
libc/isystem/future \
8339
libc/isystem/getopt.h \
8440
libc/isystem/glob.h \
8541
libc/isystem/grp.h \
8642
libc/isystem/iconv.h \
8743
libc/isystem/ifaddrs.h \
8844
libc/isystem/immintrin.h \
89-
libc/isystem/initializer_list \
9045
libc/isystem/inttypes.h \
91-
libc/isystem/iomanip \
92-
libc/isystem/ios \
93-
libc/isystem/iosfwd \
94-
libc/isystem/iostream \
9546
libc/isystem/iso646.h \
96-
libc/isystem/istream \
97-
libc/isystem/iterator \
9847
libc/isystem/langinfo.h \
9948
libc/isystem/libgen.h \
100-
libc/isystem/limits \
10149
libc/isystem/limits.h \
10250
libc/isystem/link.h \
10351
libc/isystem/linux/futex.h \
10452
libc/isystem/linux/limits.h \
10553
libc/isystem/linux/param.h \
10654
libc/isystem/linux/types.h \
107-
libc/isystem/list \
108-
libc/isystem/locale \
10955
libc/isystem/locale.h \
11056
libc/isystem/malloc.h \
111-
libc/isystem/map \
11257
libc/isystem/math.h \
113-
libc/isystem/memory \
11458
libc/isystem/memory.h \
11559
libc/isystem/mm3dnow.h \
11660
libc/isystem/mm_malloc.h \
11761
libc/isystem/mmintrin.h \
11862
libc/isystem/mntent.h \
11963
libc/isystem/monetary.h \
120-
libc/isystem/mutex \
12164
libc/isystem/mwaitxintrin.h \
12265
libc/isystem/net/ethernet.h \
12366
libc/isystem/net/if.h \
@@ -127,7 +70,6 @@ libc/isystem/netinet/in.h \
12770
libc/isystem/netinet/ip.h \
12871
libc/isystem/netinet/tcp.h \
12972
libc/isystem/netinet/udp.h \
130-
libc/isystem/new \
13173
libc/isystem/nl_types.h \
13274
libc/isystem/nmmintrin.h \
13375
libc/isystem/nsync.h \
@@ -141,59 +83,41 @@ libc/isystem/nsync_note.h \
14183
libc/isystem/nsync_once.h \
14284
libc/isystem/nsync_time.h \
14385
libc/isystem/nsync_waiter.h \
144-
libc/isystem/numeric \
14586
libc/isystem/omp-tools.h \
14687
libc/isystem/omp.h \
14788
libc/isystem/ompx.h \
148-
libc/isystem/optional \
149-
libc/isystem/ostream \
15089
libc/isystem/paths.h \
15190
libc/isystem/pmmintrin.h \
15291
libc/isystem/poll.h \
15392
libc/isystem/popcntintrin.h \
15493
libc/isystem/pthread.h \
15594
libc/isystem/pty.h \
15695
libc/isystem/pwd.h \
157-
libc/isystem/queue \
158-
libc/isystem/random \
159-
libc/isystem/ratio \
160-
libc/isystem/regex \
16196
libc/isystem/regex.h \
16297
libc/isystem/resolv.h \
16398
libc/isystem/sched.h \
164-
libc/isystem/scoped_allocator \
16599
libc/isystem/search.h \
166100
libc/isystem/semaphore.h \
167-
libc/isystem/set \
168101
libc/isystem/setjmp.h \
169102
libc/isystem/sgxintrin.h \
170103
libc/isystem/shadow.h \
171-
libc/isystem/shared_mutex \
172104
libc/isystem/signal.h \
173105
libc/isystem/smmintrin.h \
174-
libc/isystem/span \
175106
libc/isystem/spawn.h \
176-
libc/isystem/sstream \
177-
libc/isystem/stack \
178107
libc/isystem/stdalign.h \
179108
libc/isystem/stdarg.h \
180109
libc/isystem/stdatomic.h \
181110
libc/isystem/stdbool.h \
182111
libc/isystem/stdc-predef.h \
183112
libc/isystem/stdckdint.h \
184113
libc/isystem/stddef.h \
185-
libc/isystem/stdexcept \
186114
libc/isystem/stdint.h \
187115
libc/isystem/stdio.h \
188116
libc/isystem/stdio_ext.h \
189117
libc/isystem/stdlib.h \
190118
libc/isystem/stdnoreturn.h \
191-
libc/isystem/streambuf \
192-
libc/isystem/string \
193119
libc/isystem/string.h \
194-
libc/isystem/string_view \
195120
libc/isystem/strings.h \
196-
libc/isystem/strstream \
197121
libc/isystem/sys/auxv.h \
198122
libc/isystem/sys/cdefs.h \
199123
libc/isystem/sys/dir.h \
@@ -238,39 +162,26 @@ libc/isystem/sys/vfs.h \
238162
libc/isystem/sys/wait.h \
239163
libc/isystem/sysexits.h \
240164
libc/isystem/syslog.h \
241-
libc/isystem/system_error \
242165
libc/isystem/termios.h \
243166
libc/isystem/tgmath.h \
244-
libc/isystem/thread \
245167
libc/isystem/threads.h \
246168
libc/isystem/time.h \
247169
libc/isystem/tmmintrin.h \
248-
libc/isystem/tuple \
249-
libc/isystem/type_traits \
250-
libc/isystem/typeindex \
251-
libc/isystem/typeinfo \
252170
libc/isystem/uchar.h \
253171
libc/isystem/ucontext.h \
254172
libc/isystem/uio.h \
255173
libc/isystem/unistd.h \
256-
libc/isystem/unordered_map \
257-
libc/isystem/unordered_set \
258174
libc/isystem/unwind.h \
259-
libc/isystem/utility \
260175
libc/isystem/utime.h \
261176
libc/isystem/utmp.h \
262177
libc/isystem/utmpx.h \
263-
libc/isystem/valarray \
264-
libc/isystem/variant \
265-
libc/isystem/vector \
266-
libc/isystem/version \
267178
libc/isystem/wait.h \
268179
libc/isystem/wchar.h \
269180
libc/isystem/wctype.h \
270181
libc/isystem/winternl.h \
271182
libc/isystem/wmmintrin.h \
272183
libc/isystem/x86intrin.h \
273-
libc/isystem/xmmintrin.h
184+
libc/isystem/xmmintrin.h \
274185

275186
LIBC_HDRS = $(filter %.h,$(LIBC_FILES)) $(LIBC_ISYSTEM)
276187
LIBC_HDRS_H = $(filter %.h,$(LIBC_HDRS))

libc/integral/c.inc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
#endif
7575

7676
#if __STDC_VERSION__ + 0 < 201112
77-
#define _Atomic(TYPE) TYPE volatile
77+
#define _Atomic(t) volatile t *
7878
#endif
7979

8080
#ifdef __llvm__
@@ -107,8 +107,6 @@ typedef __CHAR32_TYPE__ char32_t;
107107
#include "libc/stdbool.h"
108108
#endif
109109

110-
#define _LIBCPP_STDINT_H
111-
112110
typedef int errno_t;
113111
typedef __SIZE_TYPE__ size_t;
114112
typedef __PTRDIFF_TYPE__ ssize_t;

libc/intrin/atomic.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@
1212
* @see libc/atomic.h
1313
*/
1414

15-
typedef int memory_order;
16-
17-
enum {
15+
typedef enum {
1816
memory_order_relaxed,
1917
memory_order_consume,
2018
memory_order_acquire,
2119
memory_order_release,
2220
memory_order_acq_rel,
2321
memory_order_seq_cst,
24-
};
22+
} memory_order;
2523

2624
#define ATOMIC_VAR_INIT(...) __VA_ARGS__
2725
#define atomic_is_lock_free(obj) ((void)(obj), sizeof(obj) <= sizeof(void *))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "third_party/libcxx/__algorithm/adjacent_find.h"

libc/isystem/__algorithm/all_of.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "third_party/libcxx/__algorithm/all_of.h"

libc/isystem/__algorithm/any_of.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "third_party/libcxx/__algorithm/any_of.h"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "third_party/libcxx/__algorithm/binary_search.h"

libc/isystem/__algorithm/clamp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "third_party/libcxx/__algorithm/clamp.h"

0 commit comments

Comments
 (0)