RESOLVED FIXED 222480
[GTK] Fails to build in i386: static assertion failed: divisor must be a power of two
https://bugs.webkit.org/show_bug.cgi?id=222480
Summary [GTK] Fails to build in i386: static assertion failed: divisor must be a powe...
Alberto Garcia
Reported 2021-02-26 09:44:03 PST
I can reproduce this with WebKitGTK 2.31.90: In file included from DerivedSources/ForwardingHeaders/wtf/FastMalloc.h:26, from ../Source/WebKit/config.h:42, from DerivedSources/WebKit/WebPageProxyMessageReceiver.cpp:25: DerivedSources/ForwardingHeaders/wtf/StdLibExtras.h: In instantiation of ‘constexpr size_t WTF::roundUpToMultipleOf(size_t) [with unsigned int divisor = 48; size_t = unsigned int]’: ../Source/WebKit/Platform/IPC/StreamConnectionBuffer.h:117:96: required from here DerivedSources/ForwardingHeaders/wtf/StdLibExtras.h:187:27: error: static assertion failed: divisor must be a power of two! 187 | static_assert(divisor && !(divisor & (divisor - 1)), "divisor must be a power of two!"); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ As you can see 'divisor' is 48, I suspect that the problem is in sizeof(Header) due to the differences in size_t between 32-bit and 64-bit platforms: https://trac.webkit.org/browser/webkit/trunk/Source/WebKit/Platform/IPC/StreamConnectionBuffer.h?rev=273204#L117
Attachments
Patch (1.40 KB, patch)
2021-02-26 12:44 PST, Alberto Garcia
cgarcia: review+
Alberto Garcia
Comment 1 2021-02-26 09:45:05 PST
This was added in r273204.
Kimmo Kinnunen
Comment 2 2021-02-26 10:12:21 PST
Thanks! It's a typo: - roundUpToMultipleOf<sizeof(std::max_align_t)> + roundUpToMultipleOf<alignof(std::max_align_t)>
Kimmo Kinnunen
Comment 3 2021-02-26 10:13:27 PST
I can fix it on coming Monday the latest, if nobody gets around fixing it before.
Alberto Garcia
Comment 4 2021-02-26 12:44:11 PST
Created attachment 421699 [details] Patch Here is the patch, thanks!
Kimmo Kinnunen
Comment 5 2021-03-01 00:59:51 PST
Comment on attachment 421699 [details] Patch Thanks, looks good.
Alberto Garcia
Comment 6 2021-03-01 01:44:08 PST
Note You need to log in before you can comment on or make changes to this bug.