<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>279360</bug_id>
          
          <creation_ts>2024-09-09 07:03:51 -0700</creation_ts>
          <short_desc>REGRESSION(282934@main): Breaks debugedit when built with GCC</short_desc>
          <delta_ts>2024-09-18 08:07:03 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WPE WebKit</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugzilla.redhat.com/show_bug.cgi?id=2310828</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>278861</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>aperez</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2058611</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-09 07:03:51 -0700</bug_when>
    <thetext>Revert 282934@main because Breaks debugedit on ppc64le.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2058613</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-09 07:05:24 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/33321</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2058614</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-09 07:08:27 -0700</bug_when>
    <thetext>So the problem here is &quot;failures when processing webkitgtk binary files with DW_UT_type&quot; https://bugzilla.redhat.com/show_bug.cgi?id=2310828

I&apos;ve created a pull request to revert, but the downstream bug is pretty active right now, so let&apos;s wait and see. I don&apos;t understand the bug and it&apos;s not yet clear to me whether WebKit is wrong to add this flag or whether this is a toolchain issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2058615</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-09 07:10:38 -0700</bug_when>
    <thetext>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&apos;s needed due to bug #278861
 * Use this flag everywhere except ppc64le</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2058616</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-09 07:15:11 -0700</bug_when>
    <thetext>Looking at gcc(1) I see there is a prominent warning that this flag is not compatible with &quot;all DWARF consumers&quot; 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  &quot;.debug_types&quot;  section  instead  of  making  them  part  of  the
           &quot;.debug_info&quot;  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 &quot;.debug_types&quot; sections yet and on some objects  &quot;.debug_types&quot;  produces  larger  instead  of  smaller  debugging
           information.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2058622</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-09 08:28:18 -0700</bug_when>
    <thetext>There is some interesting discussion in the downstream bug. I still don&apos;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&apos;t use this flag unless we have to, but this also looks like a case where we have to.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2058946</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-10 06:16:36 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #5)
&gt; There is some interesting discussion in the downstream bug. I still don&apos;t
&gt; understand why the build only fails on ppc64le.

It&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2058968</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-10 07:30:40 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2059039</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-10 11:11:39 -0700</bug_when>
    <thetext>Dan has verified this change does break Fedora aarch64 builds if we use GCC rather than Clang. So let&apos;s try using -fdebug-types-section only when building with Clang.

(I&apos;m not actually sure why this doesn&apos;t break when Clang is used!)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2059057</commentid>
    <comment_count>9</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2024-09-10 12:19:38 -0700</bug_when>
    <thetext>I am using this flag successfully with gcc, not clang using cross-toolchain-helper to build for rpi4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2059115</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-10 16:16:24 -0700</bug_when>
    <thetext>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&apos;t be a problem there.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2059230</commentid>
    <comment_count>11</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2024-09-11 01:10:04 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #5)
&gt; There is some interesting discussion in the downstream bug. I still don&apos;t
&gt; understand why the build only fails on ppc64le. I understand that using
&gt; -fdebug-types-section is incompatible with dwz, which is what distros use to
&gt; optimize debuginfo.
&gt; 
&gt; I get the impression that we shouldn&apos;t use this flag unless we have to, but
&gt; 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 &quot;objcopy --[de]compress-debug-sections&quot; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2059321</commentid>
    <comment_count>12</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-11 09:36:51 -0700</bug_when>
    <thetext>I&apos;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&apos;re using dwz and debugedit, not following your suggestions. Not sure what other distros do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2059520</commentid>
    <comment_count>13</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-11 18:22:57 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #10)
&gt; Next idea: use the flag only for WPE but not for GTK? (Because GTK surely
&gt; needs to prioritize distro builds above any other considerations.)
&gt; 
&gt; Or: use the flag only in DEVELOPER_MODE? (Because debugedit and dwz won&apos;t be
&gt; a problem there.)

Any preferences?

Neither of these choices really make much sense, but we have to pick something.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2059750</commentid>
    <comment_count>14</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2024-09-12 13:08:17 -0700</bug_when>
    <thetext>I&apos;m still not sure what to do here, so I&apos;ll just go with DEVELOPER_MODE for now. Feel free to change this to something else as long as it doesn&apos;t break WebKitGTK for distros.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2061072</commentid>
    <comment_count>15</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-09-18 08:07:00 -0700</bug_when>
    <thetext>Committed 283843@main (5a287cdc5ab4): &lt;https://commits.webkit.org/283843@main&gt;

Reviewed commits have been landed. Closing PR #33321 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>