diff options
author | Louis Dionne <ldionne.2@gmail.com> | 2024-01-31 12:53:32 -0500 |
---|---|---|
committer | Louis Dionne <ldionne.2@gmail.com> | 2024-01-31 12:53:33 -0500 |
commit | 372f7dd48f0165c6a7cdc819516132c617ef6f45 (patch) | |
tree | 6e7b9d47372fce7e0f0f9b134c3a515a1bdbe733 /libcxxabi | |
parent | 254287658f4b3e413d47870c1cca422071b398ff (diff) | |
download | llvm-372f7dd48f0165c6a7cdc819516132c617ef6f45.zip llvm-372f7dd48f0165c6a7cdc819516132c617ef6f45.tar.gz llvm-372f7dd48f0165c6a7cdc819516132c617ef6f45.tar.bz2 |
[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.
Diffstat (limited to 'libcxxabi')
-rw-r--r-- | libcxxabi/src/cxa_exception_storage.cpp | 7 | ||||
-rw-r--r-- | libcxxabi/src/cxa_guard_impl.h | 8 | ||||
-rw-r--r-- | libcxxabi/src/cxa_thread_atexit.cpp | 7 | ||||
-rw-r--r-- | libcxxabi/src/fallback_malloc.cpp | 7 | ||||
-rw-r--r-- | libcxxabi/test/test_fallback_malloc.pass.cpp | 7 |
5 files changed, 31 insertions, 5 deletions
diff --git a/libcxxabi/src/cxa_exception_storage.cpp b/libcxxabi/src/cxa_exception_storage.cpp index 2479f55..b2a31f8 100644 --- a/libcxxabi/src/cxa_exception_storage.cpp +++ b/libcxxabi/src/cxa_exception_storage.cpp @@ -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) diff --git a/libcxxabi/src/cxa_guard_impl.h b/libcxxabi/src/cxa_guard_impl.h index 7b140d3..197eb78 100644 --- a/libcxxabi/src/cxa_guard_impl.h +++ b/libcxxabi/src/cxa_guard_impl.h @@ -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> diff --git a/libcxxabi/src/cxa_thread_atexit.cpp b/libcxxabi/src/cxa_thread_atexit.cpp index c6bd0aa..5502513 100644 --- a/libcxxabi/src/cxa_thread_atexit.cpp +++ b/libcxxabi/src/cxa_thread_atexit.cpp @@ -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") diff --git a/libcxxabi/src/fallback_malloc.cpp b/libcxxabi/src/fallback_malloc.cpp index 76bd2e9..8ff40f6 100644 --- a/libcxxabi/src/fallback_malloc.cpp +++ b/libcxxabi/src/fallback_malloc.cpp @@ -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") diff --git a/libcxxabi/test/test_fallback_malloc.pass.cpp b/libcxxabi/test/test_fallback_malloc.pass.cpp index c8a6a07..885960d 100644 --- a/libcxxabi/test/test_fallback_malloc.pass.cpp +++ b/libcxxabi/test/test_fallback_malloc.pass.cpp @@ -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 |