Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 872360 Details for
Bug 915059
dev-qt/qtwebengine-5.15.10 fails to build on clang-17[default-libcxx]: error: no viable overloaded '='
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
qtwebengine-5.15.10_p20230815-clang-17-p3.patch
qtwebengine-5.15.10_p20230815-clang-17-p3.patch (text/plain), 11.26 KB, created by
Mark Wright
on 2023-10-08 22:01:04 UTC
(
hide
)
Description:
qtwebengine-5.15.10_p20230815-clang-17-p3.patch
Filename:
MIME Type:
Creator:
Mark Wright
Created:
2023-10-08 22:01:04 UTC
Size:
11.26 KB
patch
obsolete
>--- qtwebengine-5.15.10_p20230815-orig/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/utils.h 2021-01-20 12:18:42.000000000 +1100 >+++ qtwebengine-5.15.10_p20230815/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/utils.h 2023-10-08 12:29:04.142828963 +1100 >@@ -17,25 +17,26 @@ > #ifndef INCLUDE_PERFETTO_EXT_BASE_UTILS_H_ > #define INCLUDE_PERFETTO_EXT_BASE_UTILS_H_ > >-#include "perfetto/base/build_config.h" >-#include "perfetto/base/compiler.h" >- > #include <errno.h> > #include <stddef.h> >+#include <stdint.h> > #include <stdlib.h> >-#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) >-#include <sys/types.h> >-#endif >- >-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \ >- PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) >-#include <unistd.h> // For getpagesize(). >-#elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) >-#include <mach/vm_page_size.h> >-#endif > > #include <atomic> >+#include <functional> >+#include <memory> >+#include <string> > >+#include "perfetto/base/build_config.h" >+#include "perfetto/base/compiler.h" >+#include "perfetto/ext/base/sys_types.h" >+ >+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) >+// Even if Windows has errno.h, the all syscall-restart behavior does not apply. >+// Trying to handle EINTR can cause more harm than good if errno is left stale. >+// Chromium does the same. >+#define PERFETTO_EINTR(x) (x) >+#else > #define PERFETTO_EINTR(x) \ > ([&] { \ > decltype(x) eintr_wrapper_result; \ >@@ -44,24 +45,11 @@ > } while (eintr_wrapper_result == -1 && errno == EINTR); \ > return eintr_wrapper_result; \ > }()) >- >-#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) >-// TODO(brucedawson) - create a ::perfetto::base::IOSize to replace this. >-#if defined(_WIN64) >-using ssize_t = __int64; >-#else >-using ssize_t = long; >-#endif > #endif > > namespace perfetto { > namespace base { > >-#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) >-constexpr uid_t kInvalidUid = static_cast<uid_t>(-1); >-constexpr pid_t kInvalidPid = static_cast<pid_t>(-1); >-#endif >- > // Do not add new usages of kPageSize, consider using GetSysPageSize() below. > // TODO(primiano): over time the semantic of kPageSize became too ambiguous. > // Strictly speaking, this constant is incorrect on some new devices where the >@@ -72,30 +60,11 @@ > > // Returns the system's page size. Use this when dealing with mmap, madvise and > // similar mm-related syscalls. >-inline uint32_t GetSysPageSize() { >- ignore_result(kPageSize); // Just to keep the amalgamated build happy. >-#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \ >- PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) >- static std::atomic<uint32_t> page_size{0}; >- // This function might be called in hot paths. Avoid calling getpagesize() all >- // the times, in many implementations getpagesize() calls sysconf() which is >- // not cheap. >- uint32_t cached_value = page_size.load(std::memory_order_relaxed); >- if (PERFETTO_UNLIKELY(cached_value == 0)) { >- cached_value = static_cast<uint32_t>(getpagesize()); >- page_size.store(cached_value, std::memory_order_relaxed); >- } >- return cached_value; >-#elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) >- return static_cast<uint32_t>(vm_page_size); >-#else >- return 4096; >-#endif >-} >+uint32_t GetSysPageSize(); > >-template <typename T> >-constexpr size_t ArraySize(const T& array) { >- return sizeof(array) / sizeof(array[0]); >+template <typename T, size_t TSize> >+constexpr size_t ArraySize(const T (&)[TSize]) { >+ return TSize; > } > > // Function object which invokes 'free' on its parameter, which must be >@@ -109,8 +78,6 @@ > > template <typename T> > constexpr T AssumeLittleEndian(T value) { >- static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__, >- "Unimplemented on big-endian archs"); > return value; > } > >@@ -125,6 +92,91 @@ > return err == EAGAIN || err == EWOULDBLOCK; > } > >+// setenv(2)-equivalent. Deals with Windows vs Posix discrepancies. >+void SetEnv(const std::string& key, const std::string& value); >+ >+// unsetenv(2)-equivalent. Deals with Windows vs Posix discrepancies. >+void UnsetEnv(const std::string& key); >+ >+// Calls mallopt(M_PURGE, 0) on Android. Does nothing on other platforms. >+// This forces the allocator to release freed memory. This is used to work >+// around various Scudo inefficiencies. See b/170217718. >+void MaybeReleaseAllocatorMemToOS(); >+ >+// geteuid() on POSIX OSes, returns 0 on Windows (See comment in utils.cc). >+uid_t GetCurrentUserId(); >+ >+// Forks the process. >+// Parent: prints the PID of the child, calls |parent_cb| and exits from the >+// process with its return value. >+// Child: redirects stdio onto /dev/null, chdirs into / and returns. >+void Daemonize(std::function<int()> parent_cb); >+ >+// Returns the path of the current executable, e.g. /foo/bar/exe. >+std::string GetCurExecutablePath(); >+ >+// Returns the directory where the current executable lives in, e.g. /foo/bar. >+// This is independent of cwd(). >+std::string GetCurExecutableDir(); >+ >+// Memory returned by AlignedAlloc() must be freed via AlignedFree() not just >+// free. It makes a difference on Windows where _aligned_malloc() and >+// _aligned_free() must be paired. >+// Prefer using the AlignedAllocTyped() below which takes care of the pairing. >+void* AlignedAlloc(size_t alignment, size_t size); >+void AlignedFree(void*); >+ >+// A RAII version of the above, which takes care of pairing Aligned{Alloc,Free}. >+template <typename T> >+struct AlignedDeleter { >+ inline void operator()(T* ptr) const { AlignedFree(ptr); } >+}; >+ >+// The remove_extent<T> here and below is to allow defining unique_ptr<T[]>. >+// As per https://en.cppreference.com/w/cpp/memory/unique_ptr the Deleter takes >+// always a T*, not a T[]*. >+template <typename T> >+using AlignedUniquePtr = >+ std::unique_ptr<T, AlignedDeleter<typename std::remove_extent<T>::type>>; >+ >+template <typename T> >+AlignedUniquePtr<T> AlignedAllocTyped(size_t n_membs) { >+ using TU = typename std::remove_extent<T>::type; >+ return AlignedUniquePtr<T>( >+ static_cast<TU*>(AlignedAlloc(alignof(TU), sizeof(TU) * n_membs))); >+} >+ >+// A RAII wrapper to invoke a function when leaving a function/scope. >+template <typename Func> >+class OnScopeExitWrapper { >+ public: >+ explicit OnScopeExitWrapper(Func f) : f_(std::move(f)), active_(true) {} >+ OnScopeExitWrapper(OnScopeExitWrapper&& other) noexcept >+ : f_(std::move(other.f_)), active_(other.active_) { >+ other.active_ = false; >+ } >+ ~OnScopeExitWrapper() { >+ if (active_) >+ f_(); >+ } >+ >+ private: >+ Func f_; >+ bool active_; >+}; >+ >+template <typename Func> >+PERFETTO_WARN_UNUSED_RESULT OnScopeExitWrapper<Func> OnScopeExit(Func f) { >+ return OnScopeExitWrapper<Func>(std::move(f)); >+} >+ >+// Returns a xxd-style hex dump (hex + ascii chars) of the input data. >+std::string HexDump(const void* data, size_t len, size_t bytes_per_line = 16); >+inline std::string HexDump(const std::string& data, >+ size_t bytes_per_line = 16) { >+ return HexDump(data.data(), data.size(), bytes_per_line); >+} >+ > } // namespace base > } // namespace perfetto > >--- /dev/null 2013-02-04 11:11:16.750999994 +1100 >+++ qtwebengine-5.15.10_p20230815/src/3rdparty/chromium/third_party/perfetto/src/base/utils.cc 2023-10-08 21:22:41.123828556 +1100 >@@ -0,0 +1,121 @@ >+/* >+ * Copyright (C) 2020 The Android Open Source Project >+ * >+ * Licensed under the Apache License, Version 2.0 (the "License"); >+ * you may not use this file except in compliance with the License. >+ * You may obtain a copy of the License at >+ * >+ * http://www.apache.org/licenses/LICENSE-2.0 >+ * >+ * Unless required by applicable law or agreed to in writing, software >+ * distributed under the License is distributed on an "AS IS" BASIS, >+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >+ * See the License for the specific language governing permissions and >+ * limitations under the License. >+ */ >+ >+#include "perfetto/ext/base/utils.h" >+ >+#include <string> >+ >+#include "perfetto/base/build_config.h" >+#include "perfetto/base/logging.h" >+#include "perfetto/ext/base/file_utils.h" >+#include "perfetto/ext/base/pipe.h" >+#include "perfetto/ext/base/string_utils.h" >+ >+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \ >+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \ >+ PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) || \ >+ PERFETTO_BUILDFLAG(PERFETTO_OS_FUCHSIA) >+#include <limits.h> >+#include <stdlib.h> // For _exit() >+#include <unistd.h> // For getpagesize() and geteuid() & fork() >+#endif >+ >+#if PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) >+#include <mach-o/dyld.h> >+#include <mach/vm_page_size.h> >+#endif >+ >+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) >+#include <Windows.h> >+#include <io.h> >+#include <malloc.h> // For _aligned_malloc(). >+#endif >+ >+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) >+#include <dlfcn.h> >+#include <malloc.h> >+ >+#ifdef M_PURGE >+#define PERFETTO_M_PURGE M_PURGE >+#else >+// Only available in in-tree builds and on newer SDKs. >+#define PERFETTO_M_PURGE -101 >+#endif // M_PURGE >+ >+#ifdef M_PURGE_ALL >+#define PERFETTO_M_PURGE_ALL M_PURGE_ALL >+#else >+// Only available in in-tree builds and on newer SDKs. >+#define PERFETTO_M_PURGE_ALL -104 >+#endif // M_PURGE >+ >+namespace { >+extern "C" { >+using MalloptType = int (*)(int, int); >+} >+} // namespace >+#endif // OS_ANDROID >+ >+namespace perfetto { >+namespace base { >+ >+uint32_t GetSysPageSize() { >+ ignore_result(kPageSize); // Just to keep the amalgamated build happy. >+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \ >+ PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) >+ static std::atomic<uint32_t> page_size{0}; >+ // This function might be called in hot paths. Avoid calling getpagesize() all >+ // the times, in many implementations getpagesize() calls sysconf() which is >+ // not cheap. >+ uint32_t cached_value = page_size.load(std::memory_order_relaxed); >+ if (PERFETTO_UNLIKELY(cached_value == 0)) { >+ cached_value = static_cast<uint32_t>(getpagesize()); >+ page_size.store(cached_value, std::memory_order_relaxed); >+ } >+ return cached_value; >+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) >+ return static_cast<uint32_t>(vm_page_size); >+#else >+ return 4096; >+#endif >+} >+ >+void* AlignedAlloc(size_t alignment, size_t size) { >+ void* res = nullptr; >+ alignment = AlignUp<sizeof(void*)>(alignment); // At least pointer size. >+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) >+ // Window's _aligned_malloc() has a nearly identically signature to Unix's >+ // aligned_alloc() but its arguments are obviously swapped. >+ res = _aligned_malloc(size, alignment); >+#else >+ // aligned_alloc() has been introduced in Android only in API 28. >+ // Also NaCl and Fuchsia seems to have only posix_memalign(). >+ ignore_result(posix_memalign(&res, alignment, size)); >+#endif >+ PERFETTO_CHECK(res); >+ return res; >+} >+ >+void AlignedFree(void* ptr) { >+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) >+ _aligned_free(ptr); // MSDN says it is fine to pass nullptr. >+#else >+ free(ptr); >+#endif >+} >+ >+} // namespace base >+} // namespace perfetto >--- qtwebengine-5.15.10_p20230815-orig/src/3rdparty/chromium/third_party/perfetto/src/base/BUILD.gn 2021-01-20 12:18:42.000000000 +1100 >+++ qtwebengine-5.15.10_p20230815/src/3rdparty/chromium/third_party/perfetto/src/base/BUILD.gn 2023-10-08 18:27:38.497967149 +1100 >@@ -34,6 +34,7 @@ > "subprocess.cc", > "thread_checker.cc", > "time.cc", >+ "utils.cc", > "uuid.cc", > "virtual_destructors.cc", > "waitable_event.cc",
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 915059
:
871994
|
871995
|
872358
|
872359
| 872360