[libc++abi] Add temporary workaround to unblock Chrome

Chrome rolls libc++ and libc++abi as separate projects. As a result, they
may not always be updated in lockstep, and this can lead to build failures
when mixing libc++ that doesn't have <__thread/support.h> with libc++abi
that requires it.

This patch adds a workaround to make libc++abi work with both versions.
While Chrome's setup is not supported, this workaround will allow them
to go back to green and do the required work needed to roll libc++ and
libc++abi in lockstep. This workaround will be short-lived -- I have a
reminder to go back and remove it by EOW.
This commit is contained in:
Louis Dionne
2024-01-31 12:53:32 -05:00
parent 254287658f
commit 372f7dd48f
5 changed files with 31 additions and 5 deletions

View File

@@ -12,7 +12,12 @@
#include "cxa_exception.h"
#include <__thread/support.h>
// TODO: Temporary workaround, see https://github.com/llvm/llvm-project/pull/79654#issuecomment-1919397302
#if __has_include(<__thread/support.h>)
# include <__thread/support.h>
#else
# include <__threading_support>
#endif
#if defined(_LIBCXXABI_HAS_NO_THREADS)

View File

@@ -55,7 +55,13 @@
# endif
#endif
#include <__thread/support.h>
// TODO: Temporary workaround, see https://github.com/llvm/llvm-project/pull/79654#issuecomment-1919397302
#if __has_include(<__thread/support.h>)
# include <__thread/support.h>
#else
# include <__threading_support>
#endif
#include <cstdint>
#include <cstring>
#include <limits.h>

View File

@@ -8,7 +8,12 @@
#include "abort_message.h"
#include "cxxabi.h"
#include <__thread/support.h>
// TODO: Temporary workaround, see https://github.com/llvm/llvm-project/pull/79654#issuecomment-1919397302
#if __has_include(<__thread/support.h>)
# include <__thread/support.h>
#else
# include <__threading_support>
#endif
#ifndef _LIBCXXABI_HAS_NO_THREADS
#if defined(__ELF__) && defined(_LIBCXXABI_LINK_PTHREAD_LIB)
#pragma comment(lib, "pthread")

View File

@@ -9,7 +9,12 @@
#include "fallback_malloc.h"
#include "abort_message.h"
#include <__thread/support.h>
// TODO: Temporary workaround, see https://github.com/llvm/llvm-project/pull/79654#issuecomment-1919397302
#if __has_include(<__thread/support.h>)
# include <__thread/support.h>
#else
# include <__threading_support>
#endif
#ifndef _LIBCXXABI_HAS_NO_THREADS
#if defined(__ELF__) && defined(_LIBCXXABI_LINK_PTHREAD_LIB)
#pragma comment(lib, "pthread")

View File

@@ -11,7 +11,12 @@
#include <cassert>
#include <inttypes.h>
#include <__thread/support.h>
// TODO: Temporary workaround, see https://github.com/llvm/llvm-project/pull/79654#issuecomment-1919397302
#if __has_include(<__thread/support.h>)
# include <__thread/support.h>
#else
# include <__threading_support>
#endif
// UNSUPPORTED: c++03
// UNSUPPORTED: modules-build && no-threads