WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
279360
REGRESSION(
282934@main
): Breaks debugedit when built with GCC
https://bugs.webkit.org/show_bug.cgi?id=279360
Summary
REGRESSION(282934@main): Breaks debugedit when built with GCC
Michael Catanzaro
Reported
2024-09-09 07:03:51 PDT
Revert
282934@main
because Breaks debugedit on ppc64le.
Attachments
Add attachment
proposed patch, testcase, etc.
Michael Catanzaro
Comment 1
2024-09-09 07:05:24 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/33321
Michael Catanzaro
Comment 2
2024-09-09 07:08:27 PDT
So the problem here is "failures when processing webkitgtk binary files with DW_UT_type"
https://bugzilla.redhat.com/show_bug.cgi?id=2310828
I've created a pull request to revert, but the downstream bug is pretty active right now, so let's wait and see. I don't understand the bug and it's not yet clear to me whether WebKit is wrong to add this flag or whether this is a toolchain issue.
Michael Catanzaro
Comment 3
2024-09-09 07:10:38 PDT
As we wait for more replies from toolchain developers, I guess the two most likely options here are: * Use this flag only for aarch64 debug builds, where it's needed due to
bug #278861
* Use this flag everywhere except ppc64le
Michael Catanzaro
Comment 4
2024-09-09 07:15:11 PDT
Looking at gcc(1) I see there is a prominent warning that this flag is not compatible with "all DWARF consumers" so maybe we should use it only in developer mode: -fdebug-types-section When using DWARF Version 4 or higher, type DIEs can be put into their own ".debug_types" section instead of making them part of the ".debug_info" section. It is more efficient to put them in a separate comdat section since the linker can then remove duplicates. But not all DWARF consumers support ".debug_types" sections yet and on some objects ".debug_types" produces larger instead of smaller debugging information.
Michael Catanzaro
Comment 5
2024-09-09 08:28:18 PDT
There is some interesting discussion in the downstream bug. I still don't understand why the build only fails on ppc64le. I understand that using -fdebug-types-section is incompatible with dwz, which is what distros use to optimize debuginfo. I get the impression that we shouldn't use this flag unless we have to, but this also looks like a case where we have to.
Michael Catanzaro
Comment 6
2024-09-10 06:16:36 PDT
(In reply to Michael Catanzaro from
comment #5
)
> There is some interesting discussion in the downstream bug. I still don't > understand why the build only fails on ppc64le.
It's because I use Clang when building for all other architectures. But Clang just crashes on ppc64le, so I use GCC there. -fdebug-types-section breaks only when using GCC.
Michael Catanzaro
Comment 7
2024-09-10 07:30:40 PDT
At this point, I think the problem is this flag is going to break any distro builds regardless of architecture when using GCC. I am going to verify that by building for aarch64 with GCC now. If so, conditionalizing on architecture is not an appropriate solution. But this flag seems to work fine with Clang. The reason I noticed trouble only with ppc64le is I switched Fedora to build with Clang, except for ppc64le where Clang crashes.
Michael Catanzaro
Comment 8
2024-09-10 11:11:39 PDT
Dan has verified this change does break Fedora aarch64 builds if we use GCC rather than Clang. So let's try using -fdebug-types-section only when building with Clang. (I'm not actually sure why this doesn't break when Clang is used!)
Nikolas Zimmermann
Comment 9
2024-09-10 12:19:38 PDT
I am using this flag successfully with gcc, not clang using cross-toolchain-helper to build for rpi4.
Michael Catanzaro
Comment 10
2024-09-10 16:16:24 PDT
OK, drat. Next idea: use the flag only for WPE but not for GTK? (Because GTK surely needs to prioritize distro builds above any other considerations.) Or: use the flag only in DEVELOPER_MODE? (Because debugedit and dwz won't be a problem there.)
Adrian Perez
Comment 11
2024-09-11 01:10:04 PDT
(In reply to Michael Catanzaro from
comment #5
)
> There is some interesting discussion in the downstream bug. I still don't > understand why the build only fails on ppc64le. I understand that using > -fdebug-types-section is incompatible with dwz, which is what distros use to > optimize debuginfo. > > I get the impression that we shouldn't use this flag unless we have to, but > this also looks like a case where we have to.
I was under the impression that most distros would pass -gz[=zlib] (equivalent to --compress-debug-sections=zlib) to the compiler and linker command lines whenever they wanted compressed debuginfo, instead of relying on an external tool (dwz) that is likely to lag behind feature-wise. Not only that: the fact is that "objcopy --[de]compress-debug-sections" exists! Conversely, for splitting debug information one would pass -gsplit-dwarf to the compiler/linker, and there are objcopy incantations to extract split debuginfo from binaries. Binutils has supported compressed debug info in current (modern) formats since ~2015, and Clang since a bit earlier IIRC.
Michael Catanzaro
Comment 12
2024-09-11 09:36:51 PDT
I've checked Fedora ecosystem (
https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md
) and freedesktop-sdk ecosystem (
https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/blob/master/include/flags.yml?ref_type=heads
and
https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/blob/master/files/stripper/main.cpp#L501
). They're using dwz and debugedit, not following your suggestions. Not sure what other distros do.
Michael Catanzaro
Comment 13
2024-09-11 18:22:57 PDT
(In reply to Michael Catanzaro from
comment #10
)
> Next idea: use the flag only for WPE but not for GTK? (Because GTK surely > needs to prioritize distro builds above any other considerations.) > > Or: use the flag only in DEVELOPER_MODE? (Because debugedit and dwz won't be > a problem there.)
Any preferences? Neither of these choices really make much sense, but we have to pick something.
Michael Catanzaro
Comment 14
2024-09-12 13:08:17 PDT
I'm still not sure what to do here, so I'll just go with DEVELOPER_MODE for now. Feel free to change this to something else as long as it doesn't break WebKitGTK for distros.
EWS
Comment 15
2024-09-18 08:07:00 PDT
Committed
283843@main
(5a287cdc5ab4): <
https://commits.webkit.org/283843@main
> Reviewed commits have been landed. Closing PR #33321 and removing active labels.
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