pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

qt6-qtwebengine: catch up to some patches from the OpenBSD package.



Module Name:	pkgsrc-wip
Committed By:	Mark Davies <mark%ecs.vuw.ac.nz@localhost>
Pushed By:	markd
Date:		Mon Feb 17 08:38:37 2025 +1300
Changeset:	55d3c40c53de68364224ceb987f849ccc823222e

Modified Files:
	qt6-qtwebengine/distinfo
	qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_page__allocator__constants.h
	qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__alloc__constants.h
	qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__root.cc
Added Files:
	qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__address__space.cc
	qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__page__constants.h
	qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_starscan_stack_stack.cc

Log Message:
qt6-qtwebengine: catch up to some patches from the OpenBSD package.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=55d3c40c53de68364224ceb987f849ccc823222e

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 qt6-qtwebengine/distinfo                           |  9 ++--
 ...c_partition__alloc_page__allocator__constants.h | 29 +++++++++++-
 ...c_partition__alloc_partition__address__space.cc | 13 ++++++
 ..._partition__alloc_partition__alloc__constants.h | 11 ++++-
 ...c_partition__alloc_partition__page__constants.h | 13 ++++++
 ...locator_src_partition__alloc_partition__root.cc | 11 ++++-
 ...or_src_partition__alloc_starscan_stack_stack.cc | 52 ++++++++++++++++++++++
 7 files changed, 132 insertions(+), 6 deletions(-)

diffs:
diff --git a/qt6-qtwebengine/distinfo b/qt6-qtwebengine/distinfo
index 875500dcf7..8ad8843182 100644
--- a/qt6-qtwebengine/distinfo
+++ b/qt6-qtwebengine/distinfo
@@ -12,18 +12,21 @@ SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_partition_
 SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_BUILD.gn) = 1cbdc7f722442ab943cca94e25d45549f696b53e
 SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_address__space__randomization.h) = e3889e0ef74ff8559d9f981be61deef532c0a098
 SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_page__allocator.h) = fcea50bc229d47c2446e52b1927a37de105ee86b
-SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_page__allocator__constants.h) = 7a467d15fbd126938b74f2ae1bbf191d7c7c2db2
+SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_page__allocator__constants.h) = b1a5f2cff91fa023f4917fc4edc0b1ba0c571bc1
 SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_page__allocator__internals__posix.h) = cbffb1940b291f966d538c9a6008194d770d1d84
+SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__address__space.cc) = 62cf1b5009ebb4c4fcf3020d06eeeee6c7095675
 SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_debug_stack__trace__posix.cc) = 8564bbc7ff9e9ff521c317406d50cb49f37be855
 SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_rand__util__posix.cc) = a860fe3f31508962606cb6759be269ca4aa16414
 SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread.h) = 46df0aacbe5cd8d62c568404cf03410bdb0b2e37
 SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread__internal__posix.h) = 1416e565262c94b29c57c647fa2cd10a5f34fcc9
 SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__alloc__base_threading_platform__thread__posix.cc) = 6c1950dc3798480435ca593d47fb7266318fccca
 SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__alloc__config.h) = d0116447916dd3c343d557a7ea74a3bfdfa9f0b4
-SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__alloc__constants.h) = c6b98f0b31ce53698eb5de51c53a3c17b0dea284
+SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__alloc__constants.h) = 700e4bc98aa5a9c79bf0f36e1d4c8068135e9dda
 SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__alloc__forward.h) = 968a494d44b7c2717355589b296dd46723ce23bc
-SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__root.cc) = 7689d867298ea27a595b1e6377ed0f6eefe1a1f7
+SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__page__constants.h) = fee9611b5192cb557924094ea8de3707d25733dd
+SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__root.cc) = 05b48457c461ead1d9ac6fb0d2e4a6f7740ba4e1
 SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_spinning__mutex.cc) = b7c53bba2b13dc740a53ebcb57bc18f77c7ddb16
+SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_starscan_stack_stack.cc) = 15d2415154b5e807f8fea06523ee5b6849e845f4
 SHA1 (patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_thread__isolation_pkey.cc) = f6160c683456b1196b91a8f1bba3996c63aeb0f0
 SHA1 (patch-src_3rdparty_chromium_base_atomicops.h) = 38fcb75a7219fcc2e229fbfd55fe07217a9129f6
 SHA1 (patch-src_3rdparty_chromium_base_base__paths__posix.cc) = 91098d26e467c64faea8b59ab2c0ee8336cc5b2b
