[packages/firefox] upstream (protobuf) fix for build failure on x86 32-bit
atler
atler at pld-linux.org
Wed Aug 24 00:50:33 CEST 2022
commit d1c14d53340ca2635dceb53afe15b4093a96bb7c
Author: Jan Palus <atler at pld-linux.org>
Date: Wed Aug 24 00:49:19 2022 +0200
upstream (protobuf) fix for build failure on x86 32-bit
firefox.spec | 4 ++++
protobuf-alignment.patch | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 38 insertions(+)
---
diff --git a/firefox.spec b/firefox.spec
index 9d9aad3..390b106 100644
--- a/firefox.spec
+++ b/firefox.spec
@@ -264,6 +264,7 @@ Patch8: %{name}-system-virtualenv.patch
Patch9: %{name}-Disable-Firefox-Health-Report.patch
Patch10: system-cairo.patch
Patch11: glibc-double.patch
+Patch12: protobuf-alignment.patch
URL: https://www.mozilla.org/firefox/
BuildRequires: OpenGL-devel
BuildRequires: alsa-lib-devel
@@ -2126,6 +2127,9 @@ unpack() {
%patch9 -p1
%{?with_system_cairo:%patch10 -p1}
%patch11 -p1
+cd toolkit/components/protobuf
+%patch12 -p1
+cd ../../..
%if %{with pgo}
%{__sed} -i -e 's at __BROWSER_PATH__@"../../dist/bin/firefox-bin"@' build/automation.py.in
diff --git a/protobuf-alignment.patch b/protobuf-alignment.patch
new file mode 100644
index 0000000..a7a6424
--- /dev/null
+++ b/protobuf-alignment.patch
@@ -0,0 +1,34 @@
+From db1dab5f8d6b521ef915fb42bcb08eccb94c9b09 Mon Sep 17 00:00:00 2001
+From: Yash Tibrewal <yashkt at google.com>
+Date: Thu, 21 Jul 2022 22:04:41 +0000
+Subject: [PATCH] Reduce the required alignment of ArenaString from 8 to 4
+
+---
+ src/google/protobuf/arenastring.cc | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/google/protobuf/arenastring.cc b/src/google/protobuf/arenastring.cc
+index 3887c940a3..af0c9df6bc 100644
+--- a/src/google/protobuf/arenastring.cc
++++ b/src/google/protobuf/arenastring.cc
+@@ -50,7 +50,8 @@ namespace internal {
+
+ namespace {
+
+-// Enforce that allocated data aligns to at least 8 bytes, and that
++// TaggedStringPtr::Flags uses the lower 2 bits as tags.
++// Enforce that allocated data aligns to at least 4 bytes, and that
+ // the alignment of the global const string value does as well.
+ // The alignment guaranteed by `new std::string` depends on both:
+ // - new align = __STDCPP_DEFAULT_NEW_ALIGNMENT__ / max_align_t
+@@ -64,8 +65,8 @@ constexpr size_t kNewAlign = alignof(std::max_align_t);
+ #endif
+ constexpr size_t kStringAlign = alignof(std::string);
+
+-static_assert((kStringAlign > kNewAlign ? kStringAlign : kNewAlign) >= 8, "");
+-static_assert(alignof(ExplicitlyConstructedArenaString) >= 8, "");
++static_assert((kStringAlign > kNewAlign ? kStringAlign : kNewAlign) >= 4, "");
++static_assert(alignof(ExplicitlyConstructedArenaString) >= 4, "");
+
+ } // namespace
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/firefox.git/commitdiff/d1c14d53340ca2635dceb53afe15b4093a96bb7c
More information about the pld-cvs-commit
mailing list