Make improvements

- Introduce portable sched_getcpu() api
- Support GCC's __target_clones__ feature
- Make fma() go faster on x86 in default mode
- Remove some asan checks from core libraries
- WinMain() now ensures $HOME and $USER are defined
This commit is contained in:
Justine Tunney 2024-02-01 03:39:46 -08:00
parent d5225a693b
commit 2ab9e9f7fd
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
192 changed files with 2809 additions and 932 deletions

View file

@ -103,7 +103,8 @@ int adjbuf(char **pbuf, int *psiz, int minlen, int quantum, char **pbptr,
if (rminlen)
minlen += quantum - rminlen;
tbuf = (char *) realloc(*pbuf, minlen);
DPRINTF("adjbuf %s: %d %d (pbuf=%p, tbuf=%p)\n", whatrtn, *psiz, minlen, (void*)*pbuf, (void*)tbuf);
// [jart] use after free error
// DPRINTF("adjbuf %s: %d %d (pbuf=%p, tbuf=%p)\n", whatrtn, *psiz, minlen, (void*)*pbuf, (void*)tbuf);
if (tbuf == NULL) {
if (whatrtn)
FATAL("out of memory in %s", whatrtn);

View file

@ -83,6 +83,7 @@ $(THIRD_PARTY_BASH_OBJS): private \
-Wno-nonnull-compare \
-Wno-unused-variable \
-Wno-missing-braces \
-Wno-use-after-free \
-Wno-unused-label \
-Wno-unused-value \
-Wno-return-type \

View file

@ -789,11 +789,12 @@ static Token *preprocess2(Token *tok) {
char *path = xasprintf("%s/%s", dirname(tmp), filename);
free(tmp);
bool exists = fileexists(path);
free(path);
if (exists) {
tok = include_file(tok, path, start->next->next);
free(path);
continue;
}
free(path);
}
char *path = search_include_paths(filename);
tok = include_file(tok, path ? path : filename, start->next->next);

33
third_party/compiler_rt/cpu_model.h vendored Normal file
View file

@ -0,0 +1,33 @@
//===-- cpu_model_common.c - Utilities for cpu model detection ----*- C -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file implements common utilities for runtime cpu model detection.
//
//===----------------------------------------------------------------------===//
#ifndef COMPILER_RT_LIB_BUILTINS_CPU_MODEL_COMMON_H
#define COMPILER_RT_LIB_BUILTINS_CPU_MODEL_COMMON_H
#if __has_attribute(constructor)
#if __GNUC__ >= 9
// Ordinarily init priorities below 101 are disallowed as they are reserved for
// the implementation. However, we are the implementation, so silence the
// diagnostic, since it doesn't apply to us.
#pragma GCC diagnostic ignored "-Wprio-ctor-dtor"
#endif
// We're choosing init priority 90 to force our constructors to run before any
// constructors in the end user application (starting at priority 101). This
// value matches the libgcc choice for the same functions.
#define CONSTRUCTOR_ATTRIBUTE __attribute__((__constructor__(90)))
#else
// FIXME: For MSVC, we should make a function pointer global in .CRT$X?? so that
// this runs during initialization.
#define CONSTRUCTOR_ATTRIBUTE
#endif
#endif

View file

@ -64,6 +64,8 @@
#include "third_party/hiredis/sds.h"
#include "third_party/hiredis/sdsalloc.h"
#pragma GCC diagnostic ignored "-Wstringop-overflow"
static inline int sdsHdrSize(char type) {
switch(type&SDS_TYPE_MASK) {
case SDS_TYPE_5:

View file

@ -223,6 +223,7 @@ $(THIRD_PARTY_LIBCXX_A_OBJS): private \
-fdata-sections \
-fexceptions \
-frtti \
-Wno-alloc-size-larger-than \
-DLIBCXX_BUILDING_LIBCXXABI
THIRD_PARTY_LIBCXX_LIBS = $(foreach x,$(THIRD_PARTY_LIBCXX_ARTIFACTS),$($(x)))

View file

@ -78,7 +78,7 @@
#if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
// Change short string representation so that string data starts at offset 0,
// improving its alignment in some cases.
# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
// # define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
// Fix deque iterator type in order to support incomplete types.
# define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE
// Fix undefined behavior in how std::list stores its linked nodes.
@ -332,7 +332,7 @@
#if (defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \
(!defined(__arm__) || __ARM_ARCH_7K__ >= 2)) || \
defined(_LIBCPP_ALTERNATE_STRING_LAYOUT)
#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
// #define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
#endif
#if __has_feature(cxx_alignas)

View file

@ -17,7 +17,7 @@ Macros:
*/
#include "third_party/libcxx/__config"
#include "libc/assert.h"
#include "libc/isystem/assert.h"
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header

View file

@ -53,7 +53,7 @@ int feupdateenv(const fenv_t* envp);
*/
#include "third_party/libcxx/__config"
#include "libc/runtime/fenv.h"
#include "libc/isystem/fenv.h"
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header

View file

@ -70,8 +70,7 @@ Macros:
*/
#include "third_party/libcxx/__config"
#include "libc/math.h"
#include "libc/runtime/fenv.h"
#include "libc/isystem/float.h"
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header

View file

@ -236,8 +236,7 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
#include "third_party/libcxx/__config"
#include "third_party/libcxx/cstdint"
#include "libc/inttypes.h"
#include "libc/fmt/conv.h"
#include "libc/isystem/inttypes.h"
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header

View file

@ -21,4 +21,6 @@
#pragma GCC system_header
#endif
#include "libc/isystem/iso646.h"
#endif // _LIBCPP_CISO646

View file

@ -35,8 +35,7 @@ lconv* localeconv();
*/
#include "third_party/libcxx/__config"
#include "libc/str/unicode.h"
#include "libc/str/locale.h"
#include "libc/isystem/locale.h"
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header

View file

@ -31,7 +31,7 @@ void longjmp(jmp_buf env, int val);
*/
#include "third_party/libcxx/__config"
#include "libc/runtime/runtime.h"
#include "libc/isystem/setjmp.h"
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header

View file

@ -40,12 +40,7 @@ int raise(int sig);
*/
#include "third_party/libcxx/__config"
#include "libc/calls/calls.h"
#include "libc/calls/struct/sigaction.h"
#include "libc/calls/struct/siginfo.h"
#include "libc/sysv/consts/sa.h"
#include "libc/sysv/consts/sig.h"
#include "libc/sysv/consts/sicode.h"
#include "libc/isystem/signal.h"
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header

View file

@ -11,6 +11,7 @@
#define _LIBCPP_CSTDARG
#include "third_party/libcxx/__config"
#include "libc/isystem/stdarg.h"
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header

View file

@ -20,6 +20,7 @@ Macros:
*/
#include "third_party/libcxx/__config"
#include "libc/isystem/stdbool.h"
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header

View file

@ -35,6 +35,7 @@ Types:
#include "third_party/libcxx/__config"
#include "third_party/libcxx/version"
#include "libc/isystem/stddef.h"
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header

View file

@ -10,11 +10,7 @@
#ifndef _LIBCPP_CSTDINT
#define _LIBCPP_CSTDINT
#include "libc/inttypes.h"
#include "libc/fmt/conv.h"
#include "libc/limits.h"
#include "libc/literal.h"
#include "libc/calls/weirdtypes.h"
#include "libc/isystem/stdint.h"
#include "third_party/libcxx/__config"
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

View file

@ -13,6 +13,7 @@
#include "third_party/libcxx/__config"
#include "libc/str/str.h"
#include "third_party/libcxx/stdlib.h"
#include "libc/isystem/stdlib.h"
/*
cstdlib synopsis

View file

@ -11,15 +11,7 @@
#define _LIBCPP_CTIME
#include "third_party/libcxx/__config"
#include "libc/calls/struct/timespec.h"
#include "libc/calls/struct/timeval.h"
#include "libc/sysv/consts/clock.h"
#include "libc/sysv/consts/sched.h"
#include "libc/sysv/consts/timer.h"
#include "libc/calls/weirdtypes.h"
#include "libc/time/struct/tm.h"
#include "libc/calls/calls.h"
#include "libc/time/time.h"
#include "libc/isystem/time.h"
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header

View file

@ -35,7 +35,7 @@ int toupper(int c);
#pragma GCC system_header
#endif
#include "libc/str/str.h"
#include "libc/isystem/ctype.h"
#ifdef __cplusplus

View file

@ -28,7 +28,7 @@ Macros:
#pragma GCC system_header
#endif
#include "libc/errno.h"
#include "libc/isystem/errno.h"
#ifdef __cplusplus

View file

@ -43,22 +43,6 @@ Macros:
#pragma GCC system_header
#endif
#ifndef __GNUC__
#include "libc/limits.h"
#else
// GCC header limits.h recursively includes itself through another header called
// syslimits.h for some reason. This setup breaks down if we directly
// #include_next GCC's limits.h (reasons not entirely clear to me). Therefore,
// we manually re-create the necessary include sequence below:
// Get the system limits.h defines (force recurse into the next level)
#define _GCC_LIMITS_H_
#define _GCC_NEXT_LIMITS_H
#include "libc/limits.h"
// Get the ISO C defines
#undef _GCC_LIMITS_H_
#include "libc/limits.h"
#endif // __GNUC__
#include "libc/isystem/limits.h"
#endif // _LIBCPP_LIMITS_H

View file

@ -39,7 +39,6 @@ Functions:
#pragma GCC system_header
#endif
#include "libc/str/locale.h"
#include "libc/str/unicode.h"
#include "libc/isystem/locale.h"
#endif // _LIBCPP_LOCALE_H

View file

@ -19,7 +19,7 @@
#define _LIBCPP_STDLIB_INCLUDE_NEXT
#include "third_party/libcxx/stdlib.h"
#include "libc/math.h"
#include "libc/isystem/math.h"
#ifdef __cplusplus

View file

@ -102,9 +102,7 @@ void perror(const char* s);
#pragma GCC system_header
#endif
#include "libc/calls/calls.h"
#include "libc/temp.h"
#include "libc/stdio/stdio.h"
#include "libc/isystem/stdio.h"
#ifdef __cplusplus

View file

@ -9,13 +9,7 @@
#if defined(__need_malloc_and_calloc) || defined(_LIBCPP_STDLIB_INCLUDE_NEXT)
#include "libc/stdio/rand.h"
#include "libc/mem/mem.h"
#include "libc/runtime/runtime.h"
#include "libc/runtime/runtime.h"
#include "libc/mem/alg.h"
#include "libc/stdio/stdio.h"
#include "libc/fmt/conv.h"
#include "libc/isystem/stdlib.h"
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header

View file

@ -702,34 +702,41 @@ private:
#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
struct __long
{
pointer __data_;
struct __long {
pointer __data_;
size_type __size_;
size_type __cap_;
size_type __cap_ : sizeof(size_type) * CHAR_BIT - 1;
size_type __is_long_ : 1;
};
#ifdef _LIBCPP_BIG_ENDIAN
static const size_type __short_mask = 0x01;
static const size_type __long_mask = 0x1ul;
#else // _LIBCPP_BIG_ENDIAN
static const size_type __short_mask = 0x80;
static const size_type __long_mask = ~(size_type(~0) >> 1);
#endif // _LIBCPP_BIG_ENDIAN
enum { __min_cap = (sizeof(__long) - 1) / sizeof(value_type) > 2 ? (sizeof(__long) - 1) / sizeof(value_type) : 2 };
enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ?
(sizeof(__long) - 1)/sizeof(value_type) : 2};
struct __short
{
struct __short {
value_type __data_[__min_cap];
struct
: __padding<value_type>
{
unsigned char __size_;
};
unsigned char __padding_[sizeof(value_type) - 1];
unsigned char __size_ : 7;
unsigned char __is_long_ : 1;
};
// The __endian_factor is required because the field we use to store the size
// has one fewer bit than it would if it were not a bitfield.
//
// If the LSB is used to store the short-flag in the short string representation,
// we have to multiply the size by two when it is stored and divide it by two when
// it is loaded to make sure that we always store an even number. In the long string
// representation, we can ignore this because we can assume that we always allocate
// an even amount of value_types.
//
// If the MSB is used for the short-flag, the max_size() is numeric_limits<size_type>::max() / 2.
// This does not impact the short string representation, since we never need the MSB
// for representing the size of a short string anyway.
# ifdef _LIBCPP_BIG_ENDIAN
static const size_type __endian_factor = 2;
# else
static const size_type __endian_factor = 1;
# endif
#else
struct __long

View file

@ -16,7 +16,7 @@
#pragma GCC system_header
#endif
#include "libc/str/str.h"
#include "libc/isystem/string.h"
/*
string.h synopsis

View file

@ -9,8 +9,7 @@
#ifndef _LIBCPP_WCHAR_H
#define _LIBCPP_WCHAR_H
#include "libc/str/str.h"
#include "libc/time/time.h"
#include "libc/isystem/wchar.h"
#include "third_party/libcxx/__config"
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

View file

@ -50,8 +50,7 @@ wctrans_t wctrans(const char* property);
#pragma GCC system_header
#endif
#include "libc/str/str.h"
#include "libc/time/time.h"
#include "libc/isystem/wctype.h"
#ifdef __cplusplus

View file

@ -32,26 +32,27 @@ THIRD_PARTY_LIBCXXABI_TEST_SRCS = \
third_party/libcxxabi/test/cxa_thread_atexit_test.pass.cc \
third_party/libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cc \
third_party/libcxxabi/test/dynamic_cast.pass.cc \
third_party/libcxxabi/test/dynamic_cast14.pass.cc \
third_party/libcxxabi/test/dynamic_cast3.pass.cc \
third_party/libcxxabi/test/dynamic_cast5.pass.cc \
third_party/libcxxabi/test/dynamic_cast14.pass.cc \
third_party/libcxxabi/test/dynamic_cast_stress.pass.cc \
third_party/libcxxabi/test/exception_object_alignment.pass.cc \
third_party/libcxxabi/test/exception_object_alignment.2.pass.cc \
third_party/libcxxabi/test/exception_object_alignment.pass.cc \
third_party/libcxxabi/test/guard_test_basic.pass.cc \
third_party/libcxxabi/test/incomplete_type.sh.cc \
third_party/libcxxabi/test/incomplete_type_test.pass.cc \
third_party/libcxxabi/test/incomplete_type_test.lib.cc \
third_party/libcxxabi/test/inherited_exception.pass.cc \
third_party/libcxxabi/test/test_aux_runtime.pass.cc \
third_party/libcxxabi/test/test_aux_runtime_op_array_new.pass.cc\
third_party/libcxxabi/test/test_demangle.pass.cc \
third_party/libcxxabi/test/test_exception_address_alignment.pass.cc \
third_party/libcxxabi/test/test_exception_address_alignment.pass.cc \
third_party/libcxxabi/test/test_exception_storage.pass.cc \
third_party/libcxxabi/test/test_fallback_malloc.pass.cc \
third_party/libcxxabi/test/test_guard.pass.cc \
third_party/libcxxabi/test/test_vector1.pass.cc \
third_party/libcxxabi/test/test_vector2.pass.cc \
third_party/libcxxabi/test/thread_local_destruction_order.pass.cc \
third_party/libcxxabi/test/test_vector3.pass.cc \
third_party/libcxxabi/test/thread_local_destruction_order.pass.cc \
third_party/libcxxabi/test/uncaught_exception.pass.cc \
third_party/libcxxabi/test/uncaught_exceptions.pass.cc \
third_party/libcxxabi/test/unittest_demangle.pass.cc \
@ -69,33 +70,21 @@ THIRD_PARTY_LIBCXXABI_TEST_SRCS_TOOSLOW_COSMO = \
THIRD_PARTY_LIBCXXABI_TEST_SRCS_FAILING_GCC = \
third_party/libcxxabi/test/catch_array_01.pass.cc \
third_party/libcxxabi/test/catch_function_01.pass.cc \
third_party/libcxxabi/test/catch_member_function_pointer_01.pass.cc \
third_party/libcxxabi/test/catch_member_function_pointer_01.pass.cc \
third_party/libcxxabi/test/catch_member_function_pointer_02.pass.cc
THIRD_PARTY_LIBCXXABI_TEST_OBJS = \
$(THIRD_PARTY_LIBCXXABI_TEST_SRCS:%.cc=o/$(MODE)/%.o)
THIRD_PARTY_LIBCXXABI_TEST_COMS_SRCS = \
$(filter-out %.pass.cc,$(THIRD_PARTY_LIBCXXABI_TEST_SRCS))
THIRD_PARTY_LIBCXXABI_TEST_COMS = \
$(THIRD_PARTY_LIBCXXABI_TEST_SRCS:%.cc=o/$(MODE)/%.com)
$(THIRD_PARTY_LIBCXXABI_TEST_COMS_SRCS:%.cc=o/$(MODE)/%.com)
THIRD_PARTY_LIBCXXABI_TEST_TESTS = \
$(THIRD_PARTY_LIBCXXABI_TEST_COMS:%=%.ok)
THIRD_PARTY_LIBCXXABI_TEST_OBJS = \
$(THIRD_PARTY_LIBCXXABI_TEST_SRCS:%.cc=o/$(MODE)/%.o) \
o/$(MODE)/third_party/libcxxabi/test/incomplete_type.sh.one.o \
o/$(MODE)/third_party/libcxxabi/test/incomplete_type.sh.two.o
THIRD_PARTY_LIBCXXABI_TEST_OBJS_WNO_EXCEPTIONS = \
o/$(MODE)/third_party/libcxxabi/test/catch_class_03.pass.o \
o/$(MODE)/third_party/libcxxabi/test/catch_class_04.pass.o \
o/$(MODE)/third_party/libcxxabi/test/catch_ptr.pass.o \
o/$(MODE)/third_party/libcxxabi/test/catch_ptr_02.pass.o \
o/$(MODE)/third_party/libcxxabi/test/inherited_exception.pass.o
THIRD_PARTY_LIBCXXABI_TEST_OBJS_CPP14 = \
o/$(MODE)/third_party/libcxxabi/test/unwind_02.pass.o \
o/$(MODE)/third_party/libcxxabi/test/unwind_03.pass.o \
o/$(MODE)/third_party/libcxxabi/test/unwind_04.pass.o \
o/$(MODE)/third_party/libcxxabi/test/unwind_05.pass.o
THIRD_PARTY_LIBCXXABI_TEST_BINS = \
$(THIRD_PARTY_LIBCXXABI_TEST_COMS) \
$(THIRD_PARTY_LIBCXXABI_TEST_COMS:%=%.dbg)
@ -105,19 +94,29 @@ THIRD_PARTY_LIBCXXABI_TEST_CHECKS = \
$(THIRD_PARTY_LIBCXXABI_TEST_HDRS:%=o/$(MODE)/%.ok)
THIRD_PARTY_LIBCXXABI_TEST_DIRECTDEPS = \
LIBC_NEXGEN32E \
LIBC_CALLS \
LIBC_INTRIN \
LIBC_LOG \
LIBC_MEM \
LIBC_NEXGEN32E \
LIBC_PROC \
LIBC_RUNTIME \
LIBC_STDIO \
LIBC_THREAD \
THIRD_PARTY_LIBCXX \
THIRD_PARTY_LIBCXXABI
THIRD_PARTY_LIBCXXABI \
THIRD_PARTY_LIBUNWIND
THIRD_PARTY_LIBCXXABI_TEST_DEPS := \
$(call uniq,$(foreach x,$(THIRD_PARTY_LIBCXXABI_TEST_DIRECTDEPS),$($(x))))
$(THIRD_PARTY_LIBCXXABI_TEST_A): \
$(THIRD_PARTY_LIBCXXABI_TEST_A).pkg
$(THIRD_PARTY_LIBCXXABI_TEST_A).pkg \
$(THIRD_PARTY_LIBCXXABI_TEST_OBJS)
$(THIRD_PARTY_LIBCXXABI_TEST_A).pkg: \
$(foreach x,$(THIRD_PARTY_LIBCXXABI_TEST_DIRECTDEPS),$($(x)_A).pkg)
$(foreach x,$(THIRD_PARTY_LIBCXXABI_TEST_DIRECTDEPS),$($(x)_A).pkg) \
$(THIRD_PARTY_LIBCXXABI_TEST_OBJS)
o/$(MODE)/third_party/libcxxabi/test/%.com.dbg: \
$(THIRD_PARTY_LIBCXXABI_TEST_DEPS) \
@ -137,38 +136,27 @@ $(THIRD_PARTY_LIBCXXABI_TEST_OBJS): private \
-D_LIBCPP_BUILDING_LIBRARY \
-D_LIBCPP_CONSTINIT=__constinit
$(THIRD_PARTY_LIBCXXABI_TEST_OBJS_WNO_EXCEPTIONS): private \
CXXFLAGS += \
-Wno-exceptions
$(THIRD_PARTY_LIBCXXABI_TEST_OBJS_CPP14): private \
CXXFLAGS += \
-std=gnu++14
o/$(MODE)/third_party/libcxxabi/test/guard_test_basic.pass.o: private \
CXXFLAGS += \
-Wno-invalid-memory-model
o/$(MODE)/third_party/libcxxabi/test/incomplete_type.sh.one.o: private \
CXXFLAGS += \
-Wno-unreachable-code
o/$(MODE)/third_party/libcxxabi/test/incomplete_type.sh.two.o: private \
CXXFLAGS += \
-Wno-unreachable-code \
-DTU_ONE
o/$(MODE)/third_party/libcxxabi/test/incomplete_type.sh.com.dbg: \
$(THIRD_PARTY_LIBCXXABI_TEST_DEPS) \
$(THIRD_PARTY_LIBCXXABI_TEST_A) \
o/$(MODE)/third_party/libcxxabi/test/incomplete_type.sh.one.o \
o/$(MODE)/third_party/libcxxabi/test/incomplete_type.sh.two.o \
$(THIRD_PARTY_LIBCXXABI_TEST_A).pkg \
$(CRT) \
$(APE_NO_MODIFY_SELF)
@$(APELINK)
$(THIRD_PARTY_LIBCXXABI_TEST_OBJS): private CONFIG_CPPFLAGS += -UNDEBUG
o/$(MODE)/third_party/libcxxabi/test/catch_multi_level_pointer.pass.o: private COPTS += -O0
o/$(MODE)/third_party/libcxxabi/test/catch_multi_level_pointer.pass.o: private QUOTA += -C30 -M4000m
o/$(MODE)/third_party/libcxxabi/test/guard_test_basic.pass.o: private CXXFLAGS += -Wno-invalid-memory-model
o/$(MODE)/third_party/libcxxabi/test/incomplete_type_test.pass.o: private CXXFLAGS += -Wno-unreachable-code
o/$(MODE)/third_party/libcxxabi/test/incomplete_type_test.lib.o: private CXXFLAGS += -Wno-unreachable-code -DTU_ONE
o/$(MODE)/third_party/libcxxabi/test/catch_class_03.pass.o \
o/$(MODE)/third_party/libcxxabi/test/catch_class_04.pass.o \
o/$(MODE)/third_party/libcxxabi/test/catch_ptr.pass.o \
o/$(MODE)/third_party/libcxxabi/test/catch_ptr_02.pass.o \
o/$(MODE)/third_party/libcxxabi/test/inherited_exception.pass.o: private \
CXXFLAGS += \
-Wno-exceptions
o/$(MODE)/third_party/libcxxabi/test/unwind_02.pass.o \
o/$(MODE)/third_party/libcxxabi/test/unwind_03.pass.o \
o/$(MODE)/third_party/libcxxabi/test/unwind_04.pass.o \
o/$(MODE)/third_party/libcxxabi/test/unwind_05.pass.o: private \
CXXFLAGS += \
-std=gnu++14
.PHONY: o/$(MODE)/third_party/libcxxabi/test
o/$(MODE)/third_party/libcxxabi/test: \

View file

@ -1 +0,0 @@
incomplete_type.sh.cc

View file

@ -1 +0,0 @@
incomplete_type.sh.cc

View file

@ -0,0 +1 @@
incomplete_type_test.pass.cc

View file

@ -32,6 +32,8 @@
#include "third_party/musl/crypt.internal.h"
#include "third_party/musl/crypt_des.internal.h"
#pragma GCC diagnostic ignored "-Wstringop-overflow"
asm(".ident\t\"\\n\\n\
Musl libc (MIT License)\\n\
Copyright 2005-2014 Rich Felker, et. al.\"");

View file

@ -93,7 +93,7 @@ int dn_comp(const char *src,
unsigned char **dnptrs,
unsigned char **lastdnptr)
{
int i, j, n, m=0, offset, bestlen=0, bestoff;
int i, j, n, m=0, offset, bestlen=0, bestoff=0;
unsigned char lens[127];
unsigned char **p;
const char *end;

View file

@ -143,7 +143,7 @@ static int nsync_futex_polyfill_ (atomic_int *w, int expect, struct timespec *ab
if (abstime && timespec_cmp (timespec_real (), *abstime) >= 0) {
return -ETIMEDOUT;
}
pthread_yield ();
pthread_yield_np ();
}
}
@ -373,7 +373,7 @@ int nsync_futex_wake_ (atomic_int *w, int count, char pshare) {
}
} else {
Polyfill:
pthread_yield ();
pthread_yield_np ();
rc = 0;
}

View file

@ -22,6 +22,6 @@
#include "third_party/nsync/common.internal.h"
void nsync_yield_ (void) {
pthread_yield ();
pthread_yield_np ();
STRACE ("nsync_yield_()");
}

View file

@ -75,7 +75,7 @@
#error Unknown compiler
#endif
#if (KMP_OS_LINUX || KMP_OS_WINDOWS || KMP_OS_FREEBSD) && !KMP_OS_WASI
#if (KMP_OS_LINUX || KMP_OS_WINDOWS || KMP_OS_FREEBSD) && !KMP_OS_WASI && !defined(__COSMOPOLITAN__)
#define KMP_AFFINITY_SUPPORTED 1
#if KMP_OS_WINDOWS && KMP_ARCH_X86_64
#define KMP_GROUP_AFFINITY 1

View file

@ -147,6 +147,7 @@ $(THIRD_PARTY_ZSTD_A_CHECKS): private \
$(THIRD_PARTY_ZSTD_A_OBJS): private \
CFLAGS += \
-Wframe-larger-than=262144 \
-Wno-array-bounds \
-Wno-comment
$(THIRD_PARTY_ZSTD_A_OBJS): private \