update libcxx and libcxxabi to llvm 18.1.6

Contains fixes for OpenBSD
This commit is contained in:
Andrew Kelley
2024-05-20 06:19:58 -07:00
parent 9f4f43cf7f
commit 50a1419457
3 changed files with 32 additions and 4 deletions

View File

@@ -47,6 +47,9 @@
#include "__cxxabi_config.h"
#include "include/atomic_support.h" // from libc++
#if defined(__has_include)
# if __has_include(<sys/futex.h>)
# include <sys/futex.h>
# endif
# if __has_include(<sys/syscall.h>)
# include <sys/syscall.h>
# endif
@@ -411,7 +414,18 @@ private:
// Futex Implementation
//===----------------------------------------------------------------------===//
#if defined(SYS_futex)
#if defined(__OpenBSD__)
void PlatformFutexWait(int* addr, int expect) {
constexpr int WAIT = 0;
futex(reinterpret_cast<volatile uint32_t*>(addr), WAIT, expect, NULL, NULL);
__tsan_acquire(addr);
}
void PlatformFutexWake(int* addr) {
constexpr int WAKE = 1;
__tsan_release(addr);
futex(reinterpret_cast<volatile uint32_t*>(addr), WAKE, INT_MAX, NULL, NULL);
}
#elif defined(SYS_futex)
void PlatformFutexWait(int* addr, int expect) {
constexpr int WAIT = 0;
syscall(SYS_futex, addr, WAIT, expect, 0);