Skip to content

Commit

Permalink
Use libcxx abi v1
Browse files Browse the repository at this point in the history
  • Loading branch information
jart committed Jul 24, 2024
1 parent fbc4b03 commit f25fbba
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions libc/intrin/pthread_mutex_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/calls/blockcancel.internal.h"
#include "libc/calls/calls.h"
#include "libc/calls/state.internal.h"
#include "libc/dce.h"
Expand Down Expand Up @@ -58,7 +59,9 @@ static void pthread_mutex_lock_drepper(atomic_int *futex, char pshare) {
if (word == 1)
word = atomic_exchange_explicit(futex, 2, memory_order_acquire);
while (word > 0) {
BLOCK_CANCELATION;
_weaken(nsync_futex_wait_)(futex, 2, pshare, 0);
ALLOW_CANCELATION;
word = atomic_exchange_explicit(futex, 2, memory_order_acquire);
}
}
Expand Down
11 changes: 7 additions & 4 deletions third_party/libcxx/__config_site
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ __static_yoink("__demangle");
#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS

#define _LIBCPP_NO_ABI_TAG
#define _LIBCPP_ABI_VERSION 2
#define _LIBCPP_ABI_NAMESPACE __2
#define _LIBCPP_ABI_VERSION 1
#define _LIBCPP_ABI_NAMESPACE __1
#define _LIBCPP_USING_GETENTROPY
#define _LIBCPP_DISABLE_AVAILABILITY
#define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
Expand All @@ -40,13 +40,16 @@ __static_yoink("__demangle");
#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
#define _LIBCPP_HAS_CLOCK_GETTIME

#define _LIBCPP_HARDENING_MODE_DEFAULT 2

#ifdef MODE_DBG
#define _LIBCPP_ENABLE_DEBUG_MODE
#define _LIBCPP_ENABLE_ASSERTIONS_DEFAULT 1
#define _LIBCPP_HARDENING_MODE_DEFAULT (1 << 3) // debug
#elif defined(TINY)
#define _LIBCPP_ENABLE_ASSERTIONS_DEFAULT 0
#define _LIBCPP_HARDENING_MODE_DEFAULT (1 << 1) // none
#else
#define _LIBCPP_ENABLE_ASSERTIONS_DEFAULT 0
#define _LIBCPP_HARDENING_MODE_DEFAULT (1 << 2) // fast
#endif

// PSTL backends
Expand Down
3 changes: 3 additions & 0 deletions third_party/libcxx/new
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#ifndef _LIBCPP_NEW
#define _LIBCPP_NEW

#pragma GCC diagnostic ignored "-Walloc-size-larger-than="

/*
new synopsis
Expand Down Expand Up @@ -264,6 +266,7 @@ _LIBCPP_HIDE_FROM_ABI void* __libcpp_operator_new(_Args... __args) {
#if __has_builtin(__builtin_operator_new) && __has_builtin(__builtin_operator_delete)
return __builtin_operator_new(__args...);
#else

return ::operator new(__args...);
#endif
}
Expand Down

0 comments on commit f25fbba

Please sign in to comment.