[arch-commits] Commit in electron12/trunk (4 files)

Evangelos Foutras foutrelis at gemini.archlinux.org
Fri Apr 15 00:59:01 UTC 2022


    Date: Friday, April 15, 2022 @ 00:59:01
  Author: foutrelis
Revision: 1186415

Fix build with glibc 2.34

Added:
  electron12/trunk/breakpad-fix-for-non-constant-SIGSTKSZ.patch
  electron12/trunk/sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch
  electron12/trunk/std-max-fix.patch
Modified:
  electron12/trunk/PKGBUILD

------------------------------------------------------------+
 PKGBUILD                                                   |   15 ++--
 breakpad-fix-for-non-constant-SIGSTKSZ.patch               |   35 +++++++++
 sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch |   39 +++++++++++
 std-max-fix.patch                                          |   11 +++
 4 files changed, 94 insertions(+), 6 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-04-15 00:59:00 UTC (rev 1186414)
+++ PKGBUILD	2022-04-15 00:59:01 UTC (rev 1186415)
@@ -30,11 +30,14 @@
         'default_app-icon.patch'
         'use-system-libraries-in-node.patch'
         'add-dependency-on-opus-in-webcodecs.patch'
+        'breakpad-fix-for-non-constant-SIGSTKSZ.patch'
         'chromium-fix-libva-redef.patch'
         'chromium-glibc-2.33.patch'
         'chromium-harfbuzz-3.0.0.patch'
+        'sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch'
         'skia-harfbuzz-3.0.0.patch'
         'sql-make-VirtualCursor-standard-layout-type.patch'
+        'std-max-fix.patch'
         'ffmpeg5.patch'
        )
 sha256sums=('SKIP'
@@ -45,11 +48,14 @@
             'dd2d248831dd4944d385ebf008426e66efe61d6fdf66f8932c963a12167947b4'
             'f16103daf05713dea632b5f01e45db20ff12d1770a6539b4e8d3957a0242dd54'
             'b86b11de8db438c47f0a84c7956740f648d21035f4ee46bfbd50c3348d369121'
+            'b4d28867c1fabde6c50a2cfa3f784730446c4d86e5191e0f0000fbf7b0f91ecf'
             'de9eb3612d44616a500c2eccdffac814eb90ad9a868cc1030d17fc6783d544e2'
             '2fccecdcd4509d4c36af873988ca9dbcba7fdb95122894a9fdf502c33a1d7a4b'
             '7ce947944a139e66774dfc7249bf7c3069f07f83a0f1b2c1a1b14287a7e15928'
+            'f910be9370c880de6e1d61cc30383c069e421d7acf406166e4fbfad324fc7d61'
             'c9ed1dbadaf4be6097e25bc5577b91751799befc2d0376b143e1bd10def5754e'
             'dd317f85e5abfdcfc89c6f23f4c8edbcdebdd5e083dcec770e5da49ee647d150'
+            'c315dd56b354cf5ad3458e1edf397cc7b492fefe82138135a881206a82b9d9dc'
             '4f32b815349357ef1f17b36059cee588c994472b9754a194fff41ec21a93826b'
            )
 
@@ -139,21 +145,18 @@
 
   echo "Applying local patches..."
   # Fixes for building with libstdc++ instead of libc++
+  patch -Np1 -d third_party/breakpad/breakpad < ../breakpad-fix-for-non-constant-SIGSTKSZ.patch
   patch -Np1 -i ../patches/chromium-89-quiche-dcheck.patch
   patch -Np1 -i ../patches/chromium-89-AXTreeSerializer-include.patch
-
   patch -Np1 -i ../ffmpeg5.patch
-  # Patches to build with ffmpeg 4.4; remove when ffmpeg 5.0 moves to stable
-  if ! pkg-config --atleast-version 59 libavformat; then
-    patch -Rp1 -i ../ffmpeg5.patch
-  fi
-
   patch -Np1 -i ../add-dependency-on-opus-in-webcodecs.patch
   patch -Np1 -i ../chromium-fix-libva-redef.patch
   patch -Np1 -i ../chromium-glibc-2.33.patch
   patch -Np1 -i ../chromium-harfbuzz-3.0.0.patch
+  patch -Np1 -i ../sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch
   patch -Np1 -d third_party/skia <../skia-harfbuzz-3.0.0.patch
   patch -Np1 -i ../sql-make-VirtualCursor-standard-layout-type.patch
+  patch -Np1 -i ../std-max-fix.patch
   patch -Np1 -i ../use-system-libraries-in-node.patch
   patch -Np1 -i ../default_app-icon.patch  # Icon from .desktop file
 

