summaryrefslogtreecommitdiff
path: root/buildtools/third_party/libc++abi
diff options
context:
space:
mode:
authorCronet Mainline Eng <cronet-mainline-eng+copybara@google.com>2023-05-26 12:04:12 -0800
committerPatrick Rohr <prohr@google.com>2023-05-30 11:26:09 -0700
commit6e619ff2daf1f025aed9c3b67a7492b4b858f981 (patch)
tree155ec8924ad6503a06c8b09c0d1ec7c6a764278d /buildtools/third_party/libc++abi
parenteddec18c18cdbcbdbbe9bf3c0fa24cb7f8d768ae (diff)
downloadcronet-6e619ff2daf1f025aed9c3b67a7492b4b858f981.tar.gz
Import Cronet version 114.0.5735.53
Project import generated by Copybara. FolderOrigin-RevId: /tmp/copybara-origin/src Test: none Change-Id: Ia2e49afefcd2e9ee2014009a31ac2d6786f86fbd
Diffstat (limited to 'buildtools/third_party/libc++abi')
-rw-r--r--buildtools/third_party/libc++abi/trunk/CMakeLists.txt6
-rw-r--r--buildtools/third_party/libc++abi/trunk/include/__cxxabi_config.h2
-rw-r--r--buildtools/third_party/libc++abi/trunk/src/CMakeLists.txt10
-rw-r--r--buildtools/third_party/libc++abi/trunk/src/cxa_guard_impl.h6
-rw-r--r--buildtools/third_party/libc++abi/trunk/src/demangle/StringViewExtras.h34
-rwxr-xr-xbuildtools/third_party/libc++abi/trunk/src/demangle/cp-to-llvm.sh2
-rw-r--r--buildtools/third_party/libc++abi/trunk/test/configs/llvm-libc++abi-mingw.cfg.in2
-rw-r--r--buildtools/third_party/libc++abi/trunk/test/cxa_vec_new_overflow_PR41395.pass.cpp2
-rw-r--r--buildtools/third_party/libc++abi/trunk/test/test_fallback_malloc.pass.cpp5
9 files changed, 47 insertions, 22 deletions
diff --git a/buildtools/third_party/libc++abi/trunk/CMakeLists.txt b/buildtools/third_party/libc++abi/trunk/CMakeLists.txt
index 9239274d7..ae89796f6 100644
--- a/buildtools/third_party/libc++abi/trunk/CMakeLists.txt
+++ b/buildtools/third_party/libc++abi/trunk/CMakeLists.txt
@@ -459,10 +459,10 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND")
set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "")
endif()
+endif()
- if (NOT LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "")
- include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}")
- endif()
+if (NOT "${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}" STREQUAL "")
+ include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}")
endif()
# Add source code. This also contains all of the logic for deciding linker flags
diff --git a/buildtools/third_party/libc++abi/trunk/include/__cxxabi_config.h b/buildtools/third_party/libc++abi/trunk/include/__cxxabi_config.h
index c97dd656e..e8aa37e6d 100644
--- a/buildtools/third_party/libc++abi/trunk/include/__cxxabi_config.h
+++ b/buildtools/third_party/libc++abi/trunk/include/__cxxabi_config.h
@@ -32,7 +32,7 @@
#endif
#if defined(_WIN32)
- #if defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)
+ #if defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS) || (defined(__MINGW32__) && !defined(_LIBCXXABI_BUILDING_LIBRARY))
#define _LIBCXXABI_HIDDEN
#define _LIBCXXABI_DATA_VIS
#define _LIBCXXABI_FUNC_VIS
diff --git a/buildtools/third_party/libc++abi/trunk/src/CMakeLists.txt b/buildtools/third_party/libc++abi/trunk/src/CMakeLists.txt
index 4c27a25fc..54002bafa 100644
--- a/buildtools/third_party/libc++abi/trunk/src/CMakeLists.txt
+++ b/buildtools/third_party/libc++abi/trunk/src/CMakeLists.txt
@@ -154,10 +154,6 @@ if (LLVM_ENABLE_MODULES)
string(REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
endif()
-if (NOT TARGET pstl::ParallelSTL)
- message(STATUS "Could not find ParallelSTL, libc++abi will not attempt to use it but the build may fail if the libc++ in use needs it to be available.")
-endif()
-
include(WarningFlags)
# Build the shared library.
@@ -208,9 +204,6 @@ if (LIBCXXABI_ENABLE_SHARED)
target_link_libraries(cxxabi_shared
PUBLIC cxxabi_shared_objects
PRIVATE ${LIBCXXABI_SHARED_LIBRARIES} ${LIBCXXABI_LIBRARIES})
- if (TARGET pstl::ParallelSTL)
- target_link_libraries(cxxabi_shared PUBLIC pstl::ParallelSTL)
- endif()
list(APPEND LIBCXXABI_BUILD_TARGETS "cxxabi_shared")
if (LIBCXXABI_INSTALL_SHARED_LIBRARY)
@@ -294,9 +287,6 @@ if (LIBCXXABI_ENABLE_STATIC)
target_link_libraries(cxxabi_static
PUBLIC cxxabi_static_objects
PRIVATE ${LIBCXXABI_STATIC_LIBRARIES} ${LIBCXXABI_LIBRARIES})
- if (TARGET pstl::ParallelSTL)
- target_link_libraries(cxxabi_static PUBLIC pstl::ParallelSTL)
- endif()
list(APPEND LIBCXXABI_BUILD_TARGETS "cxxabi_static")
if (LIBCXXABI_INSTALL_STATIC_LIBRARY)
diff --git a/buildtools/third_party/libc++abi/trunk/src/cxa_guard_impl.h b/buildtools/third_party/libc++abi/trunk/src/cxa_guard_impl.h
index 47fe2b20b..e00d54b3a 100644
--- a/buildtools/third_party/libc++abi/trunk/src/cxa_guard_impl.h
+++ b/buildtools/third_party/libc++abi/trunk/src/cxa_guard_impl.h
@@ -255,7 +255,7 @@ struct InitByteNoThreads {
if (*init_byte_address == COMPLETE_BIT)
return true;
if (*init_byte_address & PENDING_BIT)
- ABORT_WITH_MESSAGE("__cxa_guard_acquire detected recursive initialization");
+ ABORT_WITH_MESSAGE("__cxa_guard_acquire detected recursive initialization: do you have a function-local static variable whose initialization depends on that function?");
*init_byte_address = PENDING_BIT;
return false;
}
@@ -325,7 +325,7 @@ public:
// Check for possible recursive initialization.
if (has_thread_id_support && (*init_byte_address & PENDING_BIT)) {
if (*thread_id_address == current_thread_id.get())
- ABORT_WITH_MESSAGE("__cxa_guard_acquire detected recursive initialization");
+ ABORT_WITH_MESSAGE("__cxa_guard_acquire detected recursive initialization: do you have a function-local static variable whose initialization depends on that function?");
}
// Wait until the pending bit is not set.
@@ -460,7 +460,7 @@ public:
// Check for recursive initialization
if (has_thread_id_support && thread_id.load(std::_AO_Relaxed) == current_thread_id.get()) {
- ABORT_WITH_MESSAGE("__cxa_guard_acquire detected recursive initialization");
+ ABORT_WITH_MESSAGE("__cxa_guard_acquire detected recursive initialization: do you have a function-local static variable whose initialization depends on that function?");
}
if ((last_val & WAITING_BIT) == 0) {
diff --git a/buildtools/third_party/libc++abi/trunk/src/demangle/StringViewExtras.h b/buildtools/third_party/libc++abi/trunk/src/demangle/StringViewExtras.h
new file mode 100644
index 000000000..d430e67ea
--- /dev/null
+++ b/buildtools/third_party/libc++abi/trunk/src/demangle/StringViewExtras.h
@@ -0,0 +1,34 @@
+//===--- StringViewExtras.h -------------------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+//
+// There are two copies of this file in the source tree. The one under
+// libcxxabi is the original and the one under llvm is the copy. Use
+// cp-to-llvm.sh to update the copy. See README.txt for more details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef DEMANGLE_STRINGVIEW_H
+#define DEMANGLE_STRINGVIEW_H
+
+#include "DemangleConfig.h"
+
+#include <string_view>
+
+DEMANGLE_NAMESPACE_BEGIN
+
+inline bool starts_with(std::string_view self, char C) {
+ return !self.empty() && self.front() == C;
+}
+
+inline bool starts_with(std::string_view haystack, std::string_view needle) {
+ return haystack.substr(0, needle.size()) == needle;
+}
+
+DEMANGLE_NAMESPACE_END
+
+#endif
diff --git a/buildtools/third_party/libc++abi/trunk/src/demangle/cp-to-llvm.sh b/buildtools/third_party/libc++abi/trunk/src/demangle/cp-to-llvm.sh
index d1474655b..870b6dad9 100755
--- a/buildtools/third_party/libc++abi/trunk/src/demangle/cp-to-llvm.sh
+++ b/buildtools/third_party/libc++abi/trunk/src/demangle/cp-to-llvm.sh
@@ -6,7 +6,7 @@
set -e
cd $(dirname $0)
-HDRS="ItaniumDemangle.h ItaniumNodes.def StringView.h Utility.h"
+HDRS="ItaniumDemangle.h ItaniumNodes.def StringView.h StringViewExtras.h Utility.h"
LLVM_DEMANGLE_DIR=$1
if [[ -z "$LLVM_DEMANGLE_DIR" ]]; then
diff --git a/buildtools/third_party/libc++abi/trunk/test/configs/llvm-libc++abi-mingw.cfg.in b/buildtools/third_party/libc++abi/trunk/test/configs/llvm-libc++abi-mingw.cfg.in
index 5e1a5dc70..6f88304fb 100644
--- a/buildtools/third_party/libc++abi/trunk/test/configs/llvm-libc++abi-mingw.cfg.in
+++ b/buildtools/third_party/libc++abi/trunk/test/configs/llvm-libc++abi-mingw.cfg.in
@@ -8,7 +8,7 @@ config.substitutions.append(('%{compile_flags}',
'-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} %{maybe-include-libunwind} -I %{libcxx}/test/support -I %{libcxx}/src -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS'
))
config.substitutions.append(('%{link_flags}',
- '-nostdlib++ -L %{lib} -lc++ -lc++abi'
+ '-nostdlib++ -L %{lib} -lc++'
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %T --env PATH=%{lib} -- '
diff --git a/buildtools/third_party/libc++abi/trunk/test/cxa_vec_new_overflow_PR41395.pass.cpp b/buildtools/third_party/libc++abi/trunk/test/cxa_vec_new_overflow_PR41395.pass.cpp
index 16239e75f..a4a2bbd99 100644
--- a/buildtools/third_party/libc++abi/trunk/test/cxa_vec_new_overflow_PR41395.pass.cpp
+++ b/buildtools/third_party/libc++abi/trunk/test/cxa_vec_new_overflow_PR41395.pass.cpp
@@ -18,7 +18,7 @@
void dummy_ctor(void*) { assert(false && "should not be called"); }
void dummy_dtor(void*) { assert(false && "should not be called"); }
-void *dummy_alloc(size_t) { assert(false && "should not be called"); }
+void *dummy_alloc(size_t) { assert(false && "should not be called"); return nullptr; }
void dummy_dealloc(void*) { assert(false && "should not be called"); }
void dummy_dealloc_sized(void*, size_t) { assert(false && "should not be called"); }
diff --git a/buildtools/third_party/libc++abi/trunk/test/test_fallback_malloc.pass.cpp b/buildtools/third_party/libc++abi/trunk/test/test_fallback_malloc.pass.cpp
index e7d22a57d..ff6ef6071 100644
--- a/buildtools/third_party/libc++abi/trunk/test/test_fallback_malloc.pass.cpp
+++ b/buildtools/third_party/libc++abi/trunk/test/test_fallback_malloc.pass.cpp
@@ -9,6 +9,7 @@
#include <cstdio>
#include <deque>
#include <cassert>
+#include <inttypes.h>
#include <__threading_support>
@@ -192,11 +193,11 @@ int main () {
print_free_list ();
char *p = (char *) fallback_malloc ( 1024 ); // too big!
- std::printf("fallback_malloc ( 1024 ) --> %lu\n", (unsigned long ) p);
+ std::printf("fallback_malloc ( 1024 ) --> %" PRIuPTR"\n", (uintptr_t) p);
print_free_list ();
p = (char *) fallback_malloc ( 32 );
- std::printf("fallback_malloc ( 32 ) --> %lu\n", (unsigned long) (p - heap));
+ std::printf("fallback_malloc ( 32 ) --> %" PRIuPTR"\n", (uintptr_t) (p - heap));
if ( !is_fallback_ptr ( p ))
std::printf("### p is not a fallback pointer!!\n");