WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
312677
[GTK] [2.53.1] Fails to build on s390x: static assertion failed
https://bugs.webkit.org/show_bug.cgi?id=312677
Summary
[GTK] [2.53.1] Fails to build on s390x: static assertion failed
Alberto Garcia
Reported
2026-04-18 07:14:18 PDT
In file included from /build/reproducible-path/webkit2gtk-2.53.1/Source/ThirdParty/skia/src/codec/SkCodec.cpp:8: In file included from /build/reproducible-path/webkit2gtk-2.53.1/Source/ThirdParty/skia/include/codec/SkCodec.h:11: In file included from /build/reproducible-path/webkit2gtk-2.53.1/Source/ThirdParty/skia/include/codec/SkEncodedOrigin.h:11: In file included from /build/reproducible-path/webkit2gtk-2.53.1/Source/ThirdParty/skia/include/core/SkMatrix.h:13: In file included from /build/reproducible-path/webkit2gtk-2.53.1/Source/ThirdParty/skia/include/core/SkRect.h:11: In file included from /build/reproducible-path/webkit2gtk-2.53.1/Source/ThirdParty/skia/include/core/SkPathTypes.h:11: /build/reproducible-path/webkit2gtk-2.53.1/Source/ThirdParty/skia/include/core/SkTypes.h:39:19: error: static assertion failed due to requirement '24 == 0 || 24 == 16': 39 | static_assert(SK_R32_SHIFT == 0 || SK_R32_SHIFT == 16, ""); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <command line>:33:22: note: expanded from macro 'SK_R32_SHIFT' 33 | #define SK_R32_SHIFT 24 | ^ This was after commit
306343@main
that removed Cairo support. ---- Relevant bit in Source/ThirdParty/skia/CMakeLists.txt: if (CMAKE_CXX_BYTE_ORDER STREQUAL "BIG_ENDIAN") target_compile_definitions(Skia PUBLIC I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN SK_R32_SHIFT=24 SK_G32_SHIFT=16 SK_B32_SHIFT=8 SK_A32_SHIFT=0 ) else () target_compile_definitions(Skia PUBLIC SK_R32_SHIFT=16 ) endif ()
Attachments
Skia Big-endian build fix
(2.45 KB, patch)
2026-05-21 12:31 PDT
,
Adrian Perez
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Carlos Garcia Campos
Comment 1
2026-04-20 00:19:44 PDT
Yes, this needs a skia patch too. We don't plan to patch skia in WebKit, but try to upstream the patch instead, in the meantime distros can apply that patch themselves.
Michael Catanzaro
Comment 2
2026-05-21 07:55:26 PDT
***
Bug 314580
has been marked as a duplicate of this bug. ***
Adrian Perez
Comment 3
2026-05-21 12:31:28 PDT
Created
attachment 479761
[details]
Skia Big-endian build fix Applying this Skia patch should at least allow building for BE architectures
Michael Catanzaro
Comment 4
2026-05-22 07:17:09 PDT
Thanks for the patch. I'll use this in Fedora.
Michael Catanzaro
Comment 5
2026-05-27 11:34:10 PDT
Comment hidden (obsolete)
I notice the changes to SkTypes.h and SkCodecPriv.h were already successfully upstreamed. The changes to Sk4px.h are not upstreamable in their current form. Then the changes to SkColorPriv.h look good to submit to upstream. I will try this patch in Fedora, based on 2.53.2: diff --git a/Source/ThirdParty/skia/src/core/Sk4px.h b/Source/ThirdParty/skia/src/core/Sk4px.h index d5d481e7e300..c7ef0bcd0ed0 100644 --- a/Source/ThirdParty/skia/src/core/Sk4px.h +++ b/Source/ThirdParty/skia/src/core/Sk4px.h @@ -27,7 +27,9 @@ public: // RGBA rgba XYZW xyzw -> AAAA aaaa WWWW wwww Sk4px alphas() const { +#ifdef SK_CPU_LENDIAN static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian."); +#endif return Sk4px(skvx::shuffle<3,3,3,3, 7,7,7,7, 11,11,11,11, 15,15,15,15>(fV)); } Sk4px inv() const { return Sk4px(skvx::byte16(255) - fV); } diff --git a/Source/ThirdParty/skia/src/core/SkColorPriv.h b/Source/ThirdParty/skia/src/core/SkColorPriv.h index 45471c25529e..319fec78069b 100644 --- a/Source/ThirdParty/skia/src/core/SkColorPriv.h +++ b/Source/ThirdParty/skia/src/core/SkColorPriv.h @@ -64,6 +64,20 @@ static inline U8CPU SkUnitScalarClampToByte(SkScalar x) { * Here we enforce this constraint. */ +#ifdef SK_CPU_BENDIAN + +#define SK_RGBA_R32_SHIFT 24 +#define SK_RGBA_G32_SHIFT 16 +#define SK_RGBA_B32_SHIFT 8 +#define SK_RGBA_A32_SHIFT 0 + +#define SK_BGRA_B32_SHIFT 24 +#define SK_BGRA_G32_SHIFT 16 +#define SK_BGRA_R32_SHIFT 8 +#define SK_BGRA_A32_SHIFT 0 + +#else + #define SK_RGBA_R32_SHIFT 0 #define SK_RGBA_G32_SHIFT 8 #define SK_RGBA_B32_SHIFT 16 @@ -74,6 +88,8 @@ static inline U8CPU SkUnitScalarClampToByte(SkScalar x) { #define SK_BGRA_R32_SHIFT 16 #define SK_BGRA_A32_SHIFT 24 +#endif + #if defined(SK_PMCOLOR_IS_RGBA) || defined(SK_PMCOLOR_IS_BGRA) #error "Configure PMCOLOR by setting SK_R32_SHIFT." #endif
Michael Catanzaro
Comment 6
2026-05-27 14:13:45 PDT
Comment hidden (obsolete)
(In reply to Michael Catanzaro from
comment #5
)
> I notice the changes to SkTypes.h and SkCodecPriv.h were already > successfully upstreamed.
OK, I misread the patch. The changes to SkTypes.h were not upstreamed yet. They look good, though. New patch for WebKitGTK 2.53.2: diff --git a/Source/ThirdParty/skia/include/core/SkTypes.h b/Source/ThirdParty/skia/include/core/SkTypes.h index 79644da049ff..fc0646e21772 100644 --- a/Source/ThirdParty/skia/include/core/SkTypes.h +++ b/Source/ThirdParty/skia/include/core/SkTypes.h @@ -33,6 +33,8 @@ # undef SK_DIRECT3D #endif +#if !defined(SK_R32_SHIFT) || !defined(SK_G32_SHIFT) || !defined(SK_B32_SHIFT) || !defined(SK_A32_SHIFT) + // If SK_R32_SHIFT is set, we'll use that to choose RGBA or BGRA. // If not, we'll default to RGBA everywhere except BGRA on Windows. #if defined(SK_R32_SHIFT) @@ -52,6 +54,8 @@ #define SK_G32_SHIFT 8 #define SK_A32_SHIFT 24 +#endif + /** * SK_PMCOLOR_BYTE_ORDER can be used to query the byte order of SkPMColor at compile time. */ diff --git a/Source/ThirdParty/skia/src/core/Sk4px.h b/Source/ThirdParty/skia/src/core/Sk4px.h index d5d481e7e300..c7ef0bcd0ed0 100644 --- a/Source/ThirdParty/skia/src/core/Sk4px.h +++ b/Source/ThirdParty/skia/src/core/Sk4px.h @@ -27,7 +27,9 @@ public: // RGBA rgba XYZW xyzw -> AAAA aaaa WWWW wwww Sk4px alphas() const { +#ifdef SK_CPU_LENDIAN static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian."); +#endif return Sk4px(skvx::shuffle<3,3,3,3, 7,7,7,7, 11,11,11,11, 15,15,15,15>(fV)); } Sk4px inv() const { return Sk4px(skvx::byte16(255) - fV); } diff --git a/Source/ThirdParty/skia/src/core/SkColorPriv.h b/Source/ThirdParty/skia/src/core/SkColorPriv.h index 45471c25529e..319fec78069b 100644 --- a/Source/ThirdParty/skia/src/core/SkColorPriv.h +++ b/Source/ThirdParty/skia/src/core/SkColorPriv.h @@ -64,6 +64,20 @@ static inline U8CPU SkUnitScalarClampToByte(SkScalar x) { * Here we enforce this constraint. */ +#ifdef SK_CPU_BENDIAN + +#define SK_RGBA_R32_SHIFT 24 +#define SK_RGBA_G32_SHIFT 16 +#define SK_RGBA_B32_SHIFT 8 +#define SK_RGBA_A32_SHIFT 0 + +#define SK_BGRA_B32_SHIFT 24 +#define SK_BGRA_G32_SHIFT 16 +#define SK_BGRA_R32_SHIFT 8 +#define SK_BGRA_A32_SHIFT 0 + +#else + #define SK_RGBA_R32_SHIFT 0 #define SK_RGBA_G32_SHIFT 8 #define SK_RGBA_B32_SHIFT 16 @@ -74,6 +88,8 @@ static inline U8CPU SkUnitScalarClampToByte(SkScalar x) { #define SK_BGRA_R32_SHIFT 16 #define SK_BGRA_A32_SHIFT 24 +#endif + #if defined(SK_PMCOLOR_IS_RGBA) || defined(SK_PMCOLOR_IS_BGRA) #error "Configure PMCOLOR by setting SK_R32_SHIFT." #endif
Michael Catanzaro
Comment 7
2026-05-27 14:48:00 PDT
There are more build failures. I've hidden my two comments above and will post here again only after I have a successful build (or decide that I need help).
Michael Catanzaro
Comment 8
2026-05-28 12:06:21 PDT
All of my build failures turned out to be: I misread Adrian's additions as deletions, because Bugzilla shows them as yellow rather than as green or red. So I just improperly removed some of the changes from his patch.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug