Bug 265905 - www/firefox: 104.0 build failure (12.3/i386 - 32-bit) - alignment error
Summary: www/firefox: 104.0 build failure (12.3/i386 - 32-bit) - alignment error
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: i386 Any
: --- Affects Some People
Assignee: freebsd-gecko (Nobody)
URL:
Keywords:
Depends on: 266470
Blocks:
  Show dependency treegraph
 
Reported: 2022-08-17 15:39 UTC by John Hein
Modified: 2023-04-23 19:57 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (gecko)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2022-08-17 15:39:50 UTC
In file included from /usr/ports/www/firefox/work/firefox-1
04.0/devtools/shared/heapsnapshot/CoreDump.pb.cc:4:
In file included from /usr/ports/www/firefox/work/firefox-1
04.0/devtools/shared/heapsnapshot/CoreDump.pb.h:24:
In file included from /usr/ports/www/firefox/work/.build/dist/include/google/protobuf/arena.h:52:
/usr/ports/www/firefox/work/.build/dist/include/google/protobuf/arena_impl.h:643:10: error: requested alignment is less than minimum alignment of 8 for
 type 'google::protobuf::internal::ThreadSafeArena::CacheAlignedLifecycleIdGenerator'
  struct alignas(kCacheAlignment) CacheAlignedLifecycleIdGenerator {
         ^
1 error generated.


This is with a ports tree, main branch at dcac5c1c912b735a55126851583eb0d8220ba4cb
Comment 1 John Hein 2022-08-17 15:53:21 UTC
I didn't see any bug for this upstream at https://bugzilla.mozilla.org/
Comment 2 John Hein 2022-08-17 15:56:08 UTC
Upstream bug entered: https://bugzilla.mozilla.org/show_bug.cgi?id=1785285
Comment 3 Martin Birgmeier 2022-08-20 19:11:47 UTC
It seems to compile with the following patch:

--- toolkit/components/protobuf/src/google/protobuf/arena_impl.h.ORIG   2022-08-19 01:40:42.000000000 +0200
+++ toolkit/components/protobuf/src/google/protobuf/arena_impl.h        2022-08-20 20:51:14.312522000 +0200
@@ -56,6 +56,7 @@
 namespace internal {
 
 // To prevent sharing cache lines between threads
+#define __cpp_aligned_new 1
 #ifdef __cpp_aligned_new
 enum { kCacheAlignment = 64 };
 #else

(gleaned from comparing with the slightly older port version of protobuf)

-- Martin
Comment 4 Martin Birgmeier 2022-08-20 19:58:02 UTC
and (as in devel/protobuf):

--- ./toolkit/components/protobuf/src/google/protobuf/arenastring.cc.ORIG       2022-08-19 03:24:42.000000000 +0200
+++ ./toolkit/components/protobuf/src/google/protobuf/arenastring.cc    2022-08-20 21:56:48.727873000 +0200
@@ -64,7 +64,7 @@
 #endif
 constexpr size_t kStringAlign = alignof(std::string);
 
-static_assert((kStringAlign > kNewAlign ? kStringAlign : kNewAlign) >= 8, "");
+// static_assert((kStringAlign > kNewAlign ? kStringAlign : kNewAlign) >= 8, "");
 static_assert(alignof(ExplicitlyConstructedArenaString) >= 8, "");
 
 }  // namespace

-- Martin
Comment 5 John Hein 2022-11-23 04:46:51 UTC
Supposedly this may be fixed in Firefox 105 (which pulled in an update to protobuf 21.4 - see https://bugzilla.mozilla.org/show_bug.cgi?id=1785285#c18), but a different build problem (bug 266470) exists.

In a way bug 266470 is blocking this bug - or at least we can't complete a build to help confirm that this bug (alignment error) is fixed.