[Webkit-unassigned] [Bug 280325] New: [GTK][WPE] Debug build broken with gcc12

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 25 00:42:07 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=280325

            Bug ID: 280325
           Summary: [GTK][WPE] Debug build broken with gcc12
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKitGTK
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: magomez at igalia.com
                CC: bugs-noreply at webkitgtk.org

We're currently failing to build on debug mode with gcc12 with this error:

[785/8419] Building CXX object Source/WTF/wtf/CMakeFiles/WTF.dir/SIMDUTF.cpp.o
FAILED: Source/WTF/wtf/CMakeFiles/WTF.dir/SIMDUTF.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DBUILDING_GTK__=1 -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1 -DBUILDING_WTF -DBWRAP_EXECUTABLE=\"/usr/bin/bwrap\" -DDBUS_PROXY_EXECUTABLE=\"/usr/bin/xdg-dbus-proxy\" -DGETTEXT_PACKAGE=\"WebKitGTK-6.0\" -DHAVE_CONFIG_H=1 -DJSC_GLIB_API_ENABLED -DPAS_BMALLOC=1 -DSTATICALLY_LINKED_WITH_bmalloc -I/host/home/magomez/webkit/WebKit/WebKitBuild/GTK/Debug -I/host/home/magomez/webkit/WebKit/WebKitBuild/GTK/Debug/WTF/DerivedSources -I/host/home/magomez/webkit/WebKit/Source/WTF -I/host/home/magomez/webkit/WebKit/Source/WTF/wtf -I/host/home/magomez/webkit/WebKit/Source/WTF/wtf/dtoa -I/host/home/magomez/webkit/WebKit/Source/WTF/wtf/fast_float -I/host/home/magomez/webkit/WebKit/Source/WTF/wtf/persistence -I/host/home/magomez/webkit/WebKit/Source/WTF/wtf/simdutf -I/host/home/magomez/webkit/WebKit/Source/WTF/wtf/text -I/host/home/magomez/webkit/WebKit/Source/WTF/wtf/text/icu -I/host/home/magomez/webkit/WebKit/Source/WTF/wtf/threads -I/host/home/magomez/webkit/WebKit/Source/WTF/wtf/unicode -I/host/home/magomez/webkit/WebKit/WebKitBuild/GTK/Debug/bmalloc/Headers -isystem /usr/include/gio-unix-2.0 -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /usr/include/libmount -isystem /usr/include/blkid -isystem /usr/include/sysprof-4 -fdiagnostics-color=always -Wextra -Wall -pipe -fmax-errors=20 -Wno-odr -Wno-stringop-overread -Wno-stringop-overflow -Wno-nonnull -Wno-array-bounds -Wno-expansion-to-defined -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-maybe-uninitialized -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-tautological-compare -fasynchronous-unwind-tables -fdebug-types-section -fno-strict-aliasing -fno-exceptions -fno-rtti -fcoroutines -ffunction-sections -fdata-sections -g -fPIC -fvisibility=hidden -pthread -std=c++23 -Wno-error=undef -Wno-undef -MD -MT Source/WTF/wtf/CMakeFiles/WTF.dir/SIMDUTF.cpp.o -MF Source/WTF/wtf/CMakeFiles/WTF.dir/SIMDUTF.cpp.o.d -o Source/WTF/wtf/CMakeFiles/WTF.dir/SIMDUTF.cpp.o -c /host/home/magomez/webkit/WebKit/Source/WTF/wtf/SIMDUTF.cpp
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/include/immintrin.h:47,
                 from /usr/lib/gcc/x86_64-linux-gnu/12/include/x86intrin.h:32,
                 from /host/home/magomez/webkit/WebKit/Source/WTF/wtf/simdutf/simdutf_impl.cpp.h:1860,
                 from /host/home/magomez/webkit/WebKit/Source/WTF/wtf/SIMDUTF.cpp:35:
/usr/lib/gcc/x86_64-linux-gnu/12/include/avx2intrin.h: In function ‘simdutf::haswell::{anonymous}::simd::simd8<bool> simdutf::haswell::{anonymous}::simd::operator==(simd8<unsigned char>, simd8<unsigned char>)’:
/usr/lib/gcc/x86_64-linux-gnu/12/include/avx2intrin.h:231:1: error: inlining failed in call to ‘always_inline’ ‘__m256i _mm256_cmpeq_epi8(__m256i, __m256i)’: target specific option mismatch
  231 | _mm256_cmpeq_epi8 (__m256i __A, __m256i __B)
      | ^~~~~~~~~~~~~~~~~
