RESOLVED FIXED312258
inspector.gresource differs depending on the compiler used, breaking multiarch
https://bugs.webkit.org/show_bug.cgi?id=312258
Summary inspector.gresource differs depending on the compiler used, breaking multiarch
Alberto Garcia
Reported 2026-04-14 03:29:20 PDT
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) && ENABLE_WEBGL InspectorBackend.registerEnum("Canvas.ProgramType", {Compute: "compute", Render: "render"}); #endif // defined(ENABLE_WEBGL) && 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're using the preprocessor to check for WebKit's own ENABLE_* and WTF_PLATFORM_* this should not have any effect.
Attachments
Alberto Garcia
Comment 1 2026-04-14 03:31:58 PDT
EWS
Comment 2 2026-04-15 01:21:41 PDT
Committed 311268@main (2012029f8a67): <https://commits.webkit.org/311268@main> Reviewed commits have been landed. Closing PR #62723 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.