diff --git a/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_page__allocator__constants.h b/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_page__allocator__constants.h
index a659bf3f8a..7d5cfdd829 100644
--- a/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_page__allocator__constants.h
+++ b/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_page__allocator__constants.h
@@ -4,7 +4,7 @@ $NetBSD$
 * Based on OpenBSD's chromium patches, and
   pkgsrc's qt5-qtwebengine patches
 
---- src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/page_allocator_constants.h.orig	2024-11-21 04:36:37.000000000 +0000
+--- src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/page_allocator_constants.h.orig	2025-01-24 10:49:20.000000000 +0000
 +++ src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/page_allocator_constants.h
 @@ -25,7 +25,7 @@
  // elimination.
@@ -15,3 +15,30 @@ $NetBSD$
  // This should work for all POSIX (if needed), but currently all other
  // supported OS/architecture combinations use either hard-coded values
  // (such as x86) or have means to determine these values without needing
+@@ -92,7 +92,7 @@ PageAllocationGranularityShift() {
+   return 14;  // 16kB
+ #elif BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS)
+   return static_cast<size_t>(vm_page_shift);
+-#elif (BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)) && defined(ARCH_CPU_ARM64)
++#elif (BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64)
+   // arm64 supports 4kb (shift = 12), 16kb (shift = 14), and 64kb (shift = 16)
+   // page sizes. Retrieve from or initialize cache.
+   size_t shift = page_characteristics.shift.load(std::memory_order_relaxed);
+@@ -113,7 +113,7 @@ PageAllocationGranularity() {
+   // This is literally equivalent to |1 << PageAllocationGranularityShift()|
+   // below, but was separated out for IS_APPLE to avoid << on a non-constexpr.
+   return vm_page_size;
+-#elif (BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)) && defined(ARCH_CPU_ARM64)
++#elif (BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64)
+   // arm64 supports 4kb, 16kb, and 64kb page sizes. Retrieve from or
+   // initialize cache.
+   size_t size = page_characteristics.size.load(std::memory_order_relaxed);
+@@ -153,7 +153,7 @@ PA_ALWAYS_INLINE PAGE_ALLOCATOR_CONSTANT
+ SystemPageSize() {
+ #if (BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS)) || \
+     (BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_ARM64)) || \
+-    (BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64))
++    ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64))
+   // This is literally equivalent to |1 << SystemPageShift()| below, but was
+   // separated out for 64-bit IS_APPLE and arm64 on Android/Linux to avoid <<
+   // on a non-constexpr.
diff --git a/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__address__space.cc b/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__address__space.cc
new file mode 100644
index 0000000000..98e4a19399
--- /dev/null
+++ b/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__address__space.cc
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/partition_address_space.cc.orig	2025-01-24 10:49:20.000000000 +0000
++++ src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/partition_address_space.cc
+@@ -421,7 +421,7 @@ void PartitionAddressSpace::UninitThread
+ }
+ #endif
+ 
+-#if (BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)) && defined(ARCH_CPU_ARM64)
++#if (BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64)
+ 
+ PageCharacteristics page_characteristics;
+ 
diff --git a/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__alloc__constants.h b/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__alloc__constants.h
index 62a2978183..224948ff0e 100644
--- a/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__alloc__constants.h
+++ b/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__alloc__constants.h
@@ -4,8 +4,17 @@ $NetBSD$
 * Based on OpenBSD's chromium patches, and
   pkgsrc's qt5-qtwebengine patches
 
---- src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_constants.h.orig	2024-11-21 04:36:37.000000000 +0000
+--- src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_constants.h.orig	2025-01-24 10:49:20.000000000 +0000
 +++ src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_constants.h
