<?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>312258</bug_id>
          
          <creation_ts>2026-04-14 03:29:20 -0700</creation_ts>
          <short_desc>inspector.gresource differs depending on the compiler used, breaking multiarch</short_desc>
          <delta_ts>2026-04-15 01:21:44 -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>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alberto Garcia">berto</reporter>
          <assigned_to name="Alberto Garcia">berto</assigned_to>
          <cc>bugs-noreply</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2200145</commentid>
    <comment_count>0</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2026-04-14 03:29:20 -0700</bug_when>
    <thetext>This is what happens:

1. During compilation the InspectorBackendCommands.js.in file is generated

This contains several #if blocks, for example:

  #if defined(ENABLE_WEBGL) &amp;&amp; ENABLE_WEBGL
  InspectorBackend.registerEnum(&quot;Canvas.ProgramType&quot;, {Compute: &quot;compute&quot;, Render: &quot;render&quot;});
  #endif // defined(ENABLE_WEBGL) &amp;&amp; ENABLE_WEBGL

2. This is run through the C preprocessor to generate InspectorBackendCommands.js

   clang -E -P -x c++ -C -DENABLE_FOO -DENABLE_BAR InspectorBackendCommands.js.in

3. The resulting file is added to inspector.gresource

In step (2), gcc is used if clang is not available, but unfortunately,
and due to the -C flag, gcc adds to the generated file several
comments from /usr/include/stdc-predef.h, e.g.:

   /* wchar_t uses Unicode 10.0.0.  Version 10.0 of the Unicode Standard is
      synchronized with ISO/IEC 10646:2017, fifth edition, plus
      the following additions from Amendment 1 to the fifth edition:
      - 56 emoji characters
      - 285 hentaigana
      - 3 additional Zanabazar Square characters */

clang does not do that, so depending on the compiler used to build
WebKit the arch-independent inspector.gresource varies depending
on the architecture, breaking multiarch installations.

Removing the -C flag is not the best option since it would strip the
actual comments from InspectorBackendCommands.js.in (including the
License and the Apple copyright notice).

One alternative is to use -ffreestanding, supported by both gcc and
clang, which does not use the standard library and therefore does not
bring anything from stdc-predef.h. Since we&apos;re using the preprocessor
to check for WebKit&apos;s own ENABLE_* and WTF_PLATFORM_* this should not
have any effect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2200146</commentid>
    <comment_count>1</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2026-04-14 03:31:58 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/62723</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2200547</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-04-15 01:21:41 -0700</bug_when>
    <thetext>Committed 311268@main (2012029f8a67): &lt;https://commits.webkit.org/311268@main&gt;

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

    </bug>

</bugzilla>