<?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>311694</bug_id>
          
          <creation_ts>2026-04-07 17:47:23 -0700</creation_ts>
          <short_desc>[WPE][cross-toolchain-helper] determineArchitecture() in webkitdirs.pm doesn&apos;t handle correctly the cross-toolchain-helper case.</short_desc>
          <delta_ts>2026-04-20 09:25:50 -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>
          
          
          <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="Carlos Alberto Lopez Perez">clopez</reporter>
          <assigned_to name="Carlos Alberto Lopez Perez">clopez</assigned_to>
          <cc>bugs-noreply</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2197827</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2026-04-07 17:47:23 -0700</bug_when>
    <thetext>I observed this when cross-building  WPE with CXXFLAGS=&quot;-g0 -O2 -DNDEBUG -Wno-cast-align -mrestrict-it -mthumb&quot;

$ Tools/Scripts/build-webkit --wpe --cross-target=rpi3-32bits-userland
CMake Error at /usr/share/cmake-3.25/Modules/CMakeTestCCompiler.cmake:70 (message):
  The C compiler

    &quot;/usr/bin/cc&quot;

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/clopez/webkit/WPEWebKit/__cmake_systeminformation/CMakeFiles/CMakeScratch/TryCompile-lIHCwp
    
    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_4fcdc/fast &amp;&amp; /usr/bin/gmake  -f CMakeFiles/cmTC_4fcdc.dir/build.make CMakeFiles/cmTC_4fcdc.dir/build
    gmake[1]: Entering directory &apos;/home/clopez/webkit/WPEWebKit/__cmake_systeminformation/CMakeFiles/CMakeScratch/TryCompile-lIHCwp&apos;
    Building C object CMakeFiles/cmTC_4fcdc.dir/testCCompiler.c.o
    /usr/bin/cc   -g0 -O2 -DNDEBUG -Wno-cast-align -mrestrict-it -mthumb  -o CMakeFiles/cmTC_4fcdc.dir/testCCompiler.c.o -c /home/clopez/webkit/WPEWebKit/__cmake_systeminformation/CMakeFiles
/CMakeScratch/TryCompile-lIHCwp/testCCompiler.c
    cc: error: unrecognized command-line option ‘-mrestrict-it’; did you mean ‘-Wrestrict’?
    cc: error: unrecognized command-line option ‘-mthumb’
    gmake[1]: *** [CMakeFiles/cmTC_4fcdc.dir/build.make:78: CMakeFiles/cmTC_4fcdc.dir/testCCompiler.c.o] Error 1
    gmake[1]: Leaving directory &apos;/home/clopez/webkit/WPEWebKit/__cmake_systeminformation/CMakeFiles/CMakeScratch/TryCompile-lIHCwp&apos;
    gmake: *** [Makefile:127: cmTC_4fcdc/fast] Error 2
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:6 (project)



Error: --system-information failed on internal CMake!
cross-toolchain-helper INFO: Adding defined environment for rpi3-32bits-userland: 
cross-toolchain-helper INFO: export BUILD_WEBKIT_ARGS=&quot;--no-fatal-warnings&quot;
cross-toolchain-helper INFO: Toolchain already built at: /home/clopez/webkit/WPEWebKit/WebKitBuild/CrossToolChains/rpi3-32bits-userland/build/toolchain
cross-toolchain-helper INFO: Running inside cross-toolchain env: /home/clopez/webkit/WPEWebKit/Tools/Scripts/build-webkit --release --wpe 
+  cmake -DPORT=&quot;WPE&quot; -DCMAKE_BUILD_TYPE=Release -G Ninja -DDEVELOPER_MODE=ON -DENABLE_EXPERIMENTAL_FEATURES=ON -DBWRAP_EXECUTABLE=/usr/bin/bwrap -DDBUS_PROXY_EXECUTABLE=/usr/bin/xdg-dbus-proxy &quot;/home/clopez/webkit/WPEWebKit&quot;
-- The C compiler identification is GNU 13.3.0
-- The CXX compiler identification is GNU 13.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/clopez/webkit/WPEWebKit/WebKitBuild/CrossToolChains/rpi3-32bits-userland/build/toolchain/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/a
rm-poky-linux-gnueabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/clopez/webkit/WPEWebKit/WebKitBuild/CrossToolChains/rpi3-32bits-userland/build/toolchain/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi
/arm-poky-linux-gnueabi-g++ - skipped
-- Detecting CXX compile features



[...]

So what happens is that build-webkit is calling cmake --system-information outside of the cross-toolchain environment at determineArchitecture()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2197833</commentid>
    <comment_count>1</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2026-04-07 18:09:59 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/62240</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2202269</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-04-20 09:25:47 -0700</bug_when>
    <thetext>Committed 311591@main (68c43f3fd9ec): &lt;https://commits.webkit.org/311591@main&gt;

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

    </bug>

</bugzilla>