+@@ -112,7 +112,7 @@ PartitionPageShift() {
+ }
+ #elif (BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS)) || \
+     (BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_ARM64)) ||   \
+-    (BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_ARM64))
++    ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64))
+ PA_ALWAYS_INLINE PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR size_t
+ PartitionPageShift() {
+   return PageAllocationGranularityShift() + 2;
 @@ -316,7 +316,7 @@ constexpr size_t kNumPools = kMaxPoolHan
  #if BUILDFLAG(IS_IOS)
  constexpr size_t kPoolMaxSize = 1 * kGiB;
diff --git a/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__page__constants.h b/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__page__constants.h
new file mode 100644
index 0000000000..e89e0c090b
--- /dev/null
+++ b/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__page__constants.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/partition_page_constants.h.orig	2025-01-24 10:49:20.000000000 +0000
++++ src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/partition_page_constants.h
+@@ -16,7 +16,7 @@ namespace partition_alloc::internal {
+ // (1 << 12 or 1 << 14), as checked in PartitionRoot::Init(). And
+ // PartitionPageSize() is 4 times the OS page size.
+ static constexpr size_t kMaxSlotsPerSlotSpan = 4 * (1 << 14) / kSmallestBucket;
+-#elif (BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)) && defined(ARCH_CPU_ARM64)
++#elif (BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && defined(ARCH_CPU_ARM64)
+ // System page size can be 4, 16, or 64 kiB on Linux on arm64. 64 kiB is
+ // currently (kMaxSlotsPerSlotSpanBits == 13) not supported by the code,
+ // so we use the 16 kiB maximum (64 kiB will crash).
diff --git a/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__root.cc b/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__root.cc
index b2d0e6f10c..dd313993df 100644
--- a/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__root.cc
+++ b/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_partition__root.cc
@@ -4,7 +4,7 @@ $NetBSD$
 * Based on OpenBSD's chromium patches, and
   pkgsrc's qt5-qtwebengine patches
 
---- src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc.orig	2024-11-21 04:36:37.000000000 +0000
+--- src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc.orig	2025-01-24 10:49:20.000000000 +0000
 +++ src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc
 @@ -47,7 +47,7 @@
  #include "wow64apiset.h"
@@ -24,6 +24,15 @@ $NetBSD$
    // When fork() is called, only the current thread continues to execute in the
    // child process. If the lock is held, but *not* by this thread when fork() is
    // called, we have a deadlock.
+@@ -377,7 +377,7 @@ static size_t PartitionPurgeSlotSpan(Par
+       (PartitionPageSize() * kMaxPartitionPagesPerRegularSlotSpan) /
+       MinPurgeableSlotSize();
+ #elif BUILDFLAG(IS_APPLE) ||                           \
+-    ((BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)) && \
++    ((BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && \
+      defined(ARCH_CPU_ARM64))
+   // It's better for slot_usage to be stack-allocated and fixed-size, which
+   // demands that its size be constexpr. On IS_APPLE and Linux on arm64,
 @@ -942,7 +942,7 @@ void PartitionRoot::Init(PartitionOption
      // apple OSes.
      PA_CHECK((internal::SystemPageSize() == (size_t{1} << 12)) ||
diff --git a/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_starscan_stack_stack.cc b/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_starscan_stack_stack.cc
new file mode 100644
index 0000000000..8c7816e18f
--- /dev/null
+++ b/qt6-qtwebengine/patches/patch-src_3rdparty_chromium_base_allocator_partition__allocator_src_partition__alloc_starscan_stack_stack.cc
@@ -0,0 +1,52 @@
+$NetBSD$
+
+--- src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/starscan/stack/stack.cc.orig	2025-01-24 10:49:20.000000000 +0000
++++ src/3rdparty/chromium/base/allocator/partition_allocator/src/partition_alloc/starscan/stack/stack.cc
+@@ -18,6 +18,10 @@
+ #include <pthread.h>
+ #endif
+ 
++#if BUILDFLAG(IS_BSD) && !BUILDFLAG(IS_NETBSD)
++#include <pthread_np.h>
++#endif
++
+ #if defined(LIBC_GLIBC)
+ extern "C" void* __libc_stack_end;
+ #endif
+@@ -50,6 +54,36 @@ void* GetStackTop() {
+   return pthread_get_stackaddr_np(pthread_self());
+ }
+ 
++#elif BUILDFLAG(IS_OPENBSD)
++
++void* GetStackTop() {
++  stack_t ss;
++  if (pthread_stackseg_np(pthread_self(), &ss) != 0)
++    return nullptr;
++  return reinterpret_cast<uint8_t*>(ss.ss_sp);
++}
++
++#elif BUILDFLAG(IS_FREEBSD) || BUILDFLAG(IS_NETBSD)
++
++void* GetStackTop() {
++   pthread_attr_t attr;
++   int error = pthread_attr_init(&attr);
++   if (error) {
++     return nullptr;
++   }
++   error = pthread_attr_get_np(pthread_self(), &attr);
++   if (!error) {
++     void* base;
++     size_t size;
++     error = pthread_attr_getstack(&attr, &base, &size);
++     PA_CHECK(!error);
++     pthread_attr_destroy(&attr);
++     return reinterpret_cast<uint8_t*>(base) + size;
++   }
++  pthread_attr_destroy(&attr);
++  return nullptr;
++}
++
+ #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
+ 
+ void* GetStackTop() {


Home | Main Index | Thread Index | Old Index