WebKitGTK 2.39.3 fails to link lib/libwebkitgtk-6.0.so.0.0.0 with -flto=auto. The rror message is: lto1: fatal error: missing resolution data for _ZTVN7WebCore17SpeechRecognitionE I had no clue what this error message meant, and there seem to be zero relevant search results on the internet, and also zero changes to Speech Recognition code between 2.39.2 and 2.39.3. So I bisected it and found the first bad commit is 257515@main "[JSC] Clean up Structure transition watchpoint firing to pave a way to faster / cheap adaptive watchpoint" which makes no sense. This result is so weird that I will double check the results of my bisect tomorrow, just to be certain. My checkout is on 257514@main right now and it builds fine, so I will test 257515@main again. I wonder if there might be a toolchain bug here.
(In reply to Michael Catanzaro from comment #0) > This result is so weird that I will double check the results of my bisect > tomorrow, just to be certain. It's true. This is definitely somehow caused by 257515@main "[JSC] Clean up Structure transition watchpoint firing to pave a way to faster / cheap adaptive watchpoint"
I decided to just disable LTO and move on.
*** Bug 249983 has been marked as a duplicate of this bug. ***
GCC bug report: https://bugzilla.redhat.com/show_bug.cgi?id=2159783
For WebKitGTK 2.39.4 I was able to build with LTO, by using mold as linker. Toolchain in use: (Arch Linux) linux-api-headers 5.18.15 binutils 2.39 gcc 12.2.0 glibc 2.36
Created attachment 465438 [details] Suspicious, ugly patch I have been able to get a build of 2.39.91 with LTO using the BFD linker applying this patch; I have to try and see if I can shuffle things around to 1.) make it palatable for review, and 2.) keep the linker happy.
More fun... I cannot easily reproduce the build failure on my build box with the following CMake incantation: CC=gcc CXX=g++ \ LDFLAGS='-flto=auto -fuse-ld=bfd' CFLAGS='-flto=auto' CXXFLAGS='-flto=auto' \ cmake -S. -Bbuild-lto -DPORT=WPE -DCMAKE_BUILD_TYPE=Release -GNinja That is using GCC 12.2.1 and Binutils 2.40; OTOH, it's 100% reproducible doing Yocto from ToT, which has 11.3.0 and Binutils 2.38. Probably this got fixed in the newer versions, but we need to support the ones from Yocto because supported distros may have them as well. It will be slower to try and make a proper fix having to do cross builds 🥴️
Pull request: https://github.com/WebKit/WebKit/pull/11562
Committed 261724@main (ee58c2ab8371): <https://commits.webkit.org/261724@main> Reviewed commits have been landed. Closing PR #11562 and removing active labels.
(In reply to EWS from comment #9) > Committed 261724@main (ee58c2ab8371): > <https://commits.webkit.org/261724@main> > > Reviewed commits have been landed. Closing PR #11562 and removing active > labels. Also: backported into the 2.38 and 2.40 release branches 👍️