• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1diff --git a/CMake/AbseilDll.cmake b/CMake/AbseilDll.cmake
2index f0d984a..875517b 100644
3--- a/CMake/AbseilDll.cmake
4+++ b/CMake/AbseilDll.cmake
5@@ -624,24 +624,7 @@ set(ABSL_INTERNAL_TEST_DLL_TARGETS
6
7 include(CheckCXXSourceCompiles)
8
9-check_cxx_source_compiles(
10-  [==[
11-#ifdef _MSC_VER
12-#  if _MSVC_LANG < 201700L
13-#    error "The compiler defaults or is configured for C++ < 17"
14-#  endif
15-#elif __cplusplus < 201700L
16-#  error "The compiler defaults or is configured for C++ < 17"
17-#endif
18-int main() { return 0; }
19-]==]
20-  ABSL_INTERNAL_AT_LEAST_CXX17)
21-
22-if(ABSL_INTERNAL_AT_LEAST_CXX17)
23-  set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_17)
24-else()
25-  set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_14)
26-endif()
27+set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_14)
28
29 function(absl_internal_dll_contains)
30   cmake_parse_arguments(ABSL_INTERNAL_DLL
31diff --git a/absl/base/internal/low_level_alloc.cc b/absl/base/internal/low_level_alloc.cc
32index 6d2cfea..9adbedb 100644
33--- a/absl/base/internal/low_level_alloc.cc
34+++ b/absl/base/internal/low_level_alloc.cc
35@@ -42,10 +42,6 @@
36 #include <windows.h>
37 #endif
38
39-#ifdef __linux__
40-#include <sys/prctl.h>
41-#endif
42-
43 #include <string.h>
44
45 #include <algorithm>
46@@ -569,18 +565,6 @@ static void *DoAllocWithArena(size_t request, LowLevelAlloc::Arena *arena) {
47         ABSL_RAW_LOG(FATAL, "mmap error: %d", errno);
48       }
49
50-#ifdef __linux__
51-#if defined(PR_SET_VMA) && defined(PR_SET_VMA_ANON_NAME)
52-      // Attempt to name the allocated address range in /proc/$PID/smaps on
53-      // Linux.
54-      //
55-      // This invocation of prctl() may fail if the Linux kernel was not
56-      // configured with the CONFIG_ANON_VMA_NAME option.  This is OK since
57-      // the naming of arenas is primarily a debugging aid.
58-      prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, new_pages, new_pages_size,
59-            "absl");
60-#endif
61-#endif  // __linux__
62 #endif  // _WIN32
63       arena->mu.Lock();
64       s = reinterpret_cast<AllocList *>(new_pages);
65diff --git a/absl/debugging/internal/elf_mem_image.h b/absl/debugging/internal/elf_mem_image.h
66index e7fe6ab..09ada21 100644
67--- a/absl/debugging/internal/elf_mem_image.h
68+++ b/absl/debugging/internal/elf_mem_image.h
69@@ -34,7 +34,7 @@
70 #if defined(__ELF__) && !defined(__OpenBSD__) && !defined(__QNX__) && \
71     !defined(__native_client__) && !defined(__asmjs__) &&             \
72     !defined(__wasm__) && !defined(__HAIKU__) && !defined(__sun) &&   \
73-    !defined(__VXWORKS__) && !defined(__hexagon__)
74+    !defined(__VXWORKS__) && !defined(__hexagon__) && !defined(__OHOS__)
75 #define ABSL_HAVE_ELF_MEM_IMAGE 1
76 #endif
77
78diff --git a/absl/debugging/internal/stacktrace_config.h b/absl/debugging/internal/stacktrace_config.h
79index 3929b1b..83bc8ee 100644
80--- a/absl/debugging/internal/stacktrace_config.h
81+++ b/absl/debugging/internal/stacktrace_config.h
82@@ -26,6 +26,10 @@
83 #if defined(ABSL_STACKTRACE_INL_HEADER)
84 #error ABSL_STACKTRACE_INL_HEADER cannot be directly set
85
86+#elif defined(__OHOS__)
87+#define ABSL_STACKTRACE_INL_HEADER \
88+    "absl/debugging/internal/stacktrace_unimplemented-inl.inc"
89+
90 #elif defined(_WIN32)
91 #define ABSL_STACKTRACE_INL_HEADER \
92     "absl/debugging/internal/stacktrace_win32-inl.inc"
93
94diff --git a/absl/debugging/failure_signal_handler.cc b/absl/debugging/failure_signal_handler.cc
95index 992c89c..dcfa752 100644
96--- a/absl/debugging/failure_signal_handler.cc
97+++ b/absl/debugging/failure_signal_handler.cc
98@@ -36,7 +36,7 @@
99 #endif
100 #endif
101
102-#ifdef __linux__
103+#if defined __linux__ && !defined(__OHOS__)
104 #include <sys/prctl.h>
105 #endif
106
107@@ -177,7 +177,7 @@ static bool SetupAlternateStackOnce() {
108     ABSL_RAW_LOG(FATAL, "sigaltstack() failed with errno=%d", errno);
109   }
110
111-#ifdef __linux__
112+#if defined __linux__ && !defined(__OHOS__)
113 #if defined(PR_SET_VMA) && defined(PR_SET_VMA_ANON_NAME)
114   // Make a best-effort attempt to name the allocated region in
115   // /proc/$PID/smaps.
116
117diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc
118index c2bab71..0fdd4b9 100644
119--- a/absl/debugging/internal/examine_stack.cc
120+++ b/absl/debugging/internal/examine_stack.cc
121@@ -33,7 +33,9 @@
122 #include <sys/ucontext.h>
123 #endif
124
125+#if !defined(__OHOS__)
126 #include <csignal>
127+#endif
128 #include <cstdio>
129
130 #include "absl/base/attributes.h"
131@@ -155,6 +157,7 @@ SymbolizeUrlEmitter GetDebugStackTraceHook() { return debug_stack_trace_hook; }
132 // unknown. vuc is a ucontext_t*. We use void* to avoid the use of
133 // ucontext_t on non-POSIX systems.
134 void* GetProgramCounter(void* const vuc) {
135+#if !defined(__OHOS__)
136 #ifdef __linux__
137   if (vuc != nullptr) {
138     ucontext_t* context = reinterpret_cast<ucontext_t*>(vuc);
139@@ -233,7 +236,8 @@ void* GetProgramCounter(void* const vuc) {
140   return reinterpret_cast<void*>(get_user_ctx_pc(ctx));
141 #endif
142   static_cast<void>(vuc);
143-  return nullptr;
144+#endif
145+return nullptr;
146 }
147
148 void DumpPCAndFrameSizesAndStackTrace(void* const pc, void* const stack[],
149
150diff --git a/absl/crc/internal/cpu_detect.cc b/absl/crc/internal/cpu_detect.cc
151index 8383808..0f0fd22 100644
152--- a/absl/crc/internal/cpu_detect.cc
153+++ b/absl/crc/internal/cpu_detect.cc
154@@ -19,7 +19,7 @@
155
156 #include "absl/base/config.h"
157
158-#if defined(__aarch64__) && defined(__linux__)
159+#if defined(__aarch64__) && defined(__linux__) && !defined(__OHOS__)
160 #include <asm/hwcap.h>
161 #include <sys/auxv.h>
162 #endif
163@@ -215,7 +215,7 @@ CpuType GetCpuType() {
164
165 bool SupportsArmCRC32PMULL() { return false; }
166
167-#elif defined(__aarch64__) && defined(__linux__)
168+#elif defined(__aarch64__) && defined(__linux__) && !defined(__OHOS__)
169
170 #ifndef HWCAP_CPUID
171 #define HWCAP_CPUID (1 << 11)
172
173diff --git a/CMake/AbseilDll.cmake b/CMake/AbseilDll.cmake
174index 875517b..9e39aea 100644
175--- a/CMake/AbseilDll.cmake
176+++ b/CMake/AbseilDll.cmake
177@@ -788,12 +788,12 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
178       ${_dll_consume}
179   )
180
181-  if(ABSL_PROPAGATE_CXX_STD)
182+  # if(ABSL_PROPAGATE_CXX_STD)
183     # Abseil libraries require C++14 as the current minimum standard. When
184     # compiled with C++17 (either because it is the compiler's default or
185     # explicitly requested), then Abseil requires C++17.
186     target_compile_features(${_dll} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})
187-  endif()
188+  # endif()
189
190   install(TARGETS ${_dll} EXPORT ${PROJECT_NAME}Targets
191         RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
192diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
193index 3bd33ce..1deea98 100644
194--- a/CMake/AbseilHelpers.cmake
195+++ b/CMake/AbseilHelpers.cmake
196@@ -285,12 +285,12 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
197       set_property(TARGET ${_NAME} PROPERTY FOLDER ${ABSL_IDE_FOLDER}/internal)
198     endif()
199
200-    if(ABSL_PROPAGATE_CXX_STD)
201+    # if(ABSL_PROPAGATE_CXX_STD)
202       # Abseil libraries require C++14 as the current minimum standard. When
203       # compiled with C++17 (either because it is the compiler's default or
204       # explicitly requested), then Abseil requires C++17.
205       target_compile_features(${_NAME} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})
206-    endif()
207+    # endif()
208
209     # When being installed, we lose the absl_ prefix.  We want to put it back
210     # to have properly named lib files.  This is a no-op when we are not being
211@@ -322,12 +322,12 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
212     )
213     target_compile_definitions(${_NAME} INTERFACE ${ABSL_CC_LIB_DEFINES})
214
215-    if(ABSL_PROPAGATE_CXX_STD)
216+    # if(ABSL_PROPAGATE_CXX_STD)
217       # Abseil libraries require C++14 as the current minimum standard.
218       # Top-level application CMake projects should ensure a consistent C++
219       # standard for all compiled sources by setting CMAKE_CXX_STANDARD.
220       target_compile_features(${_NAME} INTERFACE ${ABSL_INTERNAL_CXX_STD_FEATURE})
221-    endif()
222+    # endif()
223   endif()
224
225   if(ABSL_ENABLE_INSTALL)
226@@ -434,12 +434,12 @@ function(absl_cc_test)
227   # Add all Abseil targets to a folder in the IDE for organization.
228   set_property(TARGET ${_NAME} PROPERTY FOLDER ${ABSL_IDE_FOLDER}/test)
229
230-  if(ABSL_PROPAGATE_CXX_STD)
231+  # if(ABSL_PROPAGATE_CXX_STD)
232     # Abseil libraries require C++14 as the current minimum standard.
233     # Top-level application CMake projects should ensure a consistent C++
234     # standard for all compiled sources by setting CMAKE_CXX_STANDARD.
235     target_compile_features(${_NAME} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})
236-  endif()
237+  # endif()
238
239   add_test(NAME ${_NAME} COMMAND ${_NAME})
240 endfunction()
241
242diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc
243index 68c33d4..24d9727 100644
244--- a/absl/debugging/internal/examine_stack.cc
245+++ b/absl/debugging/internal/examine_stack.cc
246@@ -29,9 +29,11 @@
247 #endif
248 #endif
249
250-#if defined(__linux__) || defined(__APPLE__)
251+#if !defined(__OHOS__)
252+#if defined(__linux__) || defined(__APPLE__)
253 #include <sys/ucontext.h>
254 #endif
255+#endif
256
257 #if !defined(__OHOS__)
258 #include <csignal>
259
260diff --git a/absl/log/internal/log_message.cc b/absl/log/internal/log_message.cc
261index 10ac245..bddc95d 100644
262--- a/absl/log/internal/log_message.cc
263+++ b/absl/log/internal/log_message.cc
264@@ -315,11 +315,6 @@ LogMessage& LogMessage::ToSinkOnly(absl::LogSink* sink) {
265   return *this;
266 }
267
268-#ifdef __ELF__
269-extern "C" void __gcov_dump() ABSL_ATTRIBUTE_WEAK;
270-extern "C" void __gcov_flush() ABSL_ATTRIBUTE_WEAK;
271-#endif
272-
273 void LogMessage::FailWithoutStackTrace() {
274   // Now suppress repeated trace logging:
275   log_internal::SetSuppressSigabortTrace(true);
276@@ -327,16 +322,6 @@ void LogMessage::FailWithoutStackTrace() {
277   // When debugging on windows, avoid the obnoxious dialog.
278   __debugbreak();
279 #endif
280-
281-#ifdef __ELF__
282-  // For b/8737634, flush coverage if we are in coverage mode.
283-  if (&__gcov_dump != nullptr) {
284-    __gcov_dump();
285-  } else if (&__gcov_flush != nullptr) {
286-    __gcov_flush();
287-  }
288-#endif
289-
290   abort();
291 }
292