git: 1eca35157e9d - 2022Q3 - www/firefox: fix build on i386 (again)

From: Christoph Moench-Tegeder <cmt_at_FreeBSD.org>
Date: Thu, 15 Sep 2022 21:15:52 UTC
The branch 2022Q3 has been updated by cmt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1eca35157e9dda8f83d0d672d4ecfc6a5cfdf3d6

commit 1eca35157e9dda8f83d0d672d4ecfc6a5cfdf3d6
Author:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2022-09-15 21:12:36 +0000
Commit:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2022-09-15 21:15:45 +0000

    www/firefox: fix build on i386 (again)
    
    upstream fix for alignment issues in embedded protobuf was not complete
    
    Reported by:    fallout
    
    (cherry picked from commit ac39d32256828d37b4dd99a2458298aa90010db2)
---
 www/firefox/files/patch-i386-protobuf-alignment | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/www/firefox/files/patch-i386-protobuf-alignment b/www/firefox/files/patch-i386-protobuf-alignment
new file mode 100644
index 000000000000..0d58c8644e79
--- /dev/null
+++ b/www/firefox/files/patch-i386-protobuf-alignment
@@ -0,0 +1,15 @@
+# On FreeBSD/i386's LLVM, actual alignment for atomic types requires
+# stricter alignment rules, mostly on 8 byte boundaries instead of 4 byte
+# as indicated by max_align_t.
+
+--- ./toolkit/components/protobuf/src/google/protobuf/arena_impl.h.orig	2022-08-20 20:07:57.096818000 +0200
++++ ./toolkit/components/protobuf/src/google/protobuf/arena_impl.h	2022-08-20 21:40:47.821690000 +0200
+@@ -640,7 +640,7 @@
+ #ifdef _MSC_VER
+ #pragma warning(disable : 4324)
+ #endif
+-  struct alignas(kCacheAlignment) CacheAlignedLifecycleIdGenerator {
++  struct alignas(alignof(std::atomic<LifecycleIdAtomic>)) CacheAlignedLifecycleIdGenerator {
+     std::atomic<LifecycleIdAtomic> id;
+   };
+   static CacheAlignedLifecycleIdGenerator lifecycle_id_generator_;