/host/home/magomez/webkit/WebKit/Source/WTF/wtf/simdutf/simdutf_impl.cpp.h:2468:125: note: called from here
 2468 |     friend simdutf_really_inline Mask operator==(const simd8<T> lhs, const simd8<T> rhs) { return _mm256_cmpeq_epi8(lhs, rhs); }


I did some investigation and it seems that we should be passing a missing flag to the compiler to enable the simd operations. There's a suggestion to use -mavx2 and this indeed fixes that problem, despite that doesn't seem to be an optimal value and we should choose a better one. Also, I'm not sure why this is needed on debug mode only.
Anyway, adding that flag the build continues up to skia, where we fail with a related error:

[24/6543] Building CXX object Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o
FAILED: Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DBUILDING_GTK__=1 -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1 -DBWRAP_EXECUTABLE=\"/usr/bin/bwrap\" -DDBUS_PROXY_EXECUTABLE=\"/usr/bin/xdg-dbus-proxy\" -DGETTEXT_PACKAGE=\"WebKitGTK-6.0\" -DHAVE_CONFIG_H=1 -DJSC_GLIB_API_ENABLED -DPAS_BMALLOC=1 -DSKIA_IMPLEMENTATION=1 -DSK_ASSUME_GL=0 -DSK_ASSUME_GL_ES=1 -DSK_ASSUME_WEBGL=0 -DSK_CODEC_DECODES_PNG -DSK_DISABLE_LEGACY_GL_MAKE_NATIVE_INTERFACE -DSK_DISABLE_LEGACY_IMAGE_READBUFFER -DSK_DISABLE_LEGACY_INIT_DECODERS -DSK_DISABLE_LEGACY_PNG_WRITEBUFFER -DSK_DISABLE_TRACING -DSK_DISABLE_WEBGL_INTERFACE -DSK_ENABLE_AVX512_OPTS -DSK_ENABLE_PRECOMPILE -DSK_GAMMA_APPLY_TO_A8 -DSK_GANESH -DSK_GL -DSK_R32_SHIFT=16 -DSK_RELEASE -DSK_TYPEFACE_FACTORY_FREETYPE -I/host/home/magomez/webkit/WebKit/Source/ThirdParty/skia -isystem /usr/include/freetype2 -fdiagnostics-color=always -Wextra -Wall -pipe -fmax-errors=20 -Wno-odr -Wno-stringop-overread -Wno-stringop-overflow -Wno-nonnull -Wno-array-bounds -Wno-expansion-to-defined -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-maybe-uninitialized -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-tautological-compare -fasynchronous-unwind-tables -fdebug-types-section -fno-strict-aliasing -mavx2 -fno-exceptions -fno-rtti -fcoroutines -ffunction-sections -fdata-sections -g -fPIC -fvisibility=hidden -ffp-contract=off -fstrict-aliasing -Wno-attributes -Wno-cast-align -Wno-deprecated -Wno-psabi -Wno-suggest-attribute=format -Wno-undef -Wno-uninitialized -Wno-unused-parameter -std=c++23 -MD -MT Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o -MF Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o.d -o Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o -c /host/home/magomez/webkit/WebKit/Source/ThirdParty/skia/src/core/SkOpts.cpp
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/include/immintrin.h:105,
                 from /host/home/magomez/webkit/WebKit/Source/ThirdParty/skia/src/opts/SkRasterPipeline_opts.h:106,
                 from /host/home/magomez/webkit/WebKit/Source/ThirdParty/skia/src/core/SkOpts.cpp:16:
/usr/lib/gcc/x86_64-linux-gnu/12/include/fmaintrin.h: In function ‘avx2::F avx2::mad(F, F, F)’:
/usr/lib/gcc/x86_64-linux-gnu/12/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘__m256 _mm256_fmadd_ps(__m256, __m256, __m256)’: target specific option mismatch
   63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
      | ^~~~~~~~~~~~~~~
/host/home/magomez/webkit/WebKit/Source/ThirdParty/skia/src/opts/SkRasterPipeline_opts.h:571:55: note: called from here
  571 |     SI F   mad(F f, F m, F a) { return _mm256_fmadd_ps(f, m, a); }
      |                                        ~~~~~~~~~~~~~~~^~~~~~~~~

Skia seems to be handling this flag (and other related ones) in its CMakeLists.txt file, but something seems to be off. It would be awesome if someone with knowledge about those flags could give it a look.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240925/29986623/attachment-0001.htm>


More information about the webkit-unassigned mailing list