Added: breakpad-fix-for-non-constant-SIGSTKSZ.patch
===================================================================
--- breakpad-fix-for-non-constant-SIGSTKSZ.patch	                        (rev 0)
+++ breakpad-fix-for-non-constant-SIGSTKSZ.patch	2022-04-15 00:59:01 UTC (rev 1186415)
@@ -0,0 +1,35 @@
+From 605c51ed96ad44b34c457bbca320e74e194c317e Mon Sep 17 00:00:00 2001
+From: David Faure <david.faure at kdab.com>
+Date: Wed, 15 Dec 2021 22:26:40 +0100
+Subject: [PATCH] Fix for non-constant SIGSTKSZ
+
+On glibc > 2.33, `SIGSTKSZ` might not be constant (in which case
+it expands to a call to `sysconf` which returns a `long int`); see
+https://sourceware.org/pipermail/libc-alpha/2020-October/118513.html
+
+Pass unsigned explicitly to std::max, to avoid relying on template
+argument deduction. This works both with the old-style constant
+`SIGSTKSZ` and the new configurable one.
+
+Initially based on https://chromium-review.googlesource.com/c/2776379
+
+Change-Id: I9fc95337f973e871b84735ce822b5e11ba73ea8c
+Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3340721
+Reviewed-by: Mark Mentovai <mark at chromium.org>
+---
+ src/client/linux/handler/exception_handler.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
+index ca353c40..499be0a9 100644
+--- a/src/client/linux/handler/exception_handler.cc
++++ b/src/client/linux/handler/exception_handler.cc
+@@ -138,7 +138,7 @@ void InstallAlternateStackLocked() {
+   // SIGSTKSZ may be too small to prevent the signal handlers from overrunning
+   // the alternative stack. Ensure that the size of the alternative stack is
+   // large enough.
+-  static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
++  const unsigned kSigStackSize = std::max<unsigned>(16384, SIGSTKSZ);
+ 
+   // Only set an alternative stack if there isn't already one, or if the current
+   // one is too small.

Added: sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch
===================================================================
--- sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch	                        (rev 0)
+++ sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch	2022-04-15 00:59:01 UTC (rev 1186415)
@@ -0,0 +1,39 @@
+From 28ac6a15411d01301e171b8a8b0019abd57589b9 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09 at googlemail.com>
+Date: Mon, 7 Feb 2022 20:09:57 +0000
+Subject: [PATCH] sandbox: build if glibc 2.34+ dynamic stack size is enabled
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Compilation of sandbox fails when using dynamic stack size in glibc
+2.34 or newer. This is because the value is not a literal anymore but
+obtained through sysconf.
+
+To avoid this, use memset to put zeros in the buffer.
+
+Change-Id: Ia479e0f799b77a10a00197aaaa0500e62546f458
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3436947
+Reviewed-by: Jorge Lucangeli Obes <jorgelo at chromium.org>
+Commit-Queue: José Dapena Paz <jdapena at igalia.com>
+Cr-Commit-Position: refs/heads/main@{#967943}
+---
+ sandbox/linux/services/credentials.cc | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc
+index ca6b5954798..c933eafd163 100644
+--- a/sandbox/linux/services/credentials.cc
++++ b/sandbox/linux/services/credentials.cc
+@@ -100,7 +100,10 @@ bool ChrootToSafeEmptyDir() {
+   // TODO(crbug.com/1247458) Broken in MSan builds after LLVM f1bb30a4956f.
+   clone_flags |= CLONE_VM | CLONE_VFORK | CLONE_SETTLS;
+ 
+-  char tls_buf[PTHREAD_STACK_MIN] = {0};
++  // PTHREAD_STACK_MIN can be dynamic in glibc2.34+, so it is not possible to
++  // zeroify tls_buf assigning { 0 }
++  char tls_buf[PTHREAD_STACK_MIN];
++  memset(tls_buf, 0, PTHREAD_STACK_MIN);
+   tls = tls_buf;
+ #endif
+ 

Added: std-max-fix.patch
===================================================================
--- std-max-fix.patch	                        (rev 0)
+++ std-max-fix.patch	2022-04-15 00:59:01 UTC (rev 1186415)
@@ -0,0 +1,11 @@
+--- a/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc
++++ b/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc
+@@ -136,7 +136,7 @@
+ #else
+   const size_t page_mask = sysconf(_SC_PAGESIZE) - 1;
+ #endif
+-  size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
++  size_t stack_size = (std::max<unsigned>(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
+ #if defined(ABSL_HAVE_ADDRESS_SANITIZER) || \
+     defined(ABSL_HAVE_MEMORY_SANITIZER) || defined(ABSL_HAVE_THREAD_SANITIZER)
+   // Account for sanitizer instrumentation requiring additional stack space.



More information about the arch-commits mailing list