Bug 249368

Summary: REGRESSION(257515@main): breaks build with -flto=auto
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: WebKitGTKAssignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, ap, bugs-noreply, fabiscafe, Hironori.Fujii, kloczko.tomasz, mcatanzaro, olivier.blin, webkit-bug-importer, ysuzuki
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=241002
https://bugzilla.redhat.com/show_bug.cgi?id=2159783
Attachments:
Description Flags
Suspicious, ugly patch none

Michael Catanzaro
Reported 2022-12-14 19:49:58 PST
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.
Attachments
Suspicious, ugly patch (1.63 KB, patch)
2023-03-14 14:45 PDT, Adrian Perez
no flags
Michael Catanzaro
Comment 1 2022-12-15 07:25:54 PST
(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"
Michael Catanzaro
Comment 2 2022-12-15 13:52:15 PST
I decided to just disable LTO and move on.
Fujii Hironori
Comment 3 2023-01-02 04:11:22 PST
*** Bug 249983 has been marked as a duplicate of this bug. ***
Michael Catanzaro
Comment 4 2023-01-10 09:57:37 PST
Fabian Bornschein
Comment 5 2023-01-17 02:02:16 PST
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
Adrian Perez
Comment 6 2023-03-14 14:45:07 PDT
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.
Adrian Perez
Comment 7 2023-03-15 03:12:34 PDT
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 🥴️
Adrian Perez
Comment 8 2023-03-15 10:33:07 PDT
EWS
Comment 9 2023-03-15 18:06:34 PDT
Committed 261724@main (ee58c2ab8371): <https://commits.webkit.org/261724@main> Reviewed commits have been landed. Closing PR #11562 and removing active labels.
Adrian Perez
Comment 10 2023-03-16 01:16:10 PDT
(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 👍️
Note You need to log in before you can comment on or make changes to this bug.