Summary: | net-libs/webkit-gtk-2.28.2 fails if the machine lacks sse2 instructions | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | groche97 <groche97> |
Component: | Current packages | Assignee: | Gentoo Linux Gnome Desktop Team <gnome> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
groche97
2020-06-28 17:43:31 UTC
Been trying to build webkit-gtk on an AthlonXP. Currently building net-libs/webkit-gtk-2.32.1 fails at the very end with SIGILL. I think the build is currently short circuiting the HAVE_SSE2 check. I saw https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=931052 and it seems that the JIT compiler will use SSE2 and would explain why it builds fine on an SSE2 machine and fail on target machine. Still in progress of investigating whether JIT can still be disabled and whether this does any good... and whether a non-sse2 machine can still be coaxed to build... Looks like the NO_JIT path still works (i.e. full interpreter). It still works but flaky - was able to pull up some websites "eventually" and sometimes need a few refreshes. Not sure if it's worth to include as an option for non-SSE2 machine. How I did this: it will require both a patch to 1. Revert the hardcoding of assuming all 32-bit x86 has SSE2 2. Disable JIT The former has a risk of breaking other architectures as it's a patch to the source distribution. I implemented it this way: diff -ur webkitgtk-2.32.1-old/Source/cmake/WebKitCompilerFlags.cmake webkitgtk-2.32.1/Source/cmake/WebKitCompilerFlags.cmake --- webkitgtk-2.32.1-old/Source/cmake/WebKitCompilerFlags.cmake 2021-03-25 07:27:32.000000000 -0600 +++ webkitgtk-2.32.1/Source/cmake/WebKitCompilerFlags.cmake 2021-08-06 20:57:31.514282107 -0600 @@ -143,7 +143,7 @@ endif () # Force SSE2 fp on x86 builds. - if (WTF_CPU_X86 AND NOT CMAKE_CROSSCOMPILING) + if (WTF_CPU_X86 AND NOT CMAKE_CROSSCOMPILING AND ME_I_HAVE_SSE2) WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-msse2 -mfpmath=sse) include(DetectSSE2) if (NOT SSE2_SUPPORT_FOUND) The latter is an ebuild patch to disable JIT. In the ebuild's local mycmakeargs=() section, just need to add: -DENABLE_JIT=OFF -DENABLE_C_LOOP=ON With these two changes I got it to build and run on x86 without SSE2. However DO NOT accept these patches as is because again it will break other architectures. To make it revert to original behavior in this house of cards I presented here, -DME_I_HAVE_SSE2 now needs to be set on X86 that actually has SSE2... So for now this is just for reference if you want to get no-SSE2 working, whether it should be packaged and how to best do it, I'm not sure. Very ugly hack. In any case a CPU_FLAGS_X86_SSE2 should be checked during build time to warn that the ebuild could generate a binary that cannot be run on older x86 machines after a failed day